1
1
//@ run-pass
2
- //@ ignore-emscripten FIXME(#45351) hits an LLVM assert
3
2
4
3
#![ feature( repr_simd, intrinsics, concat_idents) ]
5
4
#![ allow( non_camel_case_types) ]
@@ -14,7 +13,6 @@ struct u32x4(pub [u32; 4]);
14
13
#[ derive( Copy , Clone ) ]
15
14
struct f32x4 ( pub [ f32 ; 4 ] ) ;
16
15
17
-
18
16
#[ rustc_intrinsic]
19
17
unsafe fn simd_eq < T , U > ( x : T , y : T ) -> U ;
20
18
@@ -39,11 +37,11 @@ macro_rules! cmp {
39
37
let rhs = $rhs;
40
38
let e: u32x4 = concat_idents!( simd_, $method) ( $lhs, $rhs) ;
41
39
// assume the scalar version is correct/the behaviour we want.
42
- assert!( ( e. 0 [ 0 ] != 0 ) == lhs. 0 [ 0 ] . $method( & rhs. 0 [ 0 ] ) ) ;
43
- assert!( ( e. 0 [ 1 ] != 0 ) == lhs. 0 [ 1 ] . $method( & rhs. 0 [ 1 ] ) ) ;
44
- assert!( ( e. 0 [ 2 ] != 0 ) == lhs. 0 [ 2 ] . $method( & rhs. 0 [ 2 ] ) ) ;
45
- assert!( ( e. 0 [ 3 ] != 0 ) == lhs. 0 [ 3 ] . $method( & rhs. 0 [ 3 ] ) ) ;
46
- } }
40
+ assert!( ( e. 0 [ 0 ] != 0 ) == lhs. 0 [ 0 ] . $method( & rhs. 0 [ 0 ] ) ) ;
41
+ assert!( ( e. 0 [ 1 ] != 0 ) == lhs. 0 [ 1 ] . $method( & rhs. 0 [ 1 ] ) ) ;
42
+ assert!( ( e. 0 [ 2 ] != 0 ) == lhs. 0 [ 2 ] . $method( & rhs. 0 [ 2 ] ) ) ;
43
+ assert!( ( e. 0 [ 3 ] != 0 ) == lhs. 0 [ 3 ] . $method( & rhs. 0 [ 3 ] ) ) ;
44
+ } } ;
47
45
}
48
46
macro_rules! tests {
49
47
( $( $lhs: ident, $rhs: ident; ) * ) => { {
@@ -75,9 +73,9 @@ fn main() {
75
73
let i2 = i32x4 ( [ 5 , -5 , 20 , -100 ] ) ;
76
74
let i3 = i32x4 ( [ 10 , -11 , 20 , -100 ] ) ;
77
75
78
- let u1 = u32x4 ( [ 10 , !11 + 1 , 12 , 13 ] ) ;
79
- let u2 = u32x4 ( [ 5 , !5 + 1 , 20 , !100 + 1 ] ) ;
80
- let u3 = u32x4 ( [ 10 , !11 + 1 , 20 , !100 + 1 ] ) ;
76
+ let u1 = u32x4 ( [ 10 , !11 + 1 , 12 , 13 ] ) ;
77
+ let u2 = u32x4 ( [ 5 , !5 + 1 , 20 , !100 + 1 ] ) ;
78
+ let u3 = u32x4 ( [ 10 , !11 + 1 , 20 , !100 + 1 ] ) ;
81
79
82
80
let f1 = f32x4 ( [ 10.0 , -11.0 , 12.0 , 13.0 ] ) ;
83
81
let f2 = f32x4 ( [ 5.0 , -5.0 , 20.0 , -100.0 ] ) ;
0 commit comments