44#![ no_std]
55#![ crate_type = "lib" ]
66#![ allow( non_camel_case_types) ]
7+ #![ feature( s390x_target_feature) ]
78
89// Test that `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`
910// lower to an LLVM extractelement or insertelement operation.
@@ -24,6 +25,7 @@ pub struct i8x16([i8; 16]);
2425#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
2526#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
2627#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
28+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
2729unsafe extern "C" fn dyn_simd_extract ( x : i8x16 , idx : u32 ) -> i8 {
2830 simd_extract_dyn ( x, idx)
2931}
@@ -34,6 +36,7 @@ unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
3436#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
3537#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
3638#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
39+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
3740unsafe extern "C" fn literal_dyn_simd_extract ( x : i8x16 ) -> i8 {
3841 simd_extract_dyn ( x, 7 )
3942}
@@ -44,6 +47,7 @@ unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
4447#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
4548#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
4649#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
50+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
4751unsafe extern "C" fn const_dyn_simd_extract ( x : i8x16 ) -> i8 {
4852 simd_extract_dyn ( x, const { 3 + 4 } )
4953}
@@ -54,6 +58,7 @@ unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
5458#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
5559#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
5660#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
61+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
5762unsafe extern "C" fn const_simd_extract ( x : i8x16 ) -> i8 {
5863 simd_extract ( x, const { 3 + 4 } )
5964}
@@ -64,6 +69,7 @@ unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
6469#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
6570#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
6671#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
72+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
6773unsafe extern "C" fn dyn_simd_insert ( x : i8x16 , e : i8 , idx : u32 ) -> i8x16 {
6874 simd_insert_dyn ( x, idx, e)
6975}
@@ -74,6 +80,7 @@ unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
7480#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
7581#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
7682#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
83+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
7784unsafe extern "C" fn literal_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
7885 simd_insert_dyn ( x, 7 , e)
7986}
@@ -84,6 +91,7 @@ unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
8491#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
8592#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
8693#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
94+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
8795unsafe extern "C" fn const_dyn_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
8896 simd_insert_dyn ( x, const { 3 + 4 } , e)
8997}
@@ -94,6 +102,7 @@ unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
94102#[ cfg_attr( target_family = "wasm" , target_feature( enable = "simd128" ) ) ]
95103#[ cfg_attr( target_arch = "arm" , target_feature( enable = "neon" ) ) ]
96104#[ cfg_attr( target_arch = "x86" , target_feature( enable = "sse" ) ) ]
105+ #[ cfg_attr( target_arch = "s390x" , target_feature( enable = "vector" ) ) ]
97106unsafe extern "C" fn const_simd_insert ( x : i8x16 , e : i8 ) -> i8x16 {
98107 simd_insert ( x, const { 3 + 4 } , e)
99108}
0 commit comments