1 # RUN: not llvm-mc -triple=thumbv8.1m.main-none-eabi -mattr=+mve -show-encoding < %s 2>%t \
2 # RUN: | FileCheck --check-prefix=CHECK %s
3 # RUN: FileCheck --check-prefix=ERROR < %t %s
4 # RUN: not llvm-mc -triple=thumbv8.1m.main-none-eabi -mattr=+mve.fp,+fp64 -show-encoding < %s 2>%t \
5 # RUN: | FileCheck --check-prefix=CHECK %s
6 # RUN: FileCheck --check-prefix=ERROR < %t %s
7 # RUN: not llvm-mc -triple=thumbv8.1m.main-none-eabi -show-encoding < %s 2>%t \
8 # RUN: | FileCheck --check-prefix=CHECK-NOMVE %s
9 # RUN: FileCheck --check-prefix=ERROR-NOMVE < %t %s
11 # CHECK: asrl r0, r1, #23 @ encoding: [0x50,0xea,0xef,0x51]
12 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
15 # CHECK: asrl lr, r1, #27 @ encoding: [0x5e,0xea,0xef,0x61]
16 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
19 # CHECK: it eq @ encoding: [0x08,0xbf]
20 # CHECK-NEXT: asrleq lr, r1, #27 @ encoding: [0x5e,0xea,0xef,0x61]
24 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: invalid instruction
25 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: {{error|note}}: invalid instruction
28 # ERROR: [[@LINE+3]]:{{[0-9]+}}: {{error|note}}: operand must be an immediate in the range [1,32]
29 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: operand must be a register in range [r0, r12] or r14
30 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
33 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: operand must be an odd-numbered register in range [r1,r11]
34 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
37 # CHECK: asrl r0, r1, r4 @ encoding: [0x50,0xea,0x2d,0x41]
38 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
41 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: operand must be an odd-numbered register in range [r1,r11]
42 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
45 # The assembler will reject the above shifts when MVE is not supported,
46 # so the previous valid instruction will be IT EQ, so we need to add
50 # CHECK: cinc lr, r2, lo @ encoding: [0x52,0xea,0x22,0x9e]
51 # CHECK-NOMVE: cinc lr, r2, lo @ encoding: [0x52,0xea,0x22,0x9e]
54 # CHECK: cinc lr, r7, pl @ encoding: [0x57,0xea,0x47,0x9e]
55 # CHECK-NOMVE: cinc lr, r7, pl @ encoding: [0x57,0xea,0x47,0x9e]
58 # CHECK: cinv lr, r12, hs @ encoding: [0x5c,0xea,0x3c,0xae]
59 # CHECK-NOMVE: cinv lr, r12, hs @ encoding: [0x5c,0xea,0x3c,0xae]
62 # CHECK: cneg lr, r10, hs @ encoding: [0x5a,0xea,0x3a,0xbe]
63 # CHECK-NOMVE: cneg lr, r10, hs @ encoding: [0x5a,0xea,0x3a,0xbe]
64 csneg
lr, r10, r10, lo
66 # CHECK: csel r9, r9, r11, vc @ encoding: [0x59,0xea,0x7b,0x89]
67 # CHECK-NOMVE: csel r9, r9, r11, vc @ encoding: [0x59,0xea,0x7b,0x89]
70 # CHECK: cset lr, eq @ encoding: [0x5f,0xea,0x1f,0x9e]
71 # CHECK-NOMVE: cset lr, eq @ encoding: [0x5f,0xea,0x1f,0x9e]
74 # CHECK: csetm lr, hs @ encoding: [0x5f,0xea,0x3f,0xae]
75 # CHECK-NOMVE: csetm lr, hs @ encoding: [0x5f,0xea,0x3f,0xae]
78 # CHECK: csinc lr, r10, r7, le @ encoding: [0x5a,0xea,0xd7,0x9e]
79 # CHECK-NOMVE: csinc lr, r10, r7, le @ encoding: [0x5a,0xea,0xd7,0x9e]
82 # CHECK: csinv lr, r5, zr, hs @ encoding: [0x55,0xea,0x2f,0xae]
83 # CHECK-NOMVE: csinv lr, r5, zr, hs @ encoding: [0x55,0xea,0x2f,0xae]
86 # CHECK: cinv lr, r2, pl @ encoding: [0x52,0xea,0x42,0xae]
87 # CHECK-NOMVE: cinv lr, r2, pl @ encoding: [0x52,0xea,0x42,0xae]
90 # CHECK: csneg lr, r1, r11, vc @ encoding: [0x51,0xea,0x7b,0xbe]
91 # CHECK-NOMVE: csneg lr, r1, r11, vc @ encoding: [0x51,0xea,0x7b,0xbe]
94 # CHECK: lsll lr, r1, #11 @ encoding: [0x5e,0xea,0xcf,0x21]
95 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
98 # CHECK: lsll lr, r1, r4 @ encoding: [0x5e,0xea,0x0d,0x41]
99 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
102 # CHECK: lsrl lr, r1, #12 @ encoding: [0x5e,0xea,0x1f,0x31]
103 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
106 # CHECK: sqrshr lr, r12 @ encoding: [0x5e,0xea,0x2d,0xcf]
107 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
110 # CHECK: sqrshr r11, r12 @ encoding: [0x5b,0xea,0x2d,0xcf]
111 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
114 # CHECK: sqrshrl lr, r3, #64, r8 @ encoding: [0x5f,0xea,0x2d,0x83]
115 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
116 sqrshrl
lr, r3, #64, r8
118 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: saturate operand must be 48 or 64
119 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
120 sqrshrl
lr, r3, #32, r8
122 # CHECK: sqshl lr, #17 @ encoding: [0x5e,0xea,0x7f,0x4f]
123 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
126 # CHECK: sqshll lr, r11, #28 @ encoding: [0x5f,0xea,0x3f,0x7b]
127 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
130 # CHECK: srshr lr, #11 @ encoding: [0x5e,0xea,0xef,0x2f]
131 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
134 # CHECK: srshrl lr, r11, #23 @ encoding: [0x5f,0xea,0xef,0x5b]
135 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
138 # CHECK: uqrshl lr, r1 @ encoding: [0x5e,0xea,0x0d,0x1f]
139 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
142 # CHECK: uqrshll lr, r1, #48, r4 @ encoding: [0x5f,0xea,0x8d,0x41]
143 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
144 uqrshll
lr, r1, #48, r4
146 # ERROR: [[@LINE+2]]:{{[0-9]+}}: {{error|note}}: saturate operand must be 48 or 64
147 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: invalid instruction
148 uqrshll
lr, r1, #0, r4
150 # CHECK: uqshl r0, #1 @ encoding: [0x50,0xea,0x4f,0x0f]
151 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
154 # CHECK: uqshll lr, r7, #7 @ encoding: [0x5f,0xea,0xcf,0x17]
155 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
158 # CHECK: urshr r0, #10 @ encoding: [0x50,0xea,0x9f,0x2f]
159 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve
162 # CHECK: urshrl r0, r9, #29 @ encoding: [0x51,0xea,0x5f,0x79]
163 # ERROR-NOMVE: [[@LINE+1]]:{{[0-9]+}}: error: instruction requires: mve