ARM: Prevent ARMAsmParser::shouldOmitCCOutOperand() from misidentifying certain Thumb...
[oota-llvm.git] / test / MC / ARM / basic-thumb2-instructions.s
index 0cbaae4a54d9d4f9482607d6d333e0056c46bd7c..9136aa55fee3478b1d6bfc63fcfbcecddb4cfd3f 100644 (file)
@@ -1,4 +1,4 @@
-@ RUN: llvm-mc -triple=thumbv7-apple-darwin -show-encoding < %s | FileCheck %s
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding < %s | FileCheck %s
   .syntax unified
   .globl _func
 
@@ -48,6 +48,7 @@ _func:
         adcs   r0, r1, r3, lsl #7
         adc.w  r0, r1, r3, lsr #31
         adcs.w r0, r1, r3, asr #32
+        add r2, sp, ip
 
 @ CHECK: adc.w r4, r5, r6              @ encoding: [0x45,0xeb,0x06,0x04]
 @ CHECK: adcs.w        r4, r5, r6              @ encoding: [0x55,0xeb,0x06,0x04]
@@ -57,6 +58,7 @@ _func:
 @ CHECK: adcs.w        r0, r1, r3, lsl #7      @ encoding: [0x51,0xeb,0xc3,0x10]
 @ CHECK: adc.w r0, r1, r3, lsr #31     @ encoding: [0x41,0xeb,0xd3,0x70]
 @ CHECK: adcs.w        r0, r1, r3, asr #32     @ encoding: [0x51,0xeb,0x23,0x00]
+@ CHECK: add.w r2, sp, r12             @ encoding: [0x0d,0xeb,0x0c,0x02]
 
 
 @------------------------------------------------------------------------------
@@ -75,6 +77,15 @@ _func:
         adds r1, r2, #0x1f0
        add r2, #1
         add r0, r0, #32
+        adds r2, r2, #56
+        adds r2, #56
+        add r1, r7, #0xcbcbcbcb
+
+        adds.w r2, #-16
+        adds.w r2, r2, #-16
+        addw r2, #-16
+        addw r2, #-16
+        addw r2, r2, #-16
 
 @ CHECK: itet  eq                      @ encoding: [0x0a,0xbf]
 @ CHECK: addeq r1, r2, #4              @ encoding: [0x11,0x1d]
@@ -89,6 +100,15 @@ _func:
 @ CHECK: adds.w        r1, r2, #496            @ encoding: [0x12,0xf5,0xf8,0x71]
 @ CHECK: add.w r2, r2, #1              @ encoding: [0x02,0xf1,0x01,0x02]
 @ CHECK: add.w r0, r0, #32             @ encoding: [0x00,0xf1,0x20,0x00]
+@ CHECK: adds  r2, #56                 @ encoding: [0x38,0x32]
+@ CHECK: adds  r2, #56                 @ encoding: [0x38,0x32]
+@ CHECK: add.w  r1, r7, #3419130827     @ encoding: [0x07,0xf1,0xcb,0x31]
+
+@ CHECK: subs.w        r2, r2, #16             @ encoding: [0xb2,0xf1,0x10,0x02]
+@ CHECK: subs.w        r2, r2, #16             @ encoding: [0xb2,0xf1,0x10,0x02]
+@ CHECK: subw  r2, r2, #16             @ encoding: [0xa2,0xf2,0x10,0x02]
+@ CHECK: subw  r2, r2, #16             @ encoding: [0xa2,0xf2,0x10,0x02]
+@ CHECK: subw  r2, r2, #16             @ encoding: [0xa2,0xf2,0x10,0x02]
 
 
 @------------------------------------------------------------------------------
@@ -116,10 +136,14 @@ _func:
 @------------------------------------------------------------------------------
 
         subw r11, pc, #3270
+        adr.w r2, #3
         adr.w r11, #-826
+        adr.w r1, #-0x0
 
