ARM: 7030/1: entry: Remove unnecessary masking when decoding Thumb-2 instructions
authorDave Martin <dave.martin@linaro.org>
Fri, 19 Aug 2011 16:59:27 +0000 (17:59 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 17 Oct 2011 08:12:40 +0000 (09:12 +0100)
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 <dave.martin@linaro.org>
Reviewed-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/entry-armv.S

index a87cbf889ff479f635df3d42af731f80e32e8e64..b7236d400aeb8773a503ff5d197f60b60d4554fe 100644 (file)
@@ -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