xref: /llvm-project/llvm/test/MC/ARM/neon-complex.s (revision 295cdd5c3dbd14406bf9cce01e3dfd787fb1ddda)
1// RUN: not llvm-mc -triple thumb-none-linux-gnu -mattr=+v8.3a,+neon,+fullfp16 -show-encoding < %s 2>%t | FileCheck %s --check-prefix=THUMB --check-prefix=FP16-THUMB
2// RUN: FileCheck --check-prefix=STDERR --check-prefix=NEON-STDERR <%t %s
3// RUN: not llvm-mc -triple arm-none-linux-gnu -mattr=+v8.3a,+neon,+fullfp16 -show-encoding < %s 2>%t | FileCheck %s --check-prefix=ARM --check-prefix=FP16-ARM
4// RUN: FileCheck --check-prefix=STDERR --check-prefix=NEON-STDERR <%t %s
5
6// RUN: not llvm-mc -triple thumb-none-linux-gnu -mattr=+v8.3a,+neon,-fullfp16 -show-encoding < %s 2>%t | FileCheck %s --check-prefix=THUMB
7// RUN: FileCheck --check-prefix=STDERR --check-prefix=NO-FP16-STDERR --check-prefix=NEON-STDERR <%t %s
8// RUN: not llvm-mc -triple arm-none-linux-gnu -mattr=+v8.3a,+neon,-fullfp16 -show-encoding < %s 2>%t | FileCheck %s --check-prefix=ARM
9// RUN: FileCheck --check-prefix=STDERR --check-prefix=NO-FP16-STDERR --check-prefix=NEON-STDERR <%t %s
10
11// RUN: not llvm-mc -triple thumb-none-linux-gnu -mattr=+v8.3a,-neon,+fullfp16 -show-encoding < %s 2>%t
12// RUN: FileCheck --check-prefix=STDERR --check-prefix=NO-NEON-STDERR <%t %s
13// RUN: not llvm-mc -triple arm-none-linux-gnu -mattr=+v8.3a,-neon,+fullfp16 -show-encoding < %s 2>%t
14// RUN: FileCheck --check-prefix=STDERR --check-prefix=NO-NEON-STDERR <%t %s
15
16// RUN: not llvm-mc -triple thumb-none-linux-gnu -mattr=+v8.2a,+neon,+fullfp16 -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=V82A
17// RUN: not llvm-mc -triple arm-none-linux-gnu -mattr=+v8.2a,+neon,+fullfp16 -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=V82A
18
19/* ==== VCMLA vector ==== */
20
21// Valid types
22  vcmla.f16 d0, d1, d2, #0
23// FP16-ARM: vcmla.f16       d0, d1, d2, #0  @ encoding: [0x02,0x08,0x21,0xfc]
24// FP16-THUMB: vcmla.f16       d0, d1, d2, #0  @ encoding: [0x21,0xfc,0x02,0x08]
25// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
26// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: armv8.3a
27// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
28  vcmla.f16 q0, q1, q2, #0
29// FP16-ARM: vcmla.f16       q0, q1, q2, #0  @ encoding: [0x44,0x08,0x22,0xfc]
30// FP16-THUMB: vcmla.f16       q0, q1, q2, #0  @ encoding: [0x22,0xfc,0x44,0x08]
31// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
32// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: invalid instruction, any one of the following would fix this:
33// V82A: :[[@LINE-5]]:{{[0-9]*}}: note: instruction requires: mve.fp
34// V82A: :[[@LINE-6]]:{{[0-9]*}}: note: instruction requires: armv8.3a
35// NO-NEON_STDERR: :[[@LINE-7]]:{{[0-9]*}}: error: instruction requires: NEON
36  vcmla.f32 d0, d1, d2, #0
37// ARM: vcmla.f32       d0, d1, d2, #0  @ encoding: [0x02,0x08,0x31,0xfc]
38// THUMB: vcmla.f32       d0, d1, d2, #0  @ encoding: [0x31,0xfc,0x02,0x08]
39// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
40// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
41  vcmla.f32 q0, q1, q2, #0
42// ARM: vcmla.f32       q0, q1, q2, #0  @ encoding: [0x44,0x08,0x32,0xfc]
43// THUMB: vcmla.f32       q0, q1, q2, #0  @ encoding: [0x32,0xfc,0x44,0x08]
44// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: invalid instruction, any one of the following would fix this:
45// V82A: :[[@LINE-4]]:{{[0-9]*}}: note: instruction requires: mve.fp
46// V82A: :[[@LINE-5]]:{{[0-9]*}}: note: instruction requires: armv8.3a
47// NO-NEON_STDERR: :[[@LINE-6]]:{{[0-9]*}}: error: instruction requires: NEON
48
49// Valid rotations
50  vcmla.f32 d0, d1, d2, #90
51// ARM: vcmla.f32       d0, d1, d2, #90 @ encoding: [0x02,0x08,0xb1,0xfc]
52// THUMB: vcmla.f32       d0, d1, d2, #90 @ encoding: [0xb1,0xfc,0x02,0x08]
53// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
54// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
55  vcmla.f32 d0, d1, d2, #180
56// ARM: vcmla.f32       d0, d1, d2, #180 @ encoding: [0x02,0x08,0x31,0xfd]
57// THUMB: vcmla.f32       d0, d1, d2, #180 @ encoding: [0x31,0xfd,0x02,0x08]
58// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
59// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
60  vcmla.f32 d0, d1, d2, #270
61// ARM: vcmla.f32       d0, d1, d2, #270 @ encoding: [0x02,0x08,0xb1,0xfd]
62// THUMB: vcmla.f32       d0, d1, d2, #270 @ encoding: [0xb1,0xfd,0x02,0x08]
63// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
64// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
65
66// Invalid rotations
67  vcmla.f32 d0, d1, d2, #-90
68// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
69// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
70  vcmla.f32 d0, d1, d2, #1
71// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
72// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
73  vcmla.f32 d0, d1, d2, #360
74// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
75// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
76
77/* ==== VCADD vector ==== */
78
79// Valid types
80  vcadd.f16 d0, d1, d2, #90
81// FP16-ARM: vcadd.f16       d0, d1, d2, #90 @ encoding: [0x02,0x08,0x81,0xfc]
82// FP16-THUMB: vcadd.f16       d0, d1, d2, #90 @ encoding: [0x81,0xfc,0x02,0x08]
83// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
84// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: armv8.3a
85// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
86  vcadd.f16 q0, q1, q2, #90
87// FP16-ARM: vcadd.f16       q0, q1, q2, #90 @ encoding: [0x44,0x08,0x82,0xfc]
88// FP16-THUMB: vcadd.f16       q0, q1, q2, #90 @ encoding: [0x82,0xfc,0x44,0x08]
89// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
90// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: invalid instruction, any one of the following would fix this:
91// V82A: :[[@LINE-5]]:{{[0-9]*}}: note: instruction requires: mve.fp
92// V82A: :[[@LINE-6]]:{{[0-9]*}}: note: instruction requires: armv8.3a
93// NO-NEON_STDERR: :[[@LINE-7]]:{{[0-9]*}}: error: instruction requires: NEON
94  vcadd.f32 d0, d1, d2, #90
95// ARM: vcadd.f32       d0, d1, d2, #90 @ encoding: [0x02,0x08,0x91,0xfc]
96// THUMB: vcadd.f32       d0, d1, d2, #90 @ encoding: [0x91,0xfc,0x02,0x08]
97// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
98// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
99  vcadd.f32 q0, q1, q2, #90
100// ARM: vcadd.f32       q0, q1, q2, #90 @ encoding: [0x44,0x08,0x92,0xfc]
101// THUMB: vcadd.f32       q0, q1, q2, #90 @ encoding: [0x92,0xfc,0x44,0x08]
102// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: invalid instruction, any one of the following would fix this:
103// V82A: :[[@LINE-4]]:{{[0-9]*}}: note: instruction requires: mve.fp
104// V82A: :[[@LINE-5]]:{{[0-9]*}}: note: instruction requires: armv8.3a
105// NO-NEON_STDERR: :[[@LINE-6]]:{{[0-9]*}}: error: instruction requires: NEON
106
107// Valid rotations
108  vcadd.f32 d0, d1, d2, #270
109// ARM: vcadd.f32       d0, d1, d2, #270 @ encoding: [0x02,0x08,0x91,0xfd]
110// THUMB: vcadd.f32       d0, d1, d2, #270 @ encoding: [0x91,0xfd,0x02,0x08]
111// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
112// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
113
114// Invalid rotations
115  vcadd.f32 d0, d1, d2, #0
116// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 90 or 270
117// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
118  vcadd.f32 d0, d1, d2, #180
119// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 90 or 270
120// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
121  vcadd.f32 d0, d1, d2, #-90
122// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 90 or 270
123// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
124  vcadd.f32 d0, d1, d2, #1
125// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 90 or 270
126// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
127  vcadd.f32 d0, d1, d2, #360
128// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 90 or 270
129// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
130
131
132/* ==== VCMLA indexed ==== */
133
134// Valid types
135  vcmla.f16 d0, d1, d2[0], #0
136// FP16-ARM: vcmla.f16       d0, d1, d2[0], #0 @ encoding: [0x02,0x08,0x01,0xfe]
137// FP16-THUMB: vcmla.f16       d0, d1, d2[0], #0 @ encoding: [0x01,0xfe,0x02,0x08]
138// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
139// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: armv8.3a
140// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
141  vcmla.f16 q0, q1, d2[0], #0
142// FP16-ARM: vcmla.f16       q0, q1, d2[0], #0 @ encoding: [0x42,0x08,0x02,0xfe]
143// FP16-THUMB: vcmla.f16       q0, q1, d2[0], #0 @ encoding: [0x02,0xfe,0x42,0x08]
144// NO-FP16-STDERR: :[[@LINE-3]]:{{[0-9]*}}: note: instruction requires: full half-float
145// V82A: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: armv8.3a
146// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
147  vcmla.f32 d0, d1, d2[0], #0
148// ARM: vcmla.f32       d0, d1, d2[0], #0 @ encoding: [0x02,0x08,0x81,0xfe]
149// THUMB: vcmla.f32       d0, d1, d2[0], #0 @ encoding: [0x81,0xfe,0x02,0x08]
150// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
151// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
152  vcmla.f32 q0, q1, d2[0], #0
153// ARM: vcmla.f32       q0, q1, d2[0], #0 @ encoding: [0x42,0x08,0x82,0xfe]
154// THUMB: vcmla.f32       q0, q1, d2[0], #0 @ encoding: [0x82,0xfe,0x42,0x08]
155// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
156// NO-NEON_STDERR: :[[@LINE-5]]:{{[0-9]*}}: error: instruction requires: NEON
157
158// Valid rotations
159  vcmla.f32 d0, d1, d2[0], #90
160// ARM: vcmla.f32       d0, d1, d2[0], #90 @ encoding: [0x02,0x08,0x91,0xfe]
161// THUMB: vcmla.f32       d0, d1, d2[0], #90 @ encoding: [0x91,0xfe,0x02,0x08]
162// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
163// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
164  vcmla.f32 d0, d1, d2[0], #180
165// ARM: vcmla.f32       d0, d1, d2[0], #180 @ encoding: [0x02,0x08,0xa1,0xfe]
166// THUMB: vcmla.f32       d0, d1, d2[0], #180 @ encoding: [0xa1,0xfe,0x02,0x08]
167// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
168// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
169  vcmla.f32 d0, d1, d2[0], #270
170// ARM: vcmla.f32       d0, d1, d2[0], #270 @ encoding: [0x02,0x08,0xb1,0xfe]
171// THUMB: vcmla.f32       d0, d1, d2[0], #270 @ encoding: [0xb1,0xfe,0x02,0x08]
172// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
173// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
174
175// Invalid rotations
176  vcmla.f32 d0, d1, d2[0], #-90
177// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
178// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
179  vcmla.f32 d0, d1, d2[0], #1
180// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
181// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
182  vcmla.f32 d0, d1, d2[0], #360
183// NEON-STDERR: :[[@LINE-1]]:{{[0-9]*}}: error: complex rotation must be 0, 90, 180 or 270
184// NO-NEON-STDERR: :[[@LINE-2]]:{{[0-9]*}}: error: invalid instruction
185
186// Valid indices
187  vcmla.f16 d0, d1, d2[1], #0
188// FP16-ARM: vcmla.f16       d0, d1, d2[1], #0 @ encoding: [0x22,0x08,0x01,0xfe]
189// FP16-THUMB: vcmla.f16       d0, d1, d2[1], #0 @ encoding: [0x01,0xfe,0x22,0x08]
190// V82A: :[[@LINE-3]]:{{[0-9]*}}: error: instruction requires: armv8.3a
191// NO-NEON_STDERR: :[[@LINE-4]]:{{[0-9]*}}: error: instruction requires: NEON
192
193// Invalid indices
194// The text of these errors vary depending on whether fullfp16 is present.
195  vcmla.f16 d0, d1, d2[2], #0
196// STDERR: :[[@LINE-1]]:{{[0-9]*}}: error:
197  vcmla.f32 d0, d1, d2[1], #0
198// STDERR: :[[@LINE-1]]:{{[0-9]*}}: error:
199