-@ CHECK: subw  r11, pc, #3270          @ encoding: [0xaf,0xf6,0xc6,0x4b]
-@ CHECK: adr.w r11, #-826              @ encoding: [0xaf,0xf2,0x3a,0x3b]
+@ CHECK: subw  r11, pc, #3270          @ encoding: [0xaf,0xf6,0xc6,0x4b]
+@ CHECK: adr.w r2, #3                  @ encoding: [0x0f,0xf2,0x03,0x02]
+@ CHECK: adr.w r11, #-826              @ encoding: [0xaf,0xf2,0x3a,0x3b]
+@ CHECK: adr.w r1, #-0                 @ encoding: [0xaf,0xf2,0x00,0x01]
 
 @------------------------------------------------------------------------------
 @ AND (immediate)
@@ -368,7 +392,8 @@ _func:
         cmp sp, r6, lsr #1
         cmp r2, r5, asr #24
         cmp r1, r4, ror #15
-        cmp r0, #-2
+        cmp r2, #-2
+        cmp r9, #1
 
 @ CHECK: cmp.w r5, #65280              @ encoding: [0xb5,0xf5,0x7f,0x4f]
 @ CHECK: cmp.w r4, r12                 @ encoding: [0xb4,0xeb,0x0c,0x0f]
@@ -377,7 +402,9 @@ _func:
 @ CHECK: cmp.w sp, r6, lsr #1          @ encoding: [0xbd,0xeb,0x56,0x0f]
 @ CHECK: cmp.w r2, r5, asr #24         @ encoding: [0xb2,0xeb,0x25,0x6f]
 @ CHECK: cmp.w r1, r4, ror #15         @ encoding: [0xb1,0xeb,0xf4,0x3f]
-@ CHECK: cmn.w r0, #2                  @ encoding: [0x10,0xf1,0x02,0x0f]
+@ CHECK: cmn.w r2, #2                  @ encoding: [0x12,0xf1,0x02,0x0f]
+@ CHECK: cmp.w r9, #1                  @ encoding: [0xb9,0xf1,0x01,0x0f]
+
 
 @------------------------------------------------------------------------------
 @ DBG
@@ -394,6 +421,23 @@ _func:
 @------------------------------------------------------------------------------
 @ DMB
 @------------------------------------------------------------------------------
+        dmb #0xf
+        dmb #0xe
+        dmb #0xd
+        dmb #0xc
+        dmb #0xb
+        dmb #0xa
+        dmb #0x9
+        dmb #0x8
+        dmb #0x7
+        dmb #0x6
+        dmb #0x5
+        dmb #0x4
+        dmb #0x3
+        dmb #0x2
+        dmb #0x1
+        dmb #0x0
+
         dmb sy
         dmb st
         dmb sh
@@ -408,6 +452,23 @@ _func:
         dmb oshst
         dmb
 
+@ CHECK: dmb   sy                      @ encoding: [0xbf,0xf3,0x5f,0x8f]
+@ CHECK: dmb   st                      @ encoding: [0xbf,0xf3,0x5e,0x8f]
+@ CHECK: dmb   #0xd                    @ encoding: [0xbf,0xf3,0x5d,0x8f]
+@ CHECK: dmb   #0xc                    @ encoding: [0xbf,0xf3,0x5c,0x8f]
+@ CHECK: dmb   ish                     @ encoding: [0xbf,0xf3,0x5b,0x8f]
+@ CHECK: dmb   ishst                   @ encoding: [0xbf,0xf3,0x5a,0x8f]
+@ CHECK: dmb   #0x9                    @ encoding: [0xbf,0xf3,0x59,0x8f]
+@ CHECK: dmb   #0x8                    @ encoding: [0xbf,0xf3,0x58,0x8f]
+@ CHECK: dmb   nsh                     @ encoding: [0xbf,0xf3,0x57,0x8f]
+@ CHECK: dmb   nshst                   @ encoding: [0xbf,0xf3,0x56,0x8f]
+@ CHECK: dmb   #0x5                    @ encoding: [0xbf,0xf3,0x55,0x8f]
+@ CHECK: dmb   #0x4                    @ encoding: [0xbf,0xf3,0x54,0x8f]
+@ CHECK: dmb   osh                     @ encoding: [0xbf,0xf3,0x53,0x8f]
+@ CHECK: dmb   oshst                   @ encoding: [0xbf,0xf3,0x52,0x8f]
+@ CHECK: dmb   #0x1                    @ encoding: [0xbf,0xf3,0x51,0x8f]
+@ CHECK: dmb   #0x0                    @ encoding: [0xbf,0xf3,0x50,0x8f]
+
 @ CHECK: dmb   sy                      @ encoding: [0xbf,0xf3,0x5f,0x8f]
 @ CHECK: dmb   st                      @ encoding: [0xbf,0xf3,0x5e,0x8f]
 @ CHECK: dmb   ish                     @ encoding: [0xbf,0xf3,0x5b,0x8f]
