3 #![feature(repr_simd, platform_intrinsics)]
4 #![allow(non_camel_case_types)]
7 pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
10 #[derive(Copy, Clone)]
11 pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
14 #[derive(Copy, Clone)]
15 pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
17 extern "platform-intrinsic" {
18 fn simd_add<T>(x: T, y: T) -> T;
19 fn simd_sub<T>(x: T, y: T) -> T;
20 fn simd_mul<T>(x: T, y: T) -> T;
21 fn simd_div<T>(x: T, y: T) -> T;
22 fn simd_rem<T>(x: T, y: T) -> T;
23 fn simd_shl<T>(x: T, y: T) -> T;
24 fn simd_shr<T>(x: T, y: T) -> T;
25 fn simd_and<T>(x: T, y: T) -> T;
26 fn simd_or<T>(x: T, y: T) -> T;
27 fn simd_xor<T>(x: T, y: T) -> T;
29 fn simd_neg<T>(x: T) -> T;
33 let x = i32x4(0, 0, 0, 0);
34 let y = u32x4(0, 0, 0, 0);
35 let z = f32x4(0.0, 0.0, 0.0, 0.0);
70 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
72 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
74 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
76 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
78 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
80 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
82 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
84 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
86 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
89 //~^ ERROR expected SIMD input type, found non-SIMD `i32`
93 //~^ ERROR unsupported operation on `f32x4` with element `f32`
95 //~^ ERROR unsupported operation on `f32x4` with element `f32`
97 //~^ ERROR unsupported operation on `f32x4` with element `f32`
99 //~^ ERROR unsupported operation on `f32x4` with element `f32`
101 //~^ ERROR unsupported operation on `f32x4` with element `f32`