From patchwork Thu Aug 18 17:01:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3517 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 CFD8523F4D for ; Thu, 18 Aug 2011 17:02:09 +0000 (UTC) Received: from mail-ey0-f170.google.com (mail-ey0-f170.google.com [209.85.215.170]) by fiordland.canonical.com (Postfix) with ESMTP id C5DB9A18861 for ; Thu, 18 Aug 2011 17:02:09 +0000 (UTC) Received: by mail-ey0-f170.google.com with SMTP id 10so1739745eyd.29 for ; Thu, 18 Aug 2011 10:02:09 -0700 (PDT) Received: by 10.213.29.147 with SMTP id q19mr1879486ebc.132.1313686929514; Thu, 18 Aug 2011 10:02:09 -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 e5cs84197ebo; Thu, 18 Aug 2011 10:02:09 -0700 (PDT) Received: by 10.216.237.233 with SMTP id y83mr2642782weq.9.1313686927580; Thu, 18 Aug 2011 10:02:07 -0700 (PDT) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id w44si1276379wec.1.2011.08.18.10.02.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Aug 2011 10:02:07 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-ww0-f50.google.com with SMTP id 36so2251470wwi.31 for ; Thu, 18 Aug 2011 10:02:06 -0700 (PDT) Received: by 10.227.19.194 with SMTP id c2mr835700wbb.65.1313686926825; Thu, 18 Aug 2011 10:02:06 -0700 (PDT) Received: from e200948.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id 8sm1907629wbx.51.2011.08.18.10.02.05 (version=SSLv3 cipher=OTHER); Thu, 18 Aug 2011 10:02:06 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Nicolas Pitre , Jon Medhurst Subject: [PATCH v2 2/3] ARM: entry: Remove unnecessary masking when decoding Thumb-2 instructions Date: Thu, 18 Aug 2011 18:01:53 +0100 Message-Id: <1313686914-29481-3-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1313686914-29481-1-git-send-email-dave.martin@linaro.org> References: <1313686914-29481-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 Reviewed-by: Jon Medhurst 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