@@ -426,6 +487,23 @@ _func:
 @------------------------------------------------------------------------------
 @ DSB
 @------------------------------------------------------------------------------
+        dsb #0xf
+        dsb #0xe
+        dsb #0xd
+        dsb #0xc
+        dsb #0xb
+        dsb #0xa
+        dsb #0x9
+        dsb #0x8
+        dsb #0x7
+        dsb #0x6
+        dsb #0x5
+        dsb #0x4
+        dsb #0x3
+        dsb #0x2
+        dsb #0x1
+        dsb #0x0
+
         dsb sy
         dsb st
         dsb sh
@@ -440,6 +518,23 @@ _func:
         dsb oshst
         dsb
 
+@ CHECK: dsb   sy                      @ encoding: [0xbf,0xf3,0x4f,0x8f]
+@ CHECK: dsb   st                      @ encoding: [0xbf,0xf3,0x4e,0x8f]
+@ CHECK: dsb   #0xd                    @ encoding: [0xbf,0xf3,0x4d,0x8f]
+@ CHECK: dsb   #0xc                    @ encoding: [0xbf,0xf3,0x4c,0x8f]
+@ CHECK: dsb   ish                     @ encoding: [0xbf,0xf3,0x4b,0x8f]
+@ CHECK: dsb   ishst                   @ encoding: [0xbf,0xf3,0x4a,0x8f]
+@ CHECK: dsb   #0x9                    @ encoding: [0xbf,0xf3,0x49,0x8f]
+@ CHECK: dsb   #0x8                    @ encoding: [0xbf,0xf3,0x48,0x8f]
+@ CHECK: dsb   nsh                     @ encoding: [0xbf,0xf3,0x47,0x8f]
+@ CHECK: dsb   nshst                   @ encoding: [0xbf,0xf3,0x46,0x8f]
+@ CHECK: dsb   #0x5                    @ encoding: [0xbf,0xf3,0x45,0x8f]
+@ CHECK: dsb   #0x4                    @ encoding: [0xbf,0xf3,0x44,0x8f]
+@ CHECK: dsb   osh                     @ encoding: [0xbf,0xf3,0x43,0x8f]
+@ CHECK: dsb   oshst                   @ encoding: [0xbf,0xf3,0x42,0x8f]
+@ CHECK: dsb   #0x1                    @ encoding: [0xbf,0xf3,0x41,0x8f]
+@ CHECK: dsb   #0x0                    @ encoding: [0xbf,0xf3,0x40,0x8f]
+
 @ CHECK: dsb   sy                      @ encoding: [0xbf,0xf3,0x4f,0x8f]
 @ CHECK: dsb   st                      @ encoding: [0xbf,0xf3,0x4e,0x8f]
 @ CHECK: dsb   ish                     @ encoding: [0xbf,0xf3,0x4b,0x8f]
@@ -480,9 +575,13 @@ _func:
 @------------------------------------------------------------------------------
         isb sy
         isb
+        isb #15
+        isb #1
 
 @ CHECK: isb   sy                      @ encoding: [0xbf,0xf3,0x6f,0x8f]
 @ CHECK: isb   sy                      @ encoding: [0xbf,0xf3,0x6f,0x8f]
+@ CHECK: isb   sy                      @ encoding: [0xbf,0xf3,0x6f,0x8f]
+@ CHECK: isb   #0x1                    @ encoding: [0xbf,0xf3,0x61,0x8f]
 
 
 @------------------------------------------------------------------------------
