1
1
//@compile-flags: -C opt-level=3 -C no-prepopulate-passes
2
2
3
- #![ feature( core_intrinsics, repr_simd) ]
3
+ #![ feature( core_intrinsics, repr_simd, arm_target_feature ) ]
4
4
#![ no_std]
5
5
#![ crate_type = "lib" ]
6
6
#![ allow( non_camel_case_types) ]
@@ -21,55 +21,79 @@ pub struct i8x16([i8; 16]);
21
21
// CHECK-LABEL: dyn_simd_extract
22
22
// CHECK: extractelement <16 x i8> %x, i32 %idx
23
23
#[ no_mangle]
24
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
25
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
26
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
24
27
unsafe extern "C" fn dyn_simd_extract ( x : i8x16 , idx : u32 ) -> i8 {
25
28
simd_extract_dyn ( x, idx)
26
29
}
27
30
28
31
// CHECK-LABEL: literal_dyn_simd_extract
29
32
// CHECK: extractelement <16 x i8> %x, i32 7
30
33
#[ no_mangle]
34
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
35
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
36
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
31
37
unsafe extern "C" fn literal_dyn_simd_extract ( x : i8x16 ) -> i8 {
32
38
simd_extract_dyn ( x, 7 )
33
39
}
34
40
35
41
// CHECK-LABEL: const_dyn_simd_extract
36
42
// CHECK: extractelement <16 x i8> %x, i32 7
37
43
#[ no_mangle]
44
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
45
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
46
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
38
47
unsafe extern "C" fn const_dyn_simd_extract ( x : i8x16 ) -> i8 {
39
48
simd_extract_dyn ( x, const { 3 + 4 } )
40
49
}
41
50
42
51
// CHECK-LABEL: const_simd_extract
43
52
// CHECK: extractelement <16 x i8> %x, i32 7
44
53
#[ no_mangle]
54
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
55
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
56
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
45
57
unsafe extern "C" fn const_simd_extract ( x : i8x16 ) -> i8 {
46
58
simd_extract ( x, const { 3 + 4 } )
47
59
}
48
60
49
61
// CHECK-LABEL: dyn_simd_insert
50
62
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 %idx
51
63
#[ no_mangle]
64
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
65
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
66
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
52
67
unsafe extern "C" fn dyn_simd_insert ( x : i8x16 , e : i8 , idx : u32 ) -> i8x16 {
53
68
simd_insert_dyn ( x, idx, e)
54
69
}
55
70
56
71
// CHECK-LABEL: literal_dyn_simd_insert
57
72
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
58
73
#[ no_mangle]
74
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
75
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
76
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
59
77
unsafe extern "C" fn literal_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
60
78
simd_insert_dyn ( x, 7 , e)
61
79
}
62
80
63
81
// CHECK-LABEL: const_dyn_simd_insert
64
82
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
65
83
#[ no_mangle]
84
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
85
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
86
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
66
87
unsafe extern "C" fn const_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
67
88
simd_insert_dyn ( x, const { 3 + 4 } , e)
68
89
}
69
90
70
91
// CHECK-LABEL: const_simd_insert
71
92
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
72
93
#[ no_mangle]
94
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
95
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
96
+ #[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
73
97
unsafe extern "C" fn const_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
74
98
simd_insert ( x, const { 3 + 4 } , e)
75
99
}
0 commit comments