From patchwork Wed Aug 10 10:13:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3343 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8987823F46 for ; Wed, 10 Aug 2011 10:14:01 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 57B22A1884F for ; Wed, 10 Aug 2011 10:14:01 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so683960qwb.11 for ; Wed, 10 Aug 2011 03:14:01 -0700 (PDT) Received: by 10.229.183.84 with SMTP id cf20mr6130578qcb.121.1312971241108; Wed, 10 Aug 2011 03:14:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.190.71 with SMTP id dh7cs74595qcb; Wed, 10 Aug 2011 03:14:00 -0700 (PDT) Received: from mr.google.com ([10.216.10.132]) by 10.216.10.132 with SMTP id 4mr9421850wev.38.1312971240717 (num_hops = 1); Wed, 10 Aug 2011 03:14:00 -0700 (PDT) Received: by 10.216.10.132 with SMTP id 4mr6654597wev.38.1312971240099; Wed, 10 Aug 2011 03:14:00 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id l60si1981191weq.140.2011.08.10.03.13.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 03:14:00 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by mail-wy0-f178.google.com with SMTP id 19so714179wyg.37 for ; Wed, 10 Aug 2011 03:13:59 -0700 (PDT) Received: by 10.227.12.18 with SMTP id v18mr6700256wbv.72.1312971239370; Wed, 10 Aug 2011 03:13:59 -0700 (PDT) Received: from e200948.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id fr7sm627419wbb.22.2011.08.10.03.13.57 (version=SSLv3 cipher=OTHER); Wed, 10 Aug 2011 03:13:58 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Ben Dooks , Kukjin Kim , Nicolas Pitre , Jon Medhurst Subject: [RFC PATCH 4/5] ARM: entry: Remove unnecessary masking when decoding Thumb-2 instructions Date: Wed, 10 Aug 2011 11:13:42 +0100 Message-Id: <1312971223-28165-5-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1312971223-28165-1-git-send-email-dave.martin@linaro.org> References: <1312971223-28165-1-git-send-email-dave.martin@linaro.org> When testing whether a Thumb-2 instruction is 32 bits long or not, the masking done in order to test bits 11-15 of the first instruction halfword won't affect the result of the comparison, so remove it. Signed-off-by: Dave Martin --- arch/arm/kernel/entry-armv.S | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a87cbf8..b7236d4 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -262,8 +262,7 @@ __und_svc: ldr r0, [r4, #-4] #else ldrh r0, [r4, #-2] @ Thumb instruction at LR - 2 - and r9, r0, #0xf800 - cmp r9, #0xe800 @ 32-bit instruction if xx >= 0 + cmp r0, #0xe800 @ 32-bit instruction if xx >= 0 ldrhhs r9, [r4] @ bottom 16 bits orrhs r0, r9, r0, lsl #16 #endif @@ -445,8 +444,7 @@ __und_usr: ARM( ldrht r5, [r4], #2 ) THUMB( ldrht r5, [r4] ) THUMB( add r4, r4, #2 ) - and r0, r5, #0xf800 @ mask bits 111x x... .... .... - cmp r0, #0xe800 @ 32bit instruction if xx != 0 + cmp r5, #0xe800 @ 32bit instruction if xx != 0 blo __und_usr_unknown 3: ldrht r0, [r4] add r2, r2, #2 @ r2 is PC + 2, make it PC + 4