@@ -502,6 +601,19 @@ _func:
 @ CHECK: subne r5, r6, r7              @ encoding: [0xf5,0x1b]
 @ CHECK: addeq r1, r2, #4              @ encoding: [0x11,0x1d]
 
+@ Should also work for UPPER CASE condition codes.
+
+        ITEET EQ
+        ADDEQ R0, R1, R2
+        NOPNE
+        SUBNE R5, R6, R7
+        ADDEQ R1, R2, #4
+
+@ CHECK: iteet eq                      @ encoding: [0x0d,0xbf]
+@ CHECK: addeq r0, r1, r2              @ encoding: [0x88,0x18]
+@ CHECK: nopne                          @ encoding: [0x00,0xbf]
+@ CHECK: subne r5, r6, r7              @ encoding: [0xf5,0x1b]
+@ CHECK: addeq r1, r2, #4              @ encoding: [0x11,0x1d]
 
 @------------------------------------------------------------------------------
 @ LDC{L}/LDC2{L}
@@ -600,7 +712,7 @@ _func:
 @ CHECK: ldm.w r4, {r5, r6}            @ encoding: [0x94,0xe8,0x60,0x00]
 @ CHECK: ldm.w r5!, {r3, r8}           @ encoding: [0xb5,0xe8,0x08,0x01]
 @ CHECK: ldm.w r5!, {r3, r8}           @ encoding: [0xb5,0xe8,0x08,0x01]
-@ CHECK: pop.w {pc, r4, r5, r6, r7, r8, r9, r10, r11} @ encoding: [0xbd,0xe8,0xf0,0x8f]
+@ CHECK: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc} @ encoding: [0xbd,0xe8,0xf0,0x8f]
 
 
 @------------------------------------------------------------------------------
