From patchwork Fri Aug 19 16:59:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3575 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 D0E8623F22 for ; Fri, 19 Aug 2011 16:59:41 +0000 (UTC) Received: from mail-yi0-f52.google.com (mail-yi0-f52.google.com [209.85.218.52]) by fiordland.canonical.com (Postfix) with ESMTP id A2538A18490 for ; Fri, 19 Aug 2011 16:59:41 +0000 (UTC) Received: by mail-yi0-f52.google.com with SMTP id 13so3384708yie.11 for ; Fri, 19 Aug 2011 09:59:41 -0700 (PDT) Received: by 10.150.2.16 with SMTP id 16mr2655429ybb.333.1313773181399; Fri, 19 Aug 2011 09:59:41 -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.150.157.17 with SMTP id f17cs107325ybe; Fri, 19 Aug 2011 09:59:41 -0700 (PDT) Received: by 10.216.134.83 with SMTP id r61mr708140wei.22.1313773180158; Fri, 19 Aug 2011 09:59:40 -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 y48si8935774wec.70.2011.08.19.09.59.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Aug 2011 09:59:40 -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 19so2796991wyg.37 for ; Fri, 19 Aug 2011 09:59:39 -0700 (PDT) Received: by 10.227.11.141 with SMTP id t13mr1916384wbt.36.1313773179383; Fri, 19 Aug 2011 09:59:39 -0700 (PDT) Received: from e200948.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id fh17sm2722212wbb.37.2011.08.19.09.59.37 (version=SSLv3 cipher=OTHER); Fri, 19 Aug 2011 09:59:38 -0700 (PDT) From: Dave Martin To: patches@arm.linux.org.uk Cc: patches@linaro.org, Dave Martin Subject: [PATCH 2/3] ARM: entry: Remove unnecessary masking when decoding Thumb-2 instructions Date: Fri, 19 Aug 2011 17:59:27 +0100 Message-Id: <1313773167-19020-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 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 --- KernelVersion: v3.1-rc1 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