11//@ run-pass
2- //@ ignore-emscripten FIXME(#45351) hits an LLVM assert
32
43#![ feature( repr_simd, intrinsics, concat_idents) ]
54#![ allow( non_camel_case_types) ]
@@ -14,7 +13,6 @@ struct u32x4(pub [u32; 4]);
1413#[ derive( Copy , Clone ) ]
1514struct f32x4 ( pub [ f32 ; 4 ] ) ;
1615
17-
1816#[ rustc_intrinsic]
1917unsafe fn simd_eq < T , U > ( x : T , y : T ) -> U ;
2018
@@ -39,11 +37,11 @@ macro_rules! cmp {
3937 let rhs = $rhs;
4038 let e: u32x4 = concat_idents!( simd_, $method) ( $lhs, $rhs) ;
4139 // 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+ } } ;
4745}
4846macro_rules! tests {
4947 ( $( $lhs: ident, $rhs: ident; ) * ) => { {
@@ -75,9 +73,9 @@ fn main() {
7573 let i2 = i32x4 ( [ 5 , -5 , 20 , -100 ] ) ;
7674 let i3 = i32x4 ( [ 10 , -11 , 20 , -100 ] ) ;
7775
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 ] ) ;
8179
8280 let f1 = f32x4 ( [ 10.0 , -11.0 , 12.0 , 13.0 ] ) ;
8381 let f2 = f32x4 ( [ 5.0 , -5.0 , 20.0 , -100.0 ] ) ;
0 commit comments