@@ -748,6 +860,9 @@ _func:
         ldrd r3, r5, [r6], #-8
         ldrd r3, r5, [r6]
         ldrd r8, r1, [r3, #0]
+        ldrd r0, r1, [r2, #-0]
+        ldrd r0, r1, [r2, #-0]!
+        ldrd r0, r1, [r2], #-0
 
 @ CHECK: ldrd  r3, r5, [r6, #24]       @ encoding: [0xd6,0xe9,0x06,0x35]
 @ CHECK: ldrd  r3, r5, [r6, #24]!      @ encoding: [0xf6,0xe9,0x06,0x35]
@@ -755,6 +870,9 @@ _func:
 @ CHECK: ldrd  r3, r5, [r6], #-8       @ encoding: [0x76,0xe8,0x02,0x35]
 @ CHECK: ldrd  r3, r5, [r6]            @ encoding: [0xd6,0xe9,0x00,0x35]
 @ CHECK: ldrd  r8, r1, [r3]            @ encoding: [0xd3,0xe9,0x00,0x81]
+@ CHECK: ldrd  r0, r1, [r2, #-0]       @ encoding: [0x52,0xe9,0x00,0x01]
+@ CHECK: ldrd  r0, r1, [r2, #-0]!      @ encoding: [0x72,0xe9,0x00,0x01]
+@ CHECK: ldrd  r0, r1, [r2], #-0       @ encoding: [0x72,0xe8,0x00,0x01]
 
 
 @------------------------------------------------------------------------------
@@ -1261,6 +1379,7 @@ _func:
         msr  spsr_fc, r0
         msr  SPSR_fsxc, r5
         msr  cpsr_fsxc, r8
+        msr  cpsr, r3
 
 @ CHECK: msr   APSR_nzcvq, r1          @ encoding: [0x81,0xf3,0x00,0x88]
 @ CHECK: msr   APSR_g, r2              @ encoding: [0x82,0xf3,0x00,0x84]
@@ -1276,6 +1395,7 @@ _func:
 @ CHECK: msr   SPSR_fc, r0             @ encoding: [0x90,0xf3,0x00,0x89]
 @ CHECK: msr   SPSR_fsxc, r5           @ encoding: [0x95,0xf3,0x00,0x8f]
 @ CHECK: msr   CPSR_fsxc, r8           @ encoding: [0x88,0xf3,0x00,0x8f]
+@ CHECK: msr   CPSR_fc, r3             @ encoding: [0x83,0xf3,0x00,0x89]
 
 
 @------------------------------------------------------------------------------
@@ -2233,10 +2353,36 @@ _func:
 @ CHECK: srsia sp, #0                  @ encoding: [0x8d,0xe9,0x00,0xc0]
 @ CHECK: srsdb sp!, #19                @ encoding: [0x2d,0xe8,0x13,0xc0]
 @ CHECK: srsia sp!, #2                 @ encoding: [0xad,0xe9,0x02,0xc0]
-@ CHECK: srsdb sp, #10                 @ encoding: [0x0d,0xe8,0x0a,0xc0]
-@ CHECK: srsia sp, #9                  @ encoding: [0x8d,0xe9,0x09,0xc0]
+@ CHECK: srsia sp, #10                 @ encoding: [0x8d,0xe9,0x0a,0xc0]
+@ CHECK: srsdb sp, #9                  @ encoding: [0x0d,0xe8,0x09,0xc0]
+@ CHECK: srsia sp!, #5                 @ encoding: [0xad,0xe9,0x05,0xc0]
 @ CHECK: srsdb sp!, #5                 @ encoding: [0x2d,0xe8,0x05,0xc0]
+@ CHECK: srsia sp, #5                  @ encoding: [0x8d,0xe9,0x05,0xc0]
+@ CHECK: srsia sp!, #5                 @ encoding: [0xad,0xe9,0x05,0xc0]
+
+        srsdb #1
+        srsia #0
+
+        srsdb #19!
+        srsia #2!
+
+        srsea #10
+        srsfd #9
+
+        srsea #5!
+        srsfd #5!
+
+        srs #5
+        srs #5!
+
+@ CHECK: srsdb sp, #1                  @ encoding: [0x0d,0xe8,0x01,0xc0]
+@ CHECK: srsia sp, #0                  @ encoding: [0x8d,0xe9,0x00,0xc0]
+@ CHECK: srsdb sp!, #19                @ encoding: [0x2d,0xe8,0x13,0xc0]
+@ CHECK: srsia sp!, #2                 @ encoding: [0xad,0xe9,0x02,0xc0]
+@ CHECK: srsia sp, #10                 @ encoding: [0x8d,0xe9,0x0a,0xc0]
+@ CHECK: srsdb sp, #9                  @ encoding: [0x0d,0xe8,0x09,0xc0]
 @ CHECK: srsia sp!, #5                 @ encoding: [0xad,0xe9,0x05,0xc0]
+@ CHECK: srsdb sp!, #5                 @ encoding: [0x2d,0xe8,0x05,0xc0]
 @ CHECK: srsia sp, #5                  @ encoding: [0x8d,0xe9,0x05,0xc0]
 @ CHECK: srsia sp!, #5                 @ encoding: [0xad,0xe9,0x05,0xc0]
 
@@ -2474,6 +2620,7 @@ _func:
         strb r9, [r2], #4
         strb r3, [sp], #-4
         strb r4, [r8, #-0]!
+        strb r1, [r0], #-0
 
 @ CHECK: strb  r5, [r5, #-4]           @ encoding: [0x05,0xf8,0x04,0x5c]
 @ CHECK: strb.w        r5, [r6, #32]           @ encoding: [0x86,0xf8,0x20,0x50]
@@ -2487,6 +2634,7 @@ _func:
 @ CHECK: strb  r9, [r2], #4            @ encoding: [0x02,0xf8,0x04,0x9b]
 @ CHECK: strb  r3, [sp], #-4           @ encoding: [0x0d,0xf8,0x04,0x39]
 @ CHECK: strb  r4, [r8, #-0]!          @ encoding: [0x08,0xf8,0x00,0x4d]
+@ CHECK: strb  r1, [r0], #-0           @ encoding: [0x00,0xf8,0x00,0x19]
 
 
 @------------------------------------------------------------------------------
@@ -2530,6 +2678,9 @@ _func:
         strd r3, r5, [r6], #-8
         strd r3, r5, [r6]
         strd r8, r1, [r3, #0]
+        strd r0, r1, [r2, #-0]
+        strd r0, r1, [r2, #-0]!
+        strd r0, r1, [r2], #-0
 
 @ CHECK: strd  r3, r5, [r6, #24]       @ encoding: [0xc6,0xe9,0x06,0x35]
 @ CHECK: strd  r3, r5, [r6, #24]!      @ encoding: [0xe6,0xe9,0x06,0x35]
@@ -2537,6 +2688,9 @@ _func:
 @ CHECK: strd  r3, r5, [r6], #-8       @ encoding: [0x66,0xe8,0x02,0x35]
 @ CHECK: strd  r3, r5, [r6]            @ encoding: [0xc6,0xe9,0x00,0x35]
 @ CHECK: strd  r8, r1, [r3]            @ encoding: [0xc3,0xe9,0x00,0x81]
+@ CHECK: strd   r0, r1, [r2, #-0]       @ encoding: [0x42,0xe9,0x00,0x01]
+@ CHECK: strd   r0, r1, [r2, #-0]!      @ encoding: [0x62,0xe9,0x00,0x01]
+@ CHECK: strd   r0, r1, [r2], #-0       @ encoding: [0x62,0xe8,0x00,0x01]
 
 
 @------------------------------------------------------------------------------
@@ -2647,6 +2801,8 @@ _func:
         subs r1, r2, #0x1f0
        sub r2, #1
         sub r0, r0, #32
+        subs r2, r2, #56
+        subs r2, #56
 
 @ CHECK: itet  eq                      @ encoding: [0x0a,0xbf]
 @ CHECK: subeq r1, r2, #4              @ encoding: [0x11,0x1f]
@@ -2661,6 +2817,8 @@ _func:
 @ CHECK: subs.w        r1, r2, #496            @ encoding: [0xb2,0xf5,0xf8,0x71]
 @ CHECK: sub.w r2, r2, #1              @ encoding: [0xa2,0xf1,0x01,0x02]
 @ CHECK: sub.w r0, r0, #32             @ encoding: [0xa0,0xf1,0x20,0x00]
+@ CHECK: subs  r2, #56                 @ encoding: [0x38,0x3a]
+@ CHECK: subs  r2, #56                 @ encoding: [0x38,0x3a]
 
 
 @------------------------------------------------------------------------------
@@ -2673,6 +2831,12 @@ _func:
         sub r4, r5, r6, asr #5
         sub r4, r5, r6, ror #5
         sub.w r5, r2, r12, rrx
+        sub r2, sp, ip
+        sub sp, sp, ip
+        sub sp, ip
+        sub.w r2, sp, ip
+        sub.w sp, sp, ip
+        sub.w sp, ip
 
 @ CHECK: sub.w r4, r5, r6              @ encoding: [0xa5,0xeb,0x06,0x04]
 @ CHECK: sub.w r4, r5, r6, lsl #5      @ encoding: [0xa5,0xeb,0x46,0x14]
@@ -2681,6 +2845,12 @@ _func:
 @ CHECK: sub.w r4, r5, r6, asr #5      @ encoding: [0xa5,0xeb,0x66,0x14]
 @ CHECK: sub.w r4, r5, r6, ror #5      @ encoding: [0xa5,0xeb,0x76,0x14]
 @ CHECK: sub.w r5, r2, r12, rrx         @ encoding: [0xa2,0xeb,0x3c,0x05]
+@ CHECK: sub.w r2, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x02]
+@ CHECK: sub.w sp, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x0d]
+@ CHECK: sub.w sp, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x0d]
+@ CHECK: sub.w r2, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x02]
+@ CHECK: sub.w sp, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x0d]
+@ CHECK: sub.w sp, sp, r12             @ encoding: [0xad,0xeb,0x0c,0x0d]
 
 
 @------------------------------------------------------------------------------
@@ -3317,7 +3487,7 @@ _func:
 @ CHECK: uxth.w        r7, r8                  @ encoding: [0x1f,0xfa,0x88,0xf7]
 
 @------------------------------------------------------------------------------
-@ WFE/WFI/YIELD
+@ WFE/WFI/YIELD/HINT
 @------------------------------------------------------------------------------
         wfe
         wfi
@@ -3326,6 +3496,11 @@ _func:
         wfelt
         wfige
         yieldlt
+        hint.w #4
+        hint #3
+        hint #2
+        hint #1
+        hint #0
 
 @ CHECK: wfe                            @ encoding: [0x20,0xbf]
 @ CHECK: wfi                            @ encoding: [0x30,0xbf]
@@ -3334,17 +3509,41 @@ _func:
 @ CHECK: wfelt                          @ encoding: [0x20,0xbf]
 @ CHECK: wfige                          @ encoding: [0x30,0xbf]
 @ CHECK: yieldlt                        @ encoding: [0x10,0xbf]
+@ CHECK: sev.w                          @ encoding: [0xaf,0xf3,0x04,0x80]
+@ CHECK: wfi.w                          @ encoding: [0xaf,0xf3,0x03,0x80]
+@ CHECK: wfe.w                          @ encoding: [0xaf,0xf3,0x02,0x80]
+@ CHECK: yield.w                        @ encoding: [0xaf,0xf3,0x01,0x80]
+@ CHECK: nop.w                          @ encoding: [0xaf,0xf3,0x00,0x80]
 
 
 @------------------------------------------------------------------------------
 @ Alternate syntax for LDR*(literal) encodings
 @------------------------------------------------------------------------------
+        ldrb r11, [pc, #22]
+        ldrh r11, [pc, #22]
+        ldrsb r11, [pc, #22]
+        ldrsh r11, [pc, #22]
+        ldr.w r11, [pc, #22]
+        ldrb.w r11, [pc, #22]
+        ldrh.w r11, [pc, #22]
+        ldrsb.w r11, [pc, #22]
+        ldrsh.w r11, [pc, #22]
+
+@ CHECK: ldrb.w r11, [pc, #22]        @ encoding: [0x9f,0xf8,0x16,0xb0]
+@ CHECK: ldrh.w r11, [pc, #22]        @ encoding: [0xbf,0xf8,0x16,0xb0]
+@ CHECK: ldrsb.w r11, [pc, #22]       @ encoding: [0x9f,0xf9,0x16,0xb0]
+@ CHECK: ldrsh.w r11, [pc, #22]       @ encoding: [0xbf,0xf9,0x16,0xb0]
+@ CHECK: ldr.w r11, [pc, #22]         @ encoding: [0xdf,0xf8,0x16,0xb0]
+@ CHECK: ldrb.w r11, [pc, #22]        @ encoding: [0x9f,0xf8,0x16,0xb0]
+@ CHECK: ldrh.w r11, [pc, #22]        @ encoding: [0xbf,0xf8,0x16,0xb0]
+@ CHECK: ldrsb.w r11, [pc, #22]       @ encoding: [0x9f,0xf9,0x16,0xb0]
+@ CHECK: ldrsh.w r11, [pc, #22]       @ encoding: [0xbf,0xf9,0x16,0xb0]
+
         ldr r11, [pc, #-22]
         ldrb r11, [pc, #-22]
         ldrh r11, [pc, #-22]
         ldrsb r11, [pc, #-22]
         ldrsh r11, [pc, #-22]
-
         ldr.w r11, [pc, #-22]
         ldrb.w r11, [pc, #-22]
         ldrh.w r11, [pc, #-22]
@@ -3361,3 +3560,7 @@ _func:
 @ CHECK: ldrh.w        r11, [pc, #-22]         @ encoding: [0x3f,0xf8,0x16,0xb0]
 @ CHECK: ldrsb.w r11, [pc, #-22]        @ encoding: [0x1f,0xf9,0x16,0xb0]
 @ CHECK: ldrsh.w r11, [pc, #-22]        @ encoding: [0x3f,0xf9,0x16,0xb0]
+
+@ rdar://12596361
+        ldr r1, [pc, #12]
+@ CHECK: ldr.n r1, [pc, #12]        @ encoding: [0x03,0x49]