1 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sve -fsyntax-only -verify -verify-ignore-unexpected=error %s
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sve -fsyntax-only -verify -verify-ignore-unexpected=error %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
10 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15 void test_range_0_0(uint32_t slice
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
16 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
17 SVE_ACLE_FUNC(svld1_hor_za8
,,,)(-1, slice
, pg
, ptr
);
18 // expected-error@+1 {{argument value 1 is outside the valid range [0, 0]}}
19 SVE_ACLE_FUNC(svst1_ver_za8
,,,)(1, slice
, pg
, ptr
);
20 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
21 SVE_ACLE_FUNC(svld1_hor_vnum_za8
,,,)(-1, slice
, pg
, ptr
, 1);
22 // expected-error@+1 {{argument value 1 is outside the valid range [0, 0]}}
23 SVE_ACLE_FUNC(svst1_ver_vnum_za8
,,,)(1, slice
, pg
, ptr
, 1);
25 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
26 SVE_ACLE_FUNC(svread_hor_za8
, _s8
, _m
,)(svundef_s8(), pg
, -1, slice
);
27 // expected-error@+1 {{argument value 1 is outside the valid range [0, 0]}}
28 SVE_ACLE_FUNC(svread_ver_za8
, _s8
, _m
,)(svundef_s8(), pg
, 1, slice
);
29 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
30 SVE_ACLE_FUNC(svwrite_hor_za8
, _s8
, _m
,)(-1, slice
, pg
, svundef_s8());
31 // expected-error@+1 {{argument value 1 is outside the valid range [0, 0]}}
32 SVE_ACLE_FUNC(svwrite_ver_za8
, _s8
, _m
,)(1, slice
, pg
, svundef_s8());
35 void test_range_0_1(uint32_t slice
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
36 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
37 SVE_ACLE_FUNC(svld1_hor_za16
,,,)(-1, slice
, pg
, ptr
);
38 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
39 SVE_ACLE_FUNC(svst1_ver_za16
,,,)(2, slice
, pg
, ptr
);
40 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
41 SVE_ACLE_FUNC(svld1_hor_vnum_za16
,,,)(-1, slice
, pg
, ptr
, 1);
42 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
43 SVE_ACLE_FUNC(svst1_ver_vnum_za16
,,,)(2, slice
, pg
, ptr
, 1);
45 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
46 SVE_ACLE_FUNC(svread_hor_za16
, _s16
, _m
,)(svundef_s16(), pg
, -1, slice
);
47 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
48 SVE_ACLE_FUNC(svread_ver_za16
, _s16
, _m
,)(svundef_s16(), pg
, 2, slice
);
49 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
50 SVE_ACLE_FUNC(svwrite_hor_za16
, _s16
, _m
,)(-1, slice
, pg
, svundef_s16());
51 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
52 SVE_ACLE_FUNC(svwrite_ver_za16
, _s16
, _m
,)(2, slice
, pg
, svundef_s16());
55 void test_range_0_3(uint32_t slice
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
56 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
57 SVE_ACLE_FUNC(svld1_hor_za32
,,,)(-1, slice
, pg
, ptr
);
58 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
59 SVE_ACLE_FUNC(svst1_ver_za32
,,,)(4, slice
, pg
, ptr
);
60 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
61 SVE_ACLE_FUNC(svld1_hor_vnum_za32
,,,)(-1, slice
, pg
, ptr
, 1);
62 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
63 SVE_ACLE_FUNC(svst1_ver_vnum_za32
,,,)(4, slice
, pg
, ptr
, 1);
65 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
66 SVE_ACLE_FUNC(svread_hor_za32
, _s32
, _m
,)(svundef_s32(), pg
, -1, slice
);
67 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
68 SVE_ACLE_FUNC(svread_ver_za32
, _s32
, _m
,)(svundef_s32(), pg
, 4, slice
);
69 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
70 SVE_ACLE_FUNC(svwrite_hor_za32
, _s32
, _m
,)(-1, slice
, pg
, svundef_s32());
71 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
72 SVE_ACLE_FUNC(svwrite_ver_za32
, _s32
, _m
,)(4, slice
, pg
, svundef_s32());
74 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
75 SVE_ACLE_FUNC(svaddha_za32
, _s32
, _m
,)(4, pg
, pg
, svundef_s32());
76 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
77 SVE_ACLE_FUNC(svaddva_za32
, _s32
, _m
,)(-1, pg
, pg
, svundef_s32());
79 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
80 SVE_ACLE_FUNC(svmopa_za32
, _s8
, _m
,)(4, pg
, pg
, svundef_s8(), svundef_s8());
81 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
82 SVE_ACLE_FUNC(svmops_za32
, _s8
, _m
,)(-1, pg
, pg
, svundef_s8(), svundef_s8());
83 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
84 SVE_ACLE_FUNC(svsumopa_za32
, _s8
, _m
,)(4, pg
, pg
, svundef_s8(), svundef_u8());
85 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
86 SVE_ACLE_FUNC(svsumops_za32
, _s8
, _m
,)(-1, pg
, pg
, svundef_s8(), svundef_u8());
87 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
88 SVE_ACLE_FUNC(svusmopa_za32
, _u8
, _m
,)(4, pg
, pg
, svundef_u8(), svundef_s8());
89 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
90 SVE_ACLE_FUNC(svusmops_za32
, _u8
, _m
,)(-1, pg
, pg
, svundef_u8(), svundef_s8());
93 void test_range_0_7(uint32_t slice
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
94 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
95 SVE_ACLE_FUNC(svld1_hor_za64
,,,)(-1, slice
, pg
, ptr
);
96 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
97 SVE_ACLE_FUNC(svst1_ver_za64
,,,)(8, slice
, pg
, ptr
);
98 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
99 SVE_ACLE_FUNC(svld1_hor_vnum_za64
,,,)(-1, slice
, pg
, ptr
, 1);
100 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
101 SVE_ACLE_FUNC(svst1_ver_vnum_za64
,,,)(8, slice
, pg
, ptr
, 1);
103 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
104 SVE_ACLE_FUNC(svread_hor_za64
, _s64
, _m
,)(svundef_s64(), pg
, -1, slice
);
105 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
106 SVE_ACLE_FUNC(svread_ver_za64
, _s64
, _m
,)(svundef_s64(), pg
, 8, slice
);
107 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
108 SVE_ACLE_FUNC(svwrite_hor_za64
, _s64
, _m
,)(-1, slice
, pg
, svundef_s64());
109 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
110 SVE_ACLE_FUNC(svwrite_ver_za64
, _s64
, _m
,)(8, slice
, pg
, svundef_s64());
112 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
113 SVE_ACLE_FUNC(svaddha_za64
, _s64
, _m
,)(8, pg
, pg
, svundef_s64());
114 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
115 SVE_ACLE_FUNC(svaddva_za64
, _s64
, _m
,)(-1, pg
, pg
, svundef_s64());
117 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
118 SVE_ACLE_FUNC(svmopa_za64
, _s16
, _m
,)(8, pg
, pg
, svundef_s16(), svundef_s16());
119 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
120 SVE_ACLE_FUNC(svmops_za64
, _s16
, _m
,)(-1, pg
, pg
, svundef_s16(), svundef_s16());
121 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
122 SVE_ACLE_FUNC(svsumopa_za64
, _s16
, _m
,)(8, pg
, pg
, svundef_s16(), svundef_u16());
123 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
124 SVE_ACLE_FUNC(svsumops_za64
, _s16
, _m
,)(-1, pg
, pg
, svundef_s16(), svundef_u16());
125 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
126 SVE_ACLE_FUNC(svusmopa_za64
, _u16
, _m
,)(8, pg
, pg
, svundef_u16(), svundef_s16());
127 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
128 SVE_ACLE_FUNC(svusmops_za64
, _u16
, _m
,)(-1, pg
, pg
, svundef_u16(), svundef_s16());
130 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
131 SVE_ACLE_FUNC(svmopa_za64
, _f64
, _m
,)(8, pg
, pg
, svundef_f64(), svundef_f64());
132 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
133 SVE_ACLE_FUNC(svmops_za64
, _f64
, _m
,)(-1, pg
, pg
, svundef_f64(), svundef_f64());
136 void test_range_0_15(uint32_t slice
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
137 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
138 SVE_ACLE_FUNC(svld1_hor_za128
,,,)(-1, slice
, pg
, ptr
);
139 // expected-error@+1 {{argument value 16 is outside the valid range [0, 15]}}
140 SVE_ACLE_FUNC(svst1_ver_za128
,,,)(16, slice
, pg
, ptr
);
141 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
142 SVE_ACLE_FUNC(svld1_hor_vnum_za128
,,,)(-1, slice
, pg
, ptr
, 1);
143 // expected-error@+1 {{argument value 16 is outside the valid range [0, 15]}}
144 SVE_ACLE_FUNC(svst1_ver_vnum_za128
,,,)(16, slice
, pg
, ptr
, 1);
146 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
147 SVE_ACLE_FUNC(svread_hor_za128
, _s8
, _m
,)(svundef_s8(), pg
, -1, slice
);
148 // expected-error@+1 {{argument value 16 is outside the valid range [0, 15]}}
149 SVE_ACLE_FUNC(svread_ver_za128
, _s8
, _m
,)(svundef_s8(), pg
, 16, slice
);
150 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
151 SVE_ACLE_FUNC(svwrite_hor_za128
, _s8
, _m
,)(-1, slice
, pg
, svundef_s8());
152 // expected-error@+1 {{argument value 16 is outside the valid range [0, 15]}}
153 SVE_ACLE_FUNC(svwrite_ver_za128
, _s8
, _m
,)(16, slice
, pg
, svundef_s8());
156 void test_range_0_255(svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
157 // expected-error@+1 {{argument value 256 is outside the valid range [0, 255]}}
158 SVE_ACLE_FUNC(svzero_mask_za
,,,)(256);
159 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 255]}}
160 SVE_ACLE_FUNC(svzero_mask_za
,,,)(-1);
163 void test_constant(uint64_t u64
, svbool_t pg
, void *ptr
) __arm_streaming
__arm_inout("za") {
164 SVE_ACLE_FUNC(svld1_hor_za8
,,,)(u64
, u64
, pg
, ptr
); // expected-error {{argument to 'svld1_hor_za8' must be a constant integer}}
165 SVE_ACLE_FUNC(svst1_hor_za32
,,,)(u64
, 0, pg
, ptr
); // expected-error {{argument to 'svst1_hor_za32' must be a constant integer}}
166 SVE_ACLE_FUNC(svld1_hor_vnum_za8
,,,)(u64
, 0, pg
, ptr
, u64
); // expected-error {{argument to 'svld1_hor_vnum_za8' must be a constant integer}}
167 SVE_ACLE_FUNC(svst1_hor_vnum_za32
,,,)(u64
, 0, pg
, ptr
, u64
); // expected-error {{argument to 'svst1_hor_vnum_za32' must be a constant integer}}
169 SVE_ACLE_FUNC(svread_ver_za16
, _s16
, _m
,)(svundef_s16(), pg
, u64
, 0); // expected-error-re {{argument to 'svread_ver_za16{{.*}}_m' must be a constant integer}}
170 SVE_ACLE_FUNC(svwrite_ver_za64
, _s64
, _m
,)(u64
, 0, pg
, svundef_s64()); // expected-error-re {{argument to 'svwrite_ver_za64{{.*}}_m' must be a constant integer}}