1 // RUN
: llvm-mc
-triple aarch64-none-linux-gnu
-mattr
=+neon
-show-encoding
< %s | FileCheck
%s
3 // Check that the assembler can handle the documented syntax for AArch64
6 //----------------------------------------------------------------------
7 // Vector Move Immediate Shifted
8 //----------------------------------------------------------------------
11 movi v15.2s
, #1, lsl #8
12 movi v16.2s
, #1, lsl #16
13 movi v31.2s
, #1, lsl #24
15 movi v0.4s
, #1, lsl #8
16 movi v0.4s
, #1, lsl #16
17 movi v0.4s
, #1, lsl #24
19 movi v0.4h
, #1, lsl #8
21 movi v0.8h
, #1, lsl #8
23 // CHECK
: movi v0.2s
, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x0f]
24 // CHECK
: movi v1.2s
, #{{0x0|0}} // encoding: [0x01,0x04,0x00,0x0f]
25 // CHECK
: movi v15.2s
, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0x24,0x00,0x0f]
26 // CHECK
: movi v16.2s
, #{{0x1|1}}, lsl #16 // encoding: [0x30,0x44,0x00,0x0f]
27 // CHECK
: movi v31.2s
, #{{0x1|1}}, lsl #24 // encoding: [0x3f,0x64,0x00,0x0f]
28 // CHECK
: movi v0.4s
, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x4f]
29 // CHECK
: movi v0.4s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x24,0x00,0x4f]
30 // CHECK
: movi v0.4s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x44,0x00,0x4f]
31 // CHECK
: movi v0.4s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x64,0x00,0x4f]
32 // CHECK
: movi v0.4h
, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x0f]
33 // CHECK
: movi v0.4h
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x0f]
34 // CHECK
: movi v0.8h
, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x4f]
35 // CHECK
: movi v0.8h
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x4f]
37 //----------------------------------------------------------------------
38 // Vector Move Inverted Immediate Shifted
39 //----------------------------------------------------------------------
42 mvni v0.2s
, #1, lsl #8
43 mvni v0.2s
, #1, lsl #16
44 mvni v0.2s
, #1, lsl #24
46 mvni v15.4s
, #1, lsl #8
47 mvni v16.4s
, #1, lsl #16
48 mvni v31.4s
, #1, lsl #24
50 mvni v0.4h
, #1, lsl #8
52 mvni v0.8h
, #1, lsl #8
54 // CHECK
: mvni v0.2s
, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x2f]
55 // CHECK
: mvni v1.2s
, #{{0x0|0}} // encoding: [0x01,0x04,0x00,0x2f]
56 // CHECK
: mvni v0.2s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x24,0x00,0x2f]
57 // CHECK
: mvni v0.2s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x44,0x00,0x2f]
58 // CHECK
: mvni v0.2s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x64,0x00,0x2f]
59 // CHECK
: mvni v0.4s
, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x6f]
60 // CHECK
: mvni v15.4s
, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0x24,0x00,0x6f]
61 // CHECK
: mvni v16.4s
, #{{0x1|1}}, lsl #16 // encoding: [0x30,0x44,0x00,0x6f]
62 // CHECK
: mvni v31.4s
, #{{0x1|1}}, lsl #24 // encoding: [0x3f,0x64,0x00,0x6f]
63 // CHECK
: mvni v0.4h
, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x2f]
64 // CHECK
: mvni v0.4h
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x2f]
65 // CHECK
: mvni v0.8h
, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x6f]
66 // CHECK
: mvni v0.8h
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x6f]
68 //----------------------------------------------------------------------
69 // Vector Bitwise Bit Clear
(AND NOT) - immediate
70 //----------------------------------------------------------------------
74 bic v0.2s
, #1, lsl #16
75 bic v0.2s
, #1, lsl #24
78 bic v0.4s
, #1, lsl #16
79 bic v0.4s
, #1, lsl #24
81 bic v16.4h
, #1, lsl #8
83 bic v31.8h
, #1, lsl #8
85 // CHECK
: bic v0.2s
, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x2f]
86 // CHECK
: bic v1.2s
, #{{0x0|0}} // encoding: [0x01,0x14,0x00,0x2f]
87 // CHECK
: bic v0.2s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x2f]
88 // CHECK
: bic v0.2s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x2f]
89 // CHECK
: bic v0.2s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x2f]
90 // CHECK
: bic v0.4s
, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x6f]
91 // CHECK
: bic v0.4s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x6f]
92 // CHECK
: bic v0.4s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x6f]
93 // CHECK
: bic v0.4s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x6f]
94 // CHECK
: bic v15.4h
, #{{0x1|1}} // encoding: [0x2f,0x94,0x00,0x2f]
95 // CHECK
: bic v16.4h
, #{{0x1|1}}, lsl #8 // encoding: [0x30,0xb4,0x00,0x2f]
96 // CHECK
: bic v0.8h
, #{{0x1|1}} // encoding: [0x20,0x94,0x00,0x6f]
97 // CHECK
: bic v31.8h
, #{{0x1|1}}, lsl #8 // encoding: [0x3f,0xb4,0x00,0x6f]
99 //----------------------------------------------------------------------
100 // Vector Bitwise
OR - immedidate
101 //----------------------------------------------------------------------
104 orr v0.2s
, #1, lsl #8
105 orr v0.2s
, #1, lsl #16
106 orr v0.2s
, #1, lsl #24
108 orr v0.4s
, #1, lsl #8
109 orr v0.4s
, #1, lsl #16
110 orr v0.4s
, #1, lsl #24
112 orr v15.4h
, #1, lsl #8
114 orr v16.8h
, #1, lsl #8
116 // CHECK
: orr v0.2s
, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x0f]
117 // CHECK
: orr v1.2s
, #{{0x0|0}} // encoding: [0x01,0x14,0x00,0x0f]
118 // CHECK
: orr v0.2s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x0f]
119 // CHECK
: orr v0.2s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x0f]
120 // CHECK
: orr v0.2s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x0f]
121 // CHECK
: orr v0.4s
, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x4f]
122 // CHECK
: orr v0.4s
, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x4f]
123 // CHECK
: orr v0.4s
, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x4f]
124 // CHECK
: orr v0.4s
, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x4f]
125 // CHECK
: orr v31.4h
, #{{0x1|1}} // encoding: [0x3f,0x94,0x00,0x0f]
126 // CHECK
: orr v15.4h
, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0xb4,0x00,0x0f]
127 // CHECK
: orr v0.8h
, #{{0x1|1}} // encoding: [0x20,0x94,0x00,0x4f]
128 // CHECK
: orr v16.8h
, #{{0x1|1}}, lsl #8 // encoding: [0x30,0xb4,0x00,0x4f]
130 //----------------------------------------------------------------------
131 // Vector Move Immediate Masked
132 //----------------------------------------------------------------------
133 movi v0.2s
, #1, msl #8
134 movi v1.2s
, #1, msl #16
135 movi v0.4s
, #1, msl #8
136 movi v31.4s
, #1, msl #16
138 // CHECK
: movi v0.2s
, #{{0x1|1}}, msl #8 // encoding: [0x20,0xc4,0x00,0x0f]
139 // CHECK
: movi v1.2s
, #{{0x1|1}}, msl #16 // encoding: [0x21,0xd4,0x00,0x0f]
140 // CHECK
: movi v0.4s
, #{{0x1|1}}, msl #8 // encoding: [0x20,0xc4,0x00,0x4f]
141 // CHECK
: movi v31.4s
, #{{0x1|1}}, msl #16 // encoding: [0x3f,0xd4,0x00,0x4f]
143 //----------------------------------------------------------------------
144 // Vector Move Inverted Immediate Masked
145 //----------------------------------------------------------------------
146 mvni v1.2s
, #0x1, msl #8
147 mvni v0.2s
, #0x1, msl #16
148 mvni v31.4s
, #0x1, msl #8
149 mvni v0.4s
, #0x1, msl #16
151 // CHECK
: mvni v1.2s
, #{{0x1|1}}, msl #8 // encoding: [0x21,0xc4,0x00,0x2f]
152 // CHECK
: mvni v0.2s
, #{{0x1|1}}, msl #16 // encoding: [0x20,0xd4,0x00,0x2f]
153 // CHECK
: mvni v31.4s
, #{{0x1|1}}, msl #8 // encoding: [0x3f,0xc4,0x00,0x6f]
154 // CHECK
: mvni v0.4s
, #{{0x1|1}}, msl #16 // encoding: [0x20,0xd4,0x00,0x6f]
156 //----------------------------------------------------------------------
157 // Vector Immediate
- per byte
158 //----------------------------------------------------------------------
164 // CHECK
: movi v0.8
b, #{{0x0|0}} // encoding: [0x00,0xe4,0x00,0x0f]
165 // CHECK
: movi v31.8
b, #{{0xff|255}} // encoding: [0xff,0xe7,0x07,0x0f]
166 // CHECK
: movi v15.16
b, #{{0xf|15}} // encoding: [0xef,0xe5,0x00,0x4f]
167 // CHECK
: movi v31.16
b, #{{0x1f|31}} // encoding: [0xff,0xe7,0x00,0x4f]
169 //----------------------------------------------------------------------
170 // Vector Move Immediate
- bytemask
, per doubleword
171 //---------------------------------------------------------------------
172 movi v0.2d
, #0xff00ff00ff00ff00
174 // CHECK
: movi v0.2d
, #0xff00ff00ff00ff00 // encoding: [0x40,0xe5,0x05,0x6f]
176 //----------------------------------------------------------------------
177 // Vector Move Immediate
- bytemask
, one doubleword
178 //----------------------------------------------------------------------
179 movi d0
, #0xff00ff00ff00ff00
181 // CHECK
: movi d0
, #0xff00ff00ff00ff00 // encoding: [0x40,0xe5,0x05,0x2f]
183 //----------------------------------------------------------------------
184 // Vector Floating Point Move Immediate
185 //----------------------------------------------------------------------
190 // CHECK
: fmov v1.2s
, #{{1.00000000|1.000000e\+00}} // encoding: [0x01,0xf6,0x03,0x0f]
191 // CHECK
: fmov v15.4s
, #{{1.00000000|1.000000e\+00}} // encoding: [0x0f,0xf6,0x03,0x4f]
192 // CHECK
: fmov v31.2d
, #{{1.00000000|1.000000e\+00}} // encoding: [0x1f,0xf6,0x03,0x6f]
195 //----------------------------------------------------------------------
196 // Vector Move
- register
197 //----------------------------------------------------------------------
201 orr v0.8
b, v31.8
b, v31.8
b
202 orr v15.16
b, v16.16
b, v16.16
b
204 // CHECK
: mov v0.8
b, v31.8
b // encoding
: [0xe0,0x1f,0xbf,0x0e]
205 // CHECK
: mov v15.16
b, v16.16
b // encoding
: [0x0f,0x1e,0xb0,0x4e]
206 // CHECK
: mov v0.8
b, v31.8
b // encoding
: [0xe0,0x1f,0xbf,0x0e]
207 // CHECK
: mov v15.16
b, v16.16
b // encoding
: [0x0f,0x1e,0xb0,0x4e]