Skip to content

Commit 564779c

Browse files
committed
Fix a test
1 parent 2360446 commit 564779c

File tree

1 file changed

+20
-17
lines changed
  • src/test/run-make-fulldeps/simd-ffi

1 file changed

+20
-17
lines changed

src/test/run-make-fulldeps/simd-ffi/simd.rs

+20-17
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,56 @@
44
// cross-compiled standard libraries.
55
#![feature(no_core, auto_traits)]
66
#![no_core]
7-
#![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items, rustc_attrs)]
7+
#![feature(
8+
mips_target_feature,
9+
repr_simd,
10+
simd_ffi,
11+
link_llvm_intrinsics,
12+
lang_items,
13+
rustc_attrs
14+
)]
815

916
#[derive(Copy)]
1017
#[repr(simd)]
11-
pub struct f32x4(f32, f32, f32, f32);
18+
pub struct F32x4(f32, f32, f32, f32);
1219

1320
extern "C" {
1421
#[link_name = "llvm.sqrt.v4f32"]
15-
fn vsqrt(x: f32x4) -> f32x4;
22+
fn vsqrt(x: F32x4) -> F32x4;
1623
}
1724

18-
pub fn foo(x: f32x4) -> f32x4 {
25+
pub fn foo(x: F32x4) -> F32x4 {
1926
unsafe { vsqrt(x) }
2027
}
2128

2229
#[derive(Copy)]
2330
#[repr(simd)]
24-
pub struct i32x4(i32, i32, i32, i32);
31+
pub struct I32x4(i32, i32, i32, i32);
2532

2633
extern "C" {
2734
// _mm_sll_epi32
28-
#[cfg(any(target_arch = "x86", target_arch = "x86-64"))]
35+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2936
#[link_name = "llvm.x86.sse2.psll.d"]
30-
fn integer(a: i32x4, b: i32x4) -> i32x4;
37+
fn integer(a: I32x4, b: I32x4) -> I32x4;
3138

3239
// vmaxq_s32
3340
#[cfg(target_arch = "arm")]
3441
#[link_name = "llvm.arm.neon.vmaxs.v4i32"]
35-
fn integer(a: i32x4, b: i32x4) -> i32x4;
42+
fn integer(a: I32x4, b: I32x4) -> I32x4;
3643
// vmaxq_s32
3744
#[cfg(target_arch = "aarch64")]
3845
#[link_name = "llvm.aarch64.neon.maxs.v4i32"]
39-
fn integer(a: i32x4, b: i32x4) -> i32x4;
46+
fn integer(a: I32x4, b: I32x4) -> I32x4;
4047

4148
// just some substitute foreign symbol, not an LLVM intrinsic; so
4249
// we still get type checking, but not as detailed as (ab)using
4350
// LLVM.
44-
#[cfg(not(any(
45-
target_arch = "x86",
46-
target_arch = "x86-64",
47-
target_arch = "arm",
48-
target_arch = "aarch64"
49-
)))]
50-
fn integer(a: i32x4, b: i32x4) -> i32x4;
51+
#[cfg(target_arch = "mips")]
52+
#[target_feature(enable = "msa")]
53+
fn integer(a: I32x4, b: I32x4) -> I32x4;
5154
}
5255

53-
pub fn bar(a: i32x4, b: i32x4) -> i32x4 {
56+
pub fn bar(a: I32x4, b: I32x4) -> I32x4 {
5457
unsafe { integer(a, b) }
5558
}
5659

0 commit comments

Comments
 (0)