Skip to content

Commit cf12e29

Browse files
committed
enable msa feature for mips in codegen tests
1 parent 1b8ab72 commit cf12e29

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

tests/codegen/const-vector.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![feature(rustc_attrs)]
1010
#![feature(simd_ffi)]
1111
#![feature(arm_target_feature)]
12+
#![feature(mips_target_feature)]
1213
#![allow(non_camel_case_types)]
1314

1415
// Setting up structs that can be used as const vectors
@@ -45,6 +46,7 @@ extern "unadjusted" {
4546
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
4647
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
4748
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
49+
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
4850
pub fn do_call() {
4951
unsafe {
5052
// CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64>

tests/codegen/repr/transparent.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// For LoongArch: see codegen/loongarch-abi
1010

1111
#![crate_type = "lib"]
12-
#![feature(repr_simd, transparent_unions, arm_target_feature)]
12+
#![feature(repr_simd, transparent_unions, arm_target_feature, mips_target_feature)]
1313

1414
use std::marker::PhantomData;
1515

@@ -142,6 +142,7 @@ pub struct Vector(f32x4);
142142
#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
143143
#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
144144
#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
145+
#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
145146
pub extern "C" fn test_Vector(_: Vector) -> Vector {
146147
loop {}
147148
}

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

Lines changed: 9 additions & 1 deletion
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, mips_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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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 = "mips", target_feature(enable = "msa"))]
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)