From patchwork Tue Aug 16 14:14:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3468 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 45CD623F6B for ; Tue, 16 Aug 2011 14:14:32 +0000 (UTC) Received: from mail-ew0-f52.google.com (mail-ew0-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3CD82A18007 for ; Tue, 16 Aug 2011 14:14:32 +0000 (UTC) Received: by ewy28 with SMTP id 28so3118167ewy.11 for ; Tue, 16 Aug 2011 07:14:32 -0700 (PDT) Received: by 10.213.29.147 with SMTP id q19mr833976ebc.132.1313504071799; Tue, 16 Aug 2011 07:14:31 -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.213.102.5 with SMTP id e5cs155309ebo; Tue, 16 Aug 2011 07:14:31 -0700 (PDT) Received: from mr.google.com ([10.216.185.9]) by 10.216.185.9 with SMTP id t9mr4588184wem.94.1313504068188 (num_hops = 1); Tue, 16 Aug 2011 07:14:28 -0700 (PDT) Received: by 10.216.185.9 with SMTP id t9mr3084414wem.94.1313504066883; Tue, 16 Aug 2011 07:14:26 -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 u44si270730weq.20.2011.08.16.07.14.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Aug 2011 07:14:26 -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 wyg19 with SMTP id 19so123784wyg.37 for ; Tue, 16 Aug 2011 07:14:26 -0700 (PDT) Received: by 10.227.200.212 with SMTP id ex20mr4684993wbb.89.1313504066040; Tue, 16 Aug 2011 07:14:26 -0700 (PDT) Received: from e200948.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id fh17sm67551wbb.20.2011.08.16.07.14.24 (version=SSLv3 cipher=OTHER); Tue, 16 Aug 2011 07:14:25 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Nicolas Pitre , Jon Medhurst Subject: [PATCH 2/3] ARM: entry: Remove unnecessary masking when decoding Thumb-2 instructions Date: Tue, 16 Aug 2011 15:14:12 +0100 Message-Id: <1313504053-27873-3-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1313504053-27873-1-git-send-email-dave.martin@linaro.org> References: <1313504053-27873-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 Acked-by: Nicolas Pitre --- 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