Provide Thumb2 encodings for basic loads and stores.
[oota-llvm.git] / test / MC / ARM / thumb2.s
1 @ RUN: llvm-mc -mcpu=cortex-a8 -triple thumb-unknown-unknown -show-encoding < %s | FileCheck %s
2 @ XFAIL: *
3 .code 16
4
5 @ CHECK: adc    r1, r1, #171            @ encoding: [0xab,0x01,0x41,0xf1]
6   adc   r1, r1, #171
7 @ CHECK: adc    r1, r1, #1179666        @ encoding: [0x12,0x11,0x41,0xf1]
8   adc   r1, r1, #1179666
9 @ CHECK: adc    r1, r1, #872428544      @ encoding: [0x34,0x21,0x41,0xf1]
10   adc   r1, r1, #872428544
11 @ CHECK: adc    r1, r1, #1448498774     @ encoding: [0x56,0x31,0x41,0xf1]
12   adc   r1, r1, #1448498774
13 @ CHECK: adc    r1, r1, #66846720       @ encoding: [0x7f,0x71,0x41,0xf1]
14   adc   r1, r1, #66846720
15
16 @ CHECK: mvn    r0, #187                @ encoding: [0xbb,0x00,0x6f,0xf0]
17   mvn   r0, #187
18 @ CHECK: mvn    r0, #11141290           @ encoding: [0xaa,0x10,0x6f,0xf0]
19   mvn   r0, #11141290
20 @ CHECK: mvn    r0, #-872363008         @ encoding: [0xcc,0x20,0x6f,0xf0]
21   mvn   r0, #-872363008
22 @ CHECK: mvn    r0, #1114112            @ encoding: [0x88,0x10,0x6f,0xf4]
23   mvn   r0, #1114112
24
25 @ CHECK: cmp.w  r0, #11141290           @ encoding: [0xaa,0x1f,0xb0,0xf1]
26   cmp.w r0, #11141290
27 @ CHECK: cmp.w  r0, #-872363008         @ encoding: [0xcc,0x2f,0xb0,0xf1]
28   cmp.w r0, #-872363008
29 @ CHECK: cmp.w  r0, #-572662307         @ encoding: [0xdd,0x3f,0xb0,0xf1]
30   cmp.w r0, #-572662307
31 @ CHECK: cmp.w  r0, #1114112            @ encoding: [0x88,0x1f,0xb0,0xf5]
32   cmp.w r0, #1114112
33 @ CHECK: cmp.w  r0, r1, lsl #5          @ encoding: [0x41,0x1f,0xb0,0xeb]
34   cmp.w r0, r1, lsl #5
35
36 @ CHECK: sxtab  r0, r1, r0              @ encoding: [0x80,0xf0,0x41,0xfa]
37   sxtab r0, r1, r0              @ encoding: [0x80,0xf0,0x41,0xfa]
38   
39 @ CHECK: movw   r0, #65535              @ encoding: [0xff,0x70,0x4f,0xf6]
40   movw  r0, #65535
41 @ CHECK: movw   r1, #43777              @ encoding: [0x01,0x31,0x4a,0xf6]
42   movw  r1, #43777
43 @ CHECK: movt   r1, #427                @ encoding: [0xab,0x11,0xc0,0xf2]
44   movt  r1, #427
45 @ CHECK: movw   r1, #43792              @ encoding: [0x10,0x31,0x4a,0xf6]
46   movw  r1, #43792
47 @ CHECK: movt   r1, #4267               @ encoding: [0xab,0x01,0xc0,0xf2]
48   movt  r1, #4267
49 @ CHECK: mov.w  r0, #66846720           @ encoding: [0x7f,0x70,0x4f,0xf0]
50   mov.w r0, #66846720
51
52 @ CHECK: rrx    r0, r0                  @ encoding: [0x30,0x00,0x4f,0xea]
53   rrx   r0, r0
54
55 @ CHECK: bfc    r0, #4, #20             @ encoding: [0x17,0x10,0x6f,0xf3]
56   bfc   r0, #4, #20
57 @ CHECK: bfc    r0, #0, #23             @ encoding: [0x16,0x00,0x6f,0xf3]
58   bfc   r0, #0, #23
59 @ CHECK: bfc    r0, #12, #20            @ encoding: [0x1f,0x30,0x6f,0xf3]
60   bfc   r0, #12, #20
61
62 @ CHECK: sbfx   r0, r0, #7, #11         @ encoding: [0xca,0x10,0x40,0xf3]
63   sbfx  r0, r0, #7, #11
64 @ CHECK: ubfx   r0, r0, #7, #11         @ encoding: [0xca,0x10,0xc0,0xf3]
65   ubfx  r0, r0, #7, #11
66
67 @ CHECK: mla    r0, r0, r1, r2          @ encoding: [0x01,0x20,0x00,0xfb]
68   mla   r0, r0, r1, r2
69 @ CHECK: mls    r0, r0, r1, r2          @ encoding: [0x11,0x20,0x00,0xfb]
70   mls   r0, r0, r1, r2
71
72 @ CHECK: smlabt r0, r1, r2, r0          @ encoding: [0x12,0x00,0x11,0xfb]
73   smlabt        r0, r1, r2, r0
74
75 @ CHECK: clz    r0, r0                  @ encoding: [0x80,0xf0,0xb0,0xfa]
76   clz   r0, r0
77
78 @ CHECK: pkhbt  r0, r0, r1, lsl #16     @ encoding: [0x01,0x40,0xc0,0xea]
79   pkhbt r0, r0, r1, lsl #16
80 @ CHECK: pkhbt  r0, r0, r1, lsl #12     @ encoding: [0x01,0x30,0xc0,0xea]
81   pkhbt r0, r0, r1, lsl #16
82 @ CHECK: pkhbt  r0, r0, r1, lsl #18     @ encoding: [0x81,0x40,0xc0,0xea]
83   pkhbt r0, r0, r1, lsl #18
84 @ CHECK: pkhbt  r0, r0, r1              @ encoding: [0x01,0x00,0xc0,0xea]
85   pkhbt r0, r0, r1
86 @ CHECK: pkhtb  r0, r0, r1, asr #16     @ encoding: [0x21,0x40,0xc0,0xea]
87   pkhtb r0, r0, r1, asr #16
88 @ CHECK: pkhtb  r0, r0, r1, asr #12     @ encoding: [0x21,0x30,0xc0,0xea]
89   pkhtb r0, r0, r1, asr #12
90 @ CHECK: pkhtb  r0, r0, r1, asr #18     @ encoding: [0xa1,0x40,0xc0,0xea]
91   pkhtb r0, r0, r1, asr #18
92 @ CHECK: pkhtb  r0, r0, r1, asr #22     @ encoding: [0xa1,0x50,0xc0,0xea]
93   pkhtb r0, r0, r1, asr #22
94
95 @ CHECK: dmb    st                      @ encoding: [0x5e,0x8f,0xbf,0xf3]
96   dmb   st
97 @ CHECK: dmb    sy                      @ encoding: [0x5f,0x8f,0xbf,0xf3]
98   dmb   sy
99 @ CHECK: dmb    ishst                   @ encoding: [0x5a,0x8f,0xbf,0xf3]
100   dmb   ishst
101 @ CHECK: dmb    ish                     @ encoding: [0x5b,0x8f,0xbf,0xf3]
102   dmb   ish
103
104 @ CHECK: str.w  r0, [r1, #4092]         @ encoding: [0xfc,0x0f,0xc1,0xf8]
105   str.w r0, [r1, #4092]
106 @ CHECK: str    r0, [r1, #-128]         @ encoding: [0x80,0x0c,0x41,0xf8]
107   str   r0, [r1, #-128]
108 @ CHECK: str.w  r0, [r1, r2, lsl #2]    @ encoding: [0x22,0x00,0x41,0xf8
109   str.w r0, [r1, r2, lsl #2]
110
111 @ CHECK: ldr.w  r0, [r0, #4092]         @ encoding: [0xfc,0x0f,0xd0,0xf8]
112   ldr.w r0, [r0, #4092]
113 @ CHECK: ldr    r0, [r0, #-128]         @ encoding: [0x80,0x0c,0x50,0xf8]
114   ldr   r0, [r0, #-128]
115 @ CHECK: ldr.w  r0, [r0, r1, lsl #2]    @ encoding: [0x21,0x00,0x50,0xf8]
116   ldr.w r0, [r0, r1, lsl #2]
117