Skip to content

Commit a0329d6

Browse files
committed
tests/run-make/simd-ffi: use a generic LLVM intrinsics ...
... to do more comprehensive type checking
1 parent ede8a74 commit a0329d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/run-make/simd-ffi/simd.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct i32x4([i32; 4]);
2525

2626
extern "C" {
2727
// _mm_sll_epi32
28-
#[cfg(all(any(target_arch = "x86", target_arch = "x86-64"), target_feature = "sse2"))]
28+
#[cfg(any(all(target_arch = "x86", target_feature = "sse2"), target_arch = "x86-64"))]
2929
#[link_name = "llvm.x86.sse2.psll.d"]
3030
fn integer(a: i32x4, b: i32x4) -> i32x4;
3131

@@ -38,15 +38,14 @@ extern "C" {
3838
#[link_name = "llvm.aarch64.neon.maxs.v4i32"]
3939
fn integer(a: i32x4, b: i32x4) -> i32x4;
4040

41-
// just some substitute foreign symbol, not an LLVM intrinsic; so
42-
// we still get type checking, but not as detailed as (ab)using
43-
// LLVM.
41+
// Use a generic LLVM intrinsic to do type checking on other platforms
4442
#[cfg(not(any(
4543
all(target_arch = "x86", target_feature = "sse2"),
4644
target_arch = "x86-64",
4745
target_arch = "arm",
4846
target_arch = "aarch64"
4947
)))]
48+
#[link_name = "llvm.smax.v4i32"]
5049
fn integer(a: i32x4, b: i32x4) -> i32x4;
5150
}
5251

0 commit comments

Comments
 (0)