[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / aarch64-sve2-intrinsics / acle_sve2_imm_lane.cpp
blob04d22aede663ef8b94e451d5b4a73e8b655b6a59
1 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
6 #ifdef SVE_OVERLOADED_FORMS
7 // A simple used,unused... macro, long enough to represent any SVE builtin.
8 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
9 #else
10 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
11 #endif
13 #include <arm_sve.h>
15 void test_range_0_7()
17 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
18 SVE_ACLE_FUNC(svmla_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), 8);
19 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
20 SVE_ACLE_FUNC(svmla_lane,_u16,,)(svundef_u16(), svundef_u16(), svundef_u16(), -1);
21 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
22 SVE_ACLE_FUNC(svmlalb_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
23 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
24 SVE_ACLE_FUNC(svmlalb_lane,_u32,,)(svundef_u32(), svundef_u16(), svundef_u16(), 8);
25 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
26 SVE_ACLE_FUNC(svmlalb_lane,_f32,,)(svundef_f32(), svundef_f16(), svundef_f16(), -1);
27 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
28 SVE_ACLE_FUNC(svmlalt_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
29 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
30 SVE_ACLE_FUNC(svmlalt_lane,_u32,,)(svundef_u32(), svundef_u16(), svundef_u16(), 8);
31 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
32 SVE_ACLE_FUNC(svmlalt_lane,_f32,,)(svundef_f32(), svundef_f16(), svundef_f16(), -1);
33 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
34 SVE_ACLE_FUNC(svmls_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), -1);
35 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
36 SVE_ACLE_FUNC(svmls_lane,_u16,,)(svundef_u16(), svundef_u16(), svundef_u16(), 8);
37 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
38 SVE_ACLE_FUNC(svmlslb_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
39 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
40 SVE_ACLE_FUNC(svmlslb_lane,_u32,,)(svundef_u32(), svundef_u16(), svundef_u16(), 8);
41 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
42 SVE_ACLE_FUNC(svmlslb_lane,_f32,,)(svundef_f32(), svundef_f16(), svundef_f16(), -1);
43 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
44 SVE_ACLE_FUNC(svmlslt_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
45 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
46 SVE_ACLE_FUNC(svmlslt_lane,_u32,,)(svundef_u32(), svundef_u16(), svundef_u16(), 8);
47 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
48 SVE_ACLE_FUNC(svmlslt_lane,_f32,,)(svundef_f32(), svundef_f16(), svundef_f16(), -1);
49 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
50 SVE_ACLE_FUNC(svmul_lane,_s16,,)(svundef_s16(), svundef_s16(), 8);
51 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
52 SVE_ACLE_FUNC(svmul_lane,_u16,,)(svundef_u16(), svundef_u16(), -1);
53 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
54 SVE_ACLE_FUNC(svmullb_lane,_s32,,)(svundef_s16(), svundef_s16(), -1);
55 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
56 SVE_ACLE_FUNC(svmullb_lane,_u32,,)(svundef_u16(), svundef_u16(), 8);
57 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
58 SVE_ACLE_FUNC(svmullt_lane,_s32,,)(svundef_s16(), svundef_s16(), 8);
59 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
60 SVE_ACLE_FUNC(svmullt_lane,_u32,,)(svundef_u16(), svundef_u16(), -1);
61 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
62 SVE_ACLE_FUNC(svqdmlalb_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
63 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
64 SVE_ACLE_FUNC(svqdmlalt_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
65 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
66 SVE_ACLE_FUNC(svqdmulh_lane,_s16,,)(svundef_s16(), svundef_s16(), -1);
67 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
68 SVE_ACLE_FUNC(svqdmlslb_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
69 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
70 SVE_ACLE_FUNC(svqdmlslt_lane,_s32,,)(svundef_s32(), svundef_s16(), svundef_s16(), -1);
71 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
72 SVE_ACLE_FUNC(svqdmullb_lane,_s32,,)(svundef_s16(), svundef_s16(), -1);
73 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
74 SVE_ACLE_FUNC(svqdmullt_lane,_s32,,)(svundef_s16(), svundef_s16(), -1);
75 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
76 SVE_ACLE_FUNC(svqrdmlah_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), -1);
77 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
78 SVE_ACLE_FUNC(svqrdmlsh_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), -1);
79 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}}
80 SVE_ACLE_FUNC(svqrdmulh_lane,_s16,,)(svundef_s16(), svundef_s16(), -1);
83 void test_range_0_3()
85 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
86 SVE_ACLE_FUNC(svcdot_lane,_s32,,)(svundef_s32(), svundef_s8(), svundef_s8(), -1, 0);
87 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
88 SVE_ACLE_FUNC(svcmla_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), -1, 0);
89 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
90 SVE_ACLE_FUNC(svcmla_lane,_u16,,)(svundef_u16(), svundef_u16(), svundef_u16(), -1, 0);
91 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
92 SVE_ACLE_FUNC(svmla_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), -1);
93 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
94 SVE_ACLE_FUNC(svmla_lane,_u32,,)(svundef_u32(), svundef_u32(), svundef_u32(), 4);
95 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
96 SVE_ACLE_FUNC(svmlalb_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), -1);
97 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
98 SVE_ACLE_FUNC(svmlalb_lane,_u64,,)(svundef_u64(), svundef_u32(), svundef_u32(), 4);
99 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
100 SVE_ACLE_FUNC(svmlalt_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), -1);
101 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
102 SVE_ACLE_FUNC(svmlalt_lane,_u64,,)(svundef_u64(), svundef_u32(), svundef_u32(), 4);
103 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
104 SVE_ACLE_FUNC(svmls_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), 4);
105 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
106 SVE_ACLE_FUNC(svmls_lane,_u32,,)(svundef_u32(), svundef_u32(), svundef_u32(), -1);
107 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
108 SVE_ACLE_FUNC(svmlslb_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), -1);
109 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
110 SVE_ACLE_FUNC(svmlslb_lane,_u64,,)(svundef_u64(), svundef_u32(), svundef_u32(), 4);
111 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
112 SVE_ACLE_FUNC(svmlslt_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), -1);
113 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
114 SVE_ACLE_FUNC(svmlslt_lane,_u64,,)(svundef_u64(), svundef_u32(), svundef_u32(), 4);
115 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
116 SVE_ACLE_FUNC(svmul_lane,_s32,,)(svundef_s32(), svundef_s32(), -1);
117 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
118 SVE_ACLE_FUNC(svmul_lane,_u32,,)(svundef_u32(), svundef_u32(), 4);
119 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
120 SVE_ACLE_FUNC(svmullb_lane,_s64,,)(svundef_s32(), svundef_s32(), 4);
121 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
122 SVE_ACLE_FUNC(svmullb_lane,_u64,,)(svundef_u32(), svundef_u32(), -1);
123 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
124 SVE_ACLE_FUNC(svmullt_lane,_s64,,)(svundef_s32(), svundef_s32(), -1);
125 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
126 SVE_ACLE_FUNC(svmullt_lane,_u64,,)(svundef_u32(), svundef_u32(), 4);
127 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
128 SVE_ACLE_FUNC(svqdmulh_lane,_s32,,)(svundef_s32(), svundef_s32(), 4);
129 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
130 SVE_ACLE_FUNC(svqrdcmlah_lane,_s16,,)(svundef_s16(), svundef_s16(), svundef_s16(), -1, 0);
131 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
132 SVE_ACLE_FUNC(svqrdmlah_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), 4);
133 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
134 SVE_ACLE_FUNC(svqdmlalb_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), 4);
135 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
136 SVE_ACLE_FUNC(svqdmlalt_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), 4);
137 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
138 SVE_ACLE_FUNC(svqrdmlsh_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), 4);
139 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
140 SVE_ACLE_FUNC(svqdmlslb_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), 4);
141 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
142 SVE_ACLE_FUNC(svqdmlslt_lane,_s64,,)(svundef_s64(), svundef_s32(), svundef_s32(), 4);
143 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
144 SVE_ACLE_FUNC(svqrdmulh_lane,_s32,,)(svundef_s32(), svundef_s32(), 4);
145 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
146 SVE_ACLE_FUNC(svqdmullb_lane,_s64,,)(svundef_s32(), svundef_s32(), 4);
147 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}}
148 SVE_ACLE_FUNC(svqdmullt_lane,_s64,,)(svundef_s32(), svundef_s32(), -1);
151 void test_range_0_1()
153 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
154 SVE_ACLE_FUNC(svcdot_lane,_s64,,)(svundef_s64(), svundef_s16(), svundef_s16(), -1, 0);
155 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
156 SVE_ACLE_FUNC(svcmla_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), -1, 0);
157 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
158 SVE_ACLE_FUNC(svcmla_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), 2, 0);
159 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
160 SVE_ACLE_FUNC(svcmla_lane,_u32,,)(svundef_u32(), svundef_u32(), svundef_u32(), -1, 0);
161 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
162 SVE_ACLE_FUNC(svmla_lane,_s64,,)(svundef_s64(), svundef_s64(), svundef_s64(), 2);
163 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
164 SVE_ACLE_FUNC(svmla_lane,_u64,,)(svundef_u64(), svundef_u64(), svundef_u64(), -1);
165 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
166 SVE_ACLE_FUNC(svmls_lane,_s64,,)(svundef_s64(), svundef_s64(), svundef_s64(), -1);
167 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
168 SVE_ACLE_FUNC(svmls_lane,_u64,,)(svundef_u64(), svundef_u64(), svundef_u64(), 2);
169 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
170 SVE_ACLE_FUNC(svmul_lane,_s64,,)(svundef_s64(), svundef_s64(), 2);
171 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
172 SVE_ACLE_FUNC(svmul_lane,_u64,,)(svundef_u64(), svundef_u64(), -1);
173 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
174 SVE_ACLE_FUNC(svqdmulh_lane,_s64,,)(svundef_s64(), svundef_s64(), 2);
175 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
176 SVE_ACLE_FUNC(svqrdcmlah_lane,_s32,,)(svundef_s32(), svundef_s32(), svundef_s32(), 2, 0);
177 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
178 SVE_ACLE_FUNC(svqrdmlah_lane,_s64,,)(svundef_s64(), svundef_s64(), svundef_s64(), 2);
179 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
180 SVE_ACLE_FUNC(svqrdmlsh_lane,_s64,,)(svundef_s64(), svundef_s64(), svundef_s64(), 2);
181 // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}}
182 SVE_ACLE_FUNC(svqrdmulh_lane,_s64,,)(svundef_s64(), svundef_s64(), 2);