diff options
| author | Ralf Jung <post@ralfj.de> | 2025-04-22 08:48:43 +0200 | 
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-04-23 14:01:08 +0200 | 
| commit | 216fac3c23c003af77c140ccd4b11168a0ea1da3 (patch) | |
| tree | 0bb2239d755c0bbdcc94b0c569dca6731b57d07c /tests/codegen/const-vector.rs | |
| parent | b5f5f62a8b5890be2fde163ba3f2284f023126ad (diff) | |
| download | rust-216fac3c23c003af77c140ccd4b11168a0ea1da3.tar.gz rust-216fac3c23c003af77c140ccd4b11168a0ea1da3.zip | |
wasm, arm, x86-without-SSE need simd to be explicitly enabled
Diffstat (limited to 'tests/codegen/const-vector.rs')
| -rw-r--r-- | tests/codegen/const-vector.rs | 25 | 
1 files changed, 4 insertions, 21 deletions
| diff --git a/tests/codegen/const-vector.rs b/tests/codegen/const-vector.rs index 8343594e5d2..1d4edc39b1c 100644 --- a/tests/codegen/const-vector.rs +++ b/tests/codegen/const-vector.rs @@ -8,6 +8,7 @@ #![feature(repr_simd)] #![feature(rustc_attrs)] #![feature(simd_ffi)] +#![feature(arm_target_feature)] #![allow(non_camel_case_types)] // Setting up structs that can be used as const vectors @@ -28,33 +29,12 @@ pub struct Simd<T, const N: usize>([T; N]); extern "unadjusted" { fn test_i8x2(a: i8x2); -} - -extern "unadjusted" { fn test_i8x2_two_args(a: i8x2, b: i8x2); -} - -extern "unadjusted" { fn test_i8x2_mixed_args(a: i8x2, c: i32, b: i8x2); -} - -extern "unadjusted" { fn test_i8x2_arr(a: i8x2); -} - -extern "unadjusted" { fn test_f32x2(a: f32x2); -} - -extern "unadjusted" { fn test_f32x2_arr(a: f32x2); -} - -extern "unadjusted" { fn test_simd(a: Simd<i32, 4>); -} - -extern "unadjusted" { fn test_simd_unaligned(a: Simd<i32, 3>); } @@ -62,6 +42,9 @@ extern "unadjusted" { // if the size is not a power of 2 // CHECK: %"Simd<i32, 3>" = type { [3 x i32] } +#[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))] +#[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))] +#[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))] pub fn do_call() { unsafe { // CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64> | 
