diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-12-10 09:18:26 -0500 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-12-10 09:18:26 -0500 |
| commit | aa00baeba410141d579d1cd32a8f4afa45bd28e9 (patch) | |
| tree | a4a3ba6dff960f0ca1b6d1836adf735bd3aea746 /tests | |
| parent | c623489b9bb5ad8dcb1094197710364b137d8b49 (diff) | |
| download | rust-aa00baeba410141d579d1cd32a8f4afa45bd28e9.tar.gz rust-aa00baeba410141d579d1cd32a8f4afa45bd28e9.zip | |
Remove codegen test that depends on optimizations
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/codegen/simd/repr-packed.rs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/codegen/simd/repr-packed.rs b/tests/codegen/simd/repr-packed.rs deleted file mode 100644 index 27b9821cbe5..00000000000 --- a/tests/codegen/simd/repr-packed.rs +++ /dev/null @@ -1,32 +0,0 @@ -// compile-flags: -C no-prepopulate-passes - -#![crate_type = "lib"] -#![feature(repr_simd, platform_intrinsics)] - -#[repr(simd, packed)] -pub struct Simd<T, const N: usize>([T; N]); - -#[repr(simd)] -#[derive(Copy, Clone)] -pub struct FullSimd<T, const N: usize>([T; N]); - -extern "platform-intrinsic" { - fn simd_mul<T>(a: T, b: T) -> T; -} - -// non-powers-of-two have padding and need to be expanded to full vectors -fn load<T, const N: usize>(v: Simd<T, N>) -> FullSimd<T, N> { - unsafe { - let mut tmp = core::mem::MaybeUninit::<FullSimd<T, N>>::uninit(); - std::ptr::copy_nonoverlapping(&v as *const _, tmp.as_mut_ptr().cast(), 1); - tmp.assume_init() - } -} - -// CHECK-LABEL: @square_packed -#[no_mangle] -pub fn square_packed(x: Simd<f32, 3>) -> FullSimd<f32, 3> { - // CHECK: align 4 dereferenceable(12) %x - let x = load(x); - unsafe { simd_mul(x, x) } -} |
