4
4
5
5
// REQUIRES: aarch64-registered-target
6
6
7
+ #include <arm_neon.h>
7
8
#include <arm_sve.h>
8
9
#include <stdarg.h>
9
10
@@ -16,6 +17,10 @@ typedef struct {
16
17
float f [4 ];
17
18
} HFA ;
18
19
20
+ typedef struct {
21
+ mfloat8x16_t f [4 ];
22
+ } HVA ;
23
+
19
24
// Pure Scalable Type, needs 4 Z-regs, 2 P-regs
20
25
typedef struct {
21
26
bvec a ;
@@ -140,17 +145,19 @@ void test_argpass_last_p(PST *p) {
140
145
// Not enough Z-regs, push PST to memory and pass a pointer, Z-regs and
141
146
// P-regs still available for other arguments
142
147
// u -> z0
143
- // 0.0 -> d1-d4
148
+ // v -> q1
149
+ // w -> q2
150
+ // 0.0 -> d3-d4
144
151
// 1 -> w0
145
152
// *p -> memory, address -> x1
146
153
// 2 -> w2
147
154
// 3.0 -> d5
148
155
// true -> p0
149
- void test_argpass_no_z (PST * p , double dummy , svmfloat8_t u ) {
150
- void argpass_no_z_callee (svmfloat8_t , double , double , double , double , int , PST , int , double , svbool_t );
151
- argpass_no_z_callee (u , .0 , .0 , .0 , .0 , 1 , * p , 2 , 3.0 , svptrue_b64 ());
156
+ void test_argpass_no_z (PST * p , double dummy , svmfloat8_t u , int8x16_t v , mfloat8x16_t w ) {
157
+ void argpass_no_z_callee (svmfloat8_t , int8x16_t , mfloat8x16_t , double , double , int , PST , int , double , svbool_t );
158
+ argpass_no_z_callee (u , v , w , .0 , .0 , 1 , * p , 2 , 3.0 , svptrue_b64 ());
152
159
}
153
- // CHECK: declare void @argpass_no_z_callee(<vscale x 16 x i8>, double noundef, double noundef , double noundef, double noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, <vscale x 16 x i1>)
160
+ // CHECK: declare void @argpass_no_z_callee(<vscale x 16 x i8>, <16 x i8> noundef, <16 x i8> , double noundef, double noundef, i32 noundef, ptr noundef, i32 noundef, double noundef, <vscale x 16 x i1>)
154
161
155
162
156
163
// Like the above, using a tuple to occupy some registers.
@@ -200,6 +207,20 @@ void test_argpass_no_z_hfa(HFA *h, PST *p) {
200
207
// CHECK-AAPCS: declare void @argpass_no_z_hfa_callee(double noundef, [4 x float] alignstack(8), i32 noundef, ptr noundef, i32 noundef, <vscale x 16 x i1>)
201
208
// CHECK-DARWIN: declare void @argpass_no_z_hfa_callee(double noundef, [4 x float], i32 noundef, ptr noundef, i32 noundef, <vscale x 16 x i1>)
202
209
210
+ // Not enough Z-regs (consumed by a HVA), PST passed indirectly
211
+ // 0.0 -> d0
212
+ // *h -> s1-s4
213
+ // 1 -> w0
214
+ // *p -> memory, address -> x1
215
+ // p -> x1
216
+ // 2 -> w2
217
+ // true -> p0
218
+ void test_argpass_no_z_hva (HVA * h , PST * p ) {
219
+ void argpass_no_z_hva_callee (double , HVA , int , PST , int , svbool_t );
220
+ argpass_no_z_hva_callee (.0 , * h , 1 , * p , 2 , svptrue_b64 ());
221
+ }
222
+ // CHECK-AAPCS: declare void @argpass_no_z_hva_callee(double noundef, [4 x <16 x i8>] alignstack(16), i32 noundef, ptr noundef, i32 noundef, <vscale x 16 x i1>)
223
+ // CHECK-DARWIN: declare void @argpass_no_z_hva_callee(double noundef, [4 x <16 x i8>], i32 noundef, ptr noundef, i32 noundef, <vscale x 16 x i1>)
203
224
204
225
// Not enough P-regs, PST passed indirectly, Z-regs and P-regs still available.
205
226
// true -> p0-p2
0 commit comments