Skip to content

Commit 24af1d9

Browse files
committed
Fix test simd/extract-insert-dyn on s390x
Fix the test for s390x by enabling s390x vector extension via `target_feature(enable = "vector")`(#127506). As this is is still gated by `#![feature(s390x_target_feature)]` we need that attribute also.
1 parent 7d65abf commit 24af1d9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/codegen/simd/extract-insert-dyn.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@compile-flags: -C opt-level=3 -C no-prepopulate-passes
22

3-
#![feature(core_intrinsics, repr_simd, arm_target_feature)]
3+
#![feature(core_intrinsics, repr_simd, arm_target_feature, s390x_target_feature)]
44
#![no_std]
55
#![crate_type = "lib"]
66
#![allow(non_camel_case_types)]
@@ -24,6 +24,7 @@ pub struct i8x16([i8; 16]);
2424
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
2525
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
2626
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
27+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
2728
unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
2829
simd_extract_dyn(x, idx)
2930
}
@@ -34,6 +35,7 @@ unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
3435
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
3536
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
3637
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
38+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
3739
unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
3840
simd_extract_dyn(x, 7)
3941
}
@@ -44,6 +46,7 @@ unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
4446
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
4547
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
4648
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
49+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
4750
unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
4851
simd_extract_dyn(x, const { 3 + 4 })
4952
}
@@ -54,6 +57,7 @@ unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
5457
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
5558
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
5659
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
60+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
5761
unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
5862
simd_extract(x, const { 3 + 4 })
5963
}
@@ -64,6 +68,7 @@ unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
6468
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
6569
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
6670
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
71+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
6772
unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
6873
simd_insert_dyn(x, idx, e)
6974
}
@@ -74,6 +79,7 @@ unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
7479
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
7580
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
7681
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
82+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
7783
unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
7884
simd_insert_dyn(x, 7, e)
7985
}
@@ -84,6 +90,7 @@ unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
8490
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
8591
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
8692
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
93+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
8794
unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
8895
simd_insert_dyn(x, const { 3 + 4 }, e)
8996
}
@@ -94,6 +101,7 @@ unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
94101
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
95102
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
96103
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
104+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
97105
unsafe extern "C" fn const_simd_insert(x: i8x16, e: i8) -> i8x16 {
98106
simd_insert(x, const { 3 + 4 }, e)
99107
}

0 commit comments

Comments
 (0)