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,71 @@ 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" ) ) ]
24
26
unsafe extern "C" fn dyn_simd_extract ( x : i8x16 , idx : u32 ) -> i8 {
25
27
simd_extract_dyn ( x, idx)
26
28
}
27
29
28
30
// CHECK-LABEL: literal_dyn_simd_extract
29
31
// CHECK: extractelement <16 x i8> %x, i32 7
30
32
#[ no_mangle]
33
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
34
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
31
35
unsafe extern "C" fn literal_dyn_simd_extract ( x : i8x16 ) -> i8 {
32
36
simd_extract_dyn ( x, 7 )
33
37
}
34
38
35
39
// CHECK-LABEL: const_dyn_simd_extract
36
40
// CHECK: extractelement <16 x i8> %x, i32 7
37
41
#[ no_mangle]
42
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
43
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
38
44
unsafe extern "C" fn const_dyn_simd_extract ( x : i8x16 ) -> i8 {
39
45
simd_extract_dyn ( x, const { 3 + 4 } )
40
46
}
41
47
42
48
// CHECK-LABEL: const_simd_extract
43
49
// CHECK: extractelement <16 x i8> %x, i32 7
44
50
#[ no_mangle]
51
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
52
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
45
53
unsafe extern "C" fn const_simd_extract ( x : i8x16 ) -> i8 {
46
54
simd_extract ( x, const { 3 + 4 } )
47
55
}
48
56
49
57
// CHECK-LABEL: dyn_simd_insert
50
58
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 %idx
51
59
#[ no_mangle]
60
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
61
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
52
62
unsafe extern "C" fn dyn_simd_insert ( x : i8x16 , e : i8 , idx : u32 ) -> i8x16 {
53
63
simd_insert_dyn ( x, idx, e)
54
64
}
55
65
56
66
// CHECK-LABEL: literal_dyn_simd_insert
57
67
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
58
68
#[ no_mangle]
69
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
70
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
59
71
unsafe extern "C" fn literal_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
60
72
simd_insert_dyn ( x, 7 , e)
61
73
}
62
74
63
75
// CHECK-LABEL: const_dyn_simd_insert
64
76
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
65
77
#[ no_mangle]
78
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
79
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
66
80
unsafe extern "C" fn const_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
67
81
simd_insert_dyn ( x, const { 3 + 4 } , e)
68
82
}
69
83
70
84
// CHECK-LABEL: const_simd_insert
71
85
// CHECK: insertelement <16 x i8> %x, i8 %e, i32 7
72
86
#[ no_mangle]
87
+ #[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
88
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
73
89
unsafe extern "C" fn const_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
74
90
simd_insert ( x, const { 3 + 4 } , e)
75
91
}
0 commit comments