about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-22 09:59:41 +0000
committerbors <bors@rust-lang.org>2024-02-22 09:59:41 +0000
commit52dba5ffe73c25951fd6ae38bf20513002dd7874 (patch)
treeeb55b2cf212ff50733deffd25d5521efc0add346 /tests/codegen
parentf70f19fef41cfdda75c92f163434c29ad046cf09 (diff)
parente19f89b5ffaffb680ba72e1918cd74ae101cff51 (diff)
downloadrust-52dba5ffe73c25951fd6ae38bf20513002dd7874.tar.gz
rust-52dba5ffe73c25951fd6ae38bf20513002dd7874.zip
Auto merge of #121225 - RalfJung:simd-extract-insert-const-idx, r=oli-obk,Amanieu
require simd_insert, simd_extract indices to be constants

As discussed in https://github.com/rust-lang/rust/issues/77477 (see in particular [here](https://github.com/rust-lang/rust/issues/77477#issuecomment-703149102)). This PR doesn't touch codegen yet -- the first step is to ensure that the indices are always constants; the second step is to then make use of this fact in backends.

Blocked on https://github.com/rust-lang/stdarch/pull/1530 propagating to the rustc repo.
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs47
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs
deleted file mode 100644
index a5d2509d000..00000000000
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-// compile-flags: -C no-prepopulate-passes
-
-#![crate_type = "lib"]
-
-#![feature(repr_simd, platform_intrinsics, min_const_generics)]
-#![allow(non_camel_case_types)]
-
-#[repr(simd)]
-#[derive(Copy, Clone)]
-pub struct M(pub f32, pub f32, pub f32, pub f32);
-
-#[repr(simd)]
-#[derive(Copy, Clone)]
-pub struct S<const N: usize>([f32; N]);
-
-extern "platform-intrinsic" {
-    fn simd_extract<T, U>(x: T, idx: u32) -> U;
-    fn simd_insert<T, U>(x: T, idx: u32, b: U) -> T;
-}
-
-// CHECK-LABEL: @extract_m
-#[no_mangle]
-pub unsafe fn extract_m(v: M, i: u32) -> f32  {
-    // CHECK: extractelement <4 x float> %{{v|1|2}}, i32 %i
-    simd_extract(v, i)
-}
-
-// CHECK-LABEL: @extract_s
-#[no_mangle]
-pub unsafe fn extract_s(v: S<4>, i: u32) -> f32  {
-    // CHECK: extractelement <4 x float> %{{v|1|2}}, i32 %i
-    simd_extract(v, i)
-}
-
-// CHECK-LABEL: @insert_m
-#[no_mangle]
-pub unsafe fn insert_m(v: M, i: u32, j: f32) -> M  {
-    // CHECK: insertelement <4 x float> %{{v|0|1}}, float %j, i32 %i
-    simd_insert(v, i, j)
-}
-
-// CHECK-LABEL: @insert_s
-#[no_mangle]
-pub unsafe fn insert_s(v: S<4>, i: u32, j: f32) -> S<4>  {
-    // CHECK: insertelement <4 x float> %{{v|0|1}}, float %j, i32 %i
-    simd_insert(v, i, j)
-}