Skip to content

Commit 020d908

Browse files
authored
Rollup merge of #140456 - fneddy:fix_s390x_codegen_simd_ext_ins_dyn, r=wesleywiser
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.
2 parents 9c949b0 + 61488e5 commit 020d908

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

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

3-
#![feature(core_intrinsics, repr_simd, arm_target_feature, mips_target_feature)]
3+
#![feature(
4+
core_intrinsics,
5+
repr_simd,
6+
arm_target_feature,
7+
mips_target_feature,
8+
s390x_target_feature
9+
)]
410
#![no_std]
511
#![crate_type = "lib"]
612
#![allow(non_camel_case_types)]
@@ -25,6 +31,7 @@ pub struct i8x16([i8; 16]);
2531
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
2632
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
2733
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
34+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
2835
unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
2936
simd_extract_dyn(x, idx)
3037
}
@@ -36,6 +43,7 @@ unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
3643
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
3744
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
3845
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
46+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
3947
unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
4048
simd_extract_dyn(x, 7)
4149
}
@@ -47,6 +55,7 @@ unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
4755
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
4856
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
4957
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
58+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
5059
unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
5160
simd_extract_dyn(x, const { 3 + 4 })
5261
}
@@ -58,6 +67,7 @@ unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
5867
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
5968
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
6069
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
70+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
6171
unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
6272
simd_extract(x, const { 3 + 4 })
6373
}
@@ -69,6 +79,7 @@ unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
6979
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
7080
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
7181
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
82+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
7283
unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
7384
simd_insert_dyn(x, idx, e)
7485
}
@@ -80,6 +91,7 @@ unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
8091
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
8192
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
8293
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
94+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
8395
unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
8496
simd_insert_dyn(x, 7, e)
8597
}
@@ -91,6 +103,7 @@ unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
91103
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
92104
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
93105
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
106+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
94107
unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
95108
simd_insert_dyn(x, const { 3 + 4 }, e)
96109
}
@@ -102,6 +115,7 @@ unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
102115
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
103116
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
104117
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
118+
#[cfg_attr(target_arch = "s390x", target_feature(enable = "vector"))]
105119
unsafe extern "C" fn const_simd_insert(x: i8x16, e: i8) -> i8x16 {
106120
simd_insert(x, const { 3 + 4 }, e)
107121
}

0 commit comments

Comments
 (0)