4
4
#![ no_std]
5
5
#![ crate_type = "lib" ]
6
6
#![ allow( non_camel_case_types) ]
7
+ #![ feature( s390x_target_feature) ]
7
8
8
9
// Test that `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`
9
10
// lower to an LLVM extractelement or insertelement operation.
@@ -24,6 +25,7 @@ pub struct i8x16([i8; 16]);
24
25
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
25
26
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
26
27
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
28
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
27
29
unsafe extern "C" fn dyn_simd_extract ( x : i8x16 , idx : u32 ) -> i8 {
28
30
simd_extract_dyn ( x, idx)
29
31
}
@@ -34,6 +36,7 @@ unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
34
36
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
35
37
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
36
38
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
39
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
37
40
unsafe extern "C" fn literal_dyn_simd_extract ( x : i8x16 ) -> i8 {
38
41
simd_extract_dyn ( x, 7 )
39
42
}
@@ -44,6 +47,7 @@ unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
44
47
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
45
48
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
46
49
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
50
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
47
51
unsafe extern "C" fn const_dyn_simd_extract ( x : i8x16 ) -> i8 {
48
52
simd_extract_dyn ( x, const { 3 + 4 } )
49
53
}
@@ -54,6 +58,7 @@ unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
54
58
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
55
59
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
56
60
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
61
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
57
62
unsafe extern "C" fn const_simd_extract ( x : i8x16 ) -> i8 {
58
63
simd_extract ( x, const { 3 + 4 } )
59
64
}
@@ -64,6 +69,7 @@ unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
64
69
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
65
70
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
66
71
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
72
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
67
73
unsafe extern "C" fn dyn_simd_insert ( x : i8x16 , e : i8 , idx : u32 ) -> i8x16 {
68
74
simd_insert_dyn ( x, idx, e)
69
75
}
@@ -74,6 +80,7 @@ unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
74
80
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
75
81
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
76
82
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
83
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
77
84
unsafe extern "C" fn literal_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
78
85
simd_insert_dyn ( x, 7 , e)
79
86
}
@@ -84,6 +91,7 @@ unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
84
91
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
85
92
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
86
93
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
94
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
87
95
unsafe extern "C" fn const_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
88
96
simd_insert_dyn ( x, const { 3 + 4 } , e)
89
97
}
@@ -94,6 +102,7 @@ unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
94
102
#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
95
103
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
96
104
#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
105
+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
97
106
unsafe extern "C" fn const_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
98
107
simd_insert ( x, const { 3 + 4 } , e)
99
108
}
0 commit comments