9
9
10
10
#[ repr( simd) ]
11
11
#[ derive( Copy , Clone , PartialEq , Debug ) ]
12
- struct f32x4 ( pub f32 , pub f32 , pub f32 , pub f32 ) ;
12
+ struct f32x4 ( pub [ f32 ; 4 ] ) ;
13
13
14
14
use std:: intrinsics:: simd:: * ;
15
15
16
16
fn main ( ) {
17
- let x = f32x4 ( 1.0 , 2.0 , 3.0 , 4.0 ) ;
18
- let y = f32x4 ( 2.0 , 1.0 , 4.0 , 3.0 ) ;
17
+ let x = f32x4 ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) ;
18
+ let y = f32x4 ( [ 2.0 , 1.0 , 4.0 , 3.0 ] ) ;
19
19
20
20
#[ cfg( not( any( target_arch = "mips" , target_arch = "mips64" ) ) ) ]
21
21
let nan = f32:: NAN ;
@@ -24,13 +24,13 @@ fn main() {
24
24
#[ cfg( any( target_arch = "mips" , target_arch = "mips64" ) ) ]
25
25
let nan = f32:: from_bits ( f32:: NAN . to_bits ( ) - 1 ) ;
26
26
27
- let n = f32x4 ( nan, nan, nan, nan) ;
27
+ let n = f32x4 ( [ nan, nan, nan, nan] ) ;
28
28
29
29
unsafe {
30
30
let min0 = simd_fmin ( x, y) ;
31
31
let min1 = simd_fmin ( y, x) ;
32
32
assert_eq ! ( min0, min1) ;
33
- let e = f32x4 ( 1.0 , 1.0 , 3.0 , 3.0 ) ;
33
+ let e = f32x4 ( [ 1.0 , 1.0 , 3.0 , 3.0 ] ) ;
34
34
assert_eq ! ( min0, e) ;
35
35
let minn = simd_fmin ( x, n) ;
36
36
assert_eq ! ( minn, x) ;
@@ -40,7 +40,7 @@ fn main() {
40
40
let max0 = simd_fmax ( x, y) ;
41
41
let max1 = simd_fmax ( y, x) ;
42
42
assert_eq ! ( max0, max1) ;
43
- let e = f32x4 ( 2.0 , 2.0 , 4.0 , 4.0 ) ;
43
+ let e = f32x4 ( [ 2.0 , 2.0 , 4.0 , 4.0 ] ) ;
44
44
assert_eq ! ( max0, e) ;
45
45
let maxn = simd_fmax ( x, n) ;
46
46
assert_eq ! ( maxn, x) ;
0 commit comments