1313// Setting up structs that can be used as const vectors
1414#[ repr( simd) ]
1515#[ derive( Clone ) ]
16- pub struct i8x2 ( i8 , i8 ) ;
16+ pub struct i8x2 ( [ i8 ; 2 ] ) ;
1717
1818#[ repr( simd) ]
1919#[ derive( Clone ) ]
20- pub struct i8x2_arr ( [ i8 ; 2 ] ) ;
21-
22- #[ repr( simd) ]
23- #[ derive( Clone ) ]
24- pub struct f32x2 ( f32 , f32 ) ;
25-
26- #[ repr( simd) ]
27- #[ derive( Clone ) ]
28- pub struct f32x2_arr ( [ f32 ; 2 ] ) ;
20+ pub struct f32x2 ( [ f32 ; 2 ] ) ;
2921
3022#[ repr( simd, packed) ]
3123#[ derive( Copy , Clone ) ]
@@ -35,42 +27,34 @@ pub struct Simd<T, const N: usize>([T; N]);
3527// that they are called with a const vector
3628
3729extern "unadjusted" {
38- #[ no_mangle]
3930 fn test_i8x2 ( a : i8x2 ) ;
4031}
4132
4233extern "unadjusted" {
43- #[ no_mangle]
4434 fn test_i8x2_two_args ( a : i8x2 , b : i8x2 ) ;
4535}
4636
4737extern "unadjusted" {
48- #[ no_mangle]
4938 fn test_i8x2_mixed_args ( a : i8x2 , c : i32 , b : i8x2 ) ;
5039}
5140
5241extern "unadjusted" {
53- #[ no_mangle]
54- fn test_i8x2_arr ( a : i8x2_arr ) ;
42+ fn test_i8x2_arr ( a : i8x2 ) ;
5543}
5644
5745extern "unadjusted" {
58- #[ no_mangle]
5946 fn test_f32x2 ( a : f32x2 ) ;
6047}
6148
6249extern "unadjusted" {
63- #[ no_mangle]
64- fn test_f32x2_arr ( a : f32x2_arr ) ;
50+ fn test_f32x2_arr ( a : f32x2 ) ;
6551}
6652
6753extern "unadjusted" {
68- #[ no_mangle]
6954 fn test_simd ( a : Simd < i32 , 4 > ) ;
7055}
7156
7257extern "unadjusted" {
73- #[ no_mangle]
7458 fn test_simd_unaligned ( a : Simd < i32 , 3 > ) ;
7559}
7660
@@ -81,22 +65,22 @@ extern "unadjusted" {
8165pub fn do_call ( ) {
8266 unsafe {
8367 // CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64>
84- test_i8x2 ( const { i8x2 ( 32 , 64 ) } ) ;
68+ test_i8x2 ( const { i8x2 ( [ 32 , 64 ] ) } ) ;
8569
8670 // CHECK: call void @test_i8x2_two_args(<2 x i8> <i8 32, i8 64>, <2 x i8> <i8 8, i8 16>
87- test_i8x2_two_args ( const { i8x2 ( 32 , 64 ) } , const { i8x2 ( 8 , 16 ) } ) ;
71+ test_i8x2_two_args ( const { i8x2 ( [ 32 , 64 ] ) } , const { i8x2 ( [ 8 , 16 ] ) } ) ;
8872
8973 // CHECK: call void @test_i8x2_mixed_args(<2 x i8> <i8 32, i8 64>, i32 43, <2 x i8> <i8 8, i8 16>
90- test_i8x2_mixed_args ( const { i8x2 ( 32 , 64 ) } , 43 , const { i8x2 ( 8 , 16 ) } ) ;
74+ test_i8x2_mixed_args ( const { i8x2 ( [ 32 , 64 ] ) } , 43 , const { i8x2 ( [ 8 , 16 ] ) } ) ;
9175
9276 // CHECK: call void @test_i8x2_arr(<2 x i8> <i8 32, i8 64>
93- test_i8x2_arr ( const { i8x2_arr ( [ 32 , 64 ] ) } ) ;
77+ test_i8x2_arr ( const { i8x2 ( [ 32 , 64 ] ) } ) ;
9478
9579 // CHECK: call void @test_f32x2(<2 x float> <float 0x3FD47AE140000000, float 0x3FE47AE140000000>
96- test_f32x2 ( const { f32x2 ( 0.32 , 0.64 ) } ) ;
80+ test_f32x2 ( const { f32x2 ( [ 0.32 , 0.64 ] ) } ) ;
9781
9882 // CHECK: void @test_f32x2_arr(<2 x float> <float 0x3FD47AE140000000, float 0x3FE47AE140000000>
99- test_f32x2_arr ( const { f32x2_arr ( [ 0.32 , 0.64 ] ) } ) ;
83+ test_f32x2_arr ( const { f32x2 ( [ 0.32 , 0.64 ] ) } ) ;
10084
10185 // CHECK: call void @test_simd(<4 x i32> <i32 2, i32 4, i32 6, i32 8>
10286 test_simd ( const { Simd :: < i32 , 4 > ( [ 2 , 4 , 6 , 8 ] ) } ) ;
0 commit comments