about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvayunbiyani <vayunbiyani9@gmail.com>2025-01-21 15:06:52 -0500
committervayunbiyani <vayunbiyani9@gmail.com>2025-02-02 08:07:16 -0500
commit0878692e0d4ea9e2ad39d37a1c70e5bf4bf563e4 (patch)
treec6b285f3235b7789be37076318c84bf742146bbe
parent65d7296fc9868af121adb5e07358a3815a80a7a1 (diff)
downloadrust-0878692e0d4ea9e2ad39d37a1c70e5bf4bf563e4.tar.gz
rust-0878692e0d4ea9e2ad39d37a1c70e5bf4bf563e4.zip
Ported tests/ui/simd to use the intrinsic macro
-rw-r--r--tests/ui/simd/array-trait.rs10
-rw-r--r--tests/ui/simd/array-type.rs10
-rw-r--r--tests/ui/simd/generics.rs5
-rw-r--r--tests/ui/simd/intrinsic/float-math-pass.rs74
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.rs67
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.stderr48
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-pass.rs67
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs10
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr4
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs10
-rw-r--r--tests/ui/simd/intrinsic/generic-as.rs6
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask-pass.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask.stderr10
-rw-r--r--tests/ui/simd/intrinsic/generic-bswap-byte.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-cast-pass.rs6
-rw-r--r--tests/ui/simd/intrinsic/generic-cast-pointer-width.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-cast.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-cast.stderr8
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison-pass.rs26
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison.rs26
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison.stderr36
-rw-r--r--tests/ui/simd/intrinsic/generic-elements-pass.rs13
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.rs19
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.stderr42
-rw-r--r--tests/ui/simd/intrinsic/generic-gather-pass.rs9
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction-pass.rs45
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction.rs28
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction.stderr20
-rw-r--r--tests/ui/simd/intrinsic/generic-select-pass.rs10
-rw-r--r--tests/ui/simd/intrinsic/generic-select.rs11
-rw-r--r--tests/ui/simd/intrinsic/generic-select.stderr16
-rw-r--r--tests/ui/simd/intrinsic/generic-shuffle.rs6
-rw-r--r--tests/ui/simd/intrinsic/inlining-issue67557-ice.rs5
-rw-r--r--tests/ui/simd/intrinsic/inlining-issue67557.rs5
-rw-r--r--tests/ui/simd/intrinsic/issue-85855.rs21
-rw-r--r--tests/ui/simd/intrinsic/issue-85855.stderr18
-rw-r--r--tests/ui/simd/intrinsic/ptr-cast.rs14
-rw-r--r--tests/ui/simd/issue-105439.rs5
-rw-r--r--tests/ui/simd/issue-39720.rs5
-rw-r--r--tests/ui/simd/issue-85915-simd-ptrs.rs10
-rw-r--r--tests/ui/simd/issue-89193.rs5
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.rs10
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.stderr16
-rw-r--r--tests/ui/simd/masked-load-store-check-fail.rs9
-rw-r--r--tests/ui/simd/masked-load-store-check-fail.stderr20
-rw-r--r--tests/ui/simd/masked-load-store.rs9
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.generic.stderr2
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.rs15
-rw-r--r--tests/ui/simd/repr_packed.rs5
-rw-r--r--tests/ui/simd/shuffle.rs5
-rw-r--r--tests/ui/simd/simd-bitmask-notpow2.rs10
-rw-r--r--tests/ui/simd/simd-bitmask.rs10
53 files changed, 518 insertions, 348 deletions
diff --git a/tests/ui/simd/array-trait.rs b/tests/ui/simd/array-trait.rs
index 67583bf8208..32cbf01428c 100644
--- a/tests/ui/simd/array-trait.rs
+++ b/tests/ui/simd/array-trait.rs
@@ -24,10 +24,12 @@ pub struct T<S: Simd>([S::Lane; S::SIZE]);
 //~| ERROR SIMD vector element type should be a primitive scalar
 //~| ERROR unconstrained generic constant
 
-extern "rust-intrinsic" {
-    fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-    fn simd_extract<T, E>(x: T, idx: u32) -> E;
-}
+#[rustc_intrinsic]
+unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
+
 
 pub fn main() {
     let mut t = T::<i32x4>([0; 4]);
diff --git a/tests/ui/simd/array-type.rs b/tests/ui/simd/array-type.rs
index 8ca53b1a453..d1de7004416 100644
--- a/tests/ui/simd/array-type.rs
+++ b/tests/ui/simd/array-type.rs
@@ -12,10 +12,12 @@ struct S([i32; 4]);
 #[derive(Copy, Clone)]
 struct T<const N: usize>([i32; N]);
 
-extern "rust-intrinsic" {
-    fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-    fn simd_extract<T, E>(x: T, idx: u32) -> E;
-}
+#[rustc_intrinsic]
+unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
+
 
 pub fn main() {
     let mut s = S([0; 4]);
diff --git a/tests/ui/simd/generics.rs b/tests/ui/simd/generics.rs
index f96a7cd75e9..453ed86c14a 100644
--- a/tests/ui/simd/generics.rs
+++ b/tests/ui/simd/generics.rs
@@ -21,9 +21,8 @@ struct B<T>([T; 4]);
 struct C<T, const N: usize>([T; N]);
 
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(x: T, y: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_add<T>(x: T, y: T) -> T;
 
 fn add<T: ops::Add<Output=T>>(lhs: T, rhs: T) -> T {
     lhs + rhs
diff --git a/tests/ui/simd/intrinsic/float-math-pass.rs b/tests/ui/simd/intrinsic/float-math-pass.rs
index 24b9941133e..74cb51a0606 100644
--- a/tests/ui/simd/intrinsic/float-math-pass.rs
+++ b/tests/ui/simd/intrinsic/float-math-pass.rs
@@ -15,27 +15,59 @@
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_fsqrt<T>(x: T) -> T;
-    fn simd_fabs<T>(x: T) -> T;
-    fn simd_fsin<T>(x: T) -> T;
-    fn simd_fcos<T>(x: T) -> T;
-    fn simd_fexp<T>(x: T) -> T;
-    fn simd_fexp2<T>(x: T) -> T;
-    fn simd_fma<T>(x: T, y: T, z: T) -> T;
-    fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T;
-    fn simd_flog<T>(x: T) -> T;
-    fn simd_flog10<T>(x: T) -> T;
-    fn simd_flog2<T>(x: T) -> T;
-    fn simd_fpow<T>(x: T, y: T) -> T;
-    fn simd_fpowi<T>(x: T, y: i32) -> T;
-
-    // rounding functions
-    fn simd_ceil<T>(x: T) -> T;
-    fn simd_floor<T>(x: T) -> T;
-    fn simd_round<T>(x: T) -> T;
-    fn simd_trunc<T>(x: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_fsqrt<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fabs<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fsin<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fcos<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fexp<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fexp2<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fma<T>(x: T, y: T, z: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_flog<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_flog10<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_flog2<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fpow<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_fpowi<T>(x: T, y: i32) -> T;
+
+
+// rounding functions
+#[rustc_intrinsic]
+unsafe fn simd_ceil<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_floor<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_round<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_trunc<T>(x: T) -> T;
+
 
 macro_rules! assert_approx_eq_f32 {
     ($a:expr, $b:expr) => ({
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
index 663bcdf1981..0fcff8584c8 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
@@ -14,25 +14,54 @@ pub struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(x: T, y: T) -> T;
-    fn simd_sub<T>(x: T, y: T) -> T;
-    fn simd_mul<T>(x: T, y: T) -> T;
-    fn simd_div<T>(x: T, y: T) -> T;
-    fn simd_rem<T>(x: T, y: T) -> T;
-    fn simd_shl<T>(x: T, y: T) -> T;
-    fn simd_shr<T>(x: T, y: T) -> T;
-    fn simd_and<T>(x: T, y: T) -> T;
-    fn simd_or<T>(x: T, y: T) -> T;
-    fn simd_xor<T>(x: T, y: T) -> T;
-
-    fn simd_neg<T>(x: T) -> T;
-    fn simd_bswap<T>(x: T) -> T;
-    fn simd_bitreverse<T>(x: T) -> T;
-    fn simd_ctlz<T>(x: T) -> T;
-    fn simd_ctpop<T>(x: T) -> T;
-    fn simd_cttz<T>(x: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_add<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_sub<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_mul<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_div<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_rem<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_shl<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_shr<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_and<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_or<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_xor<T>(x: T, y: T) -> T;
+
+
+#[rustc_intrinsic]
+unsafe fn simd_neg<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_bswap<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_bitreverse<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_ctlz<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_ctpop<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_cttz<T>(x: T) -> T;
 
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
index 6f5f86d7d37..e67de2fe903 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
@@ -1,143 +1,143 @@
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:81:9
+  --> $DIR/generic-arithmetic-2.rs:110:9
    |
 LL |         simd_add(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_sub` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:83:9
+  --> $DIR/generic-arithmetic-2.rs:112:9
    |
 LL |         simd_sub(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_mul` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:85:9
+  --> $DIR/generic-arithmetic-2.rs:114:9
    |
 LL |         simd_mul(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_div` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:87:9
+  --> $DIR/generic-arithmetic-2.rs:116:9
    |
 LL |         simd_div(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:89:9
+  --> $DIR/generic-arithmetic-2.rs:118:9
    |
 LL |         simd_shl(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:91:9
+  --> $DIR/generic-arithmetic-2.rs:120:9
    |
 LL |         simd_shr(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:93:9
+  --> $DIR/generic-arithmetic-2.rs:122:9
    |
 LL |         simd_and(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:95:9
+  --> $DIR/generic-arithmetic-2.rs:124:9
    |
 LL |         simd_or(0, 0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:97:9
+  --> $DIR/generic-arithmetic-2.rs:126:9
    |
 LL |         simd_xor(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_neg` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:100:9
+  --> $DIR/generic-arithmetic-2.rs:129:9
    |
 LL |         simd_neg(0);
    |         ^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:102:9
+  --> $DIR/generic-arithmetic-2.rs:131:9
    |
 LL |         simd_bswap(0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:104:9
+  --> $DIR/generic-arithmetic-2.rs:133:9
    |
 LL |         simd_bitreverse(0);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:106:9
+  --> $DIR/generic-arithmetic-2.rs:135:9
    |
 LL |         simd_ctlz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:108:9
+  --> $DIR/generic-arithmetic-2.rs:137:9
    |
 LL |         simd_cttz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:111:9
+  --> $DIR/generic-arithmetic-2.rs:140:9
    |
 LL |         simd_shl(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:113:9
+  --> $DIR/generic-arithmetic-2.rs:142:9
    |
 LL |         simd_shr(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:115:9
+  --> $DIR/generic-arithmetic-2.rs:144:9
    |
 LL |         simd_and(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:117:9
+  --> $DIR/generic-arithmetic-2.rs:146:9
    |
 LL |         simd_or(z, z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:119:9
+  --> $DIR/generic-arithmetic-2.rs:148:9
    |
 LL |         simd_xor(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:121:9
+  --> $DIR/generic-arithmetic-2.rs:150:9
    |
 LL |         simd_bswap(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:123:9
+  --> $DIR/generic-arithmetic-2.rs:152:9
    |
 LL |         simd_bitreverse(z);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:125:9
+  --> $DIR/generic-arithmetic-2.rs:154:9
    |
 LL |         simd_ctlz(z);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctpop` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:127:9
+  --> $DIR/generic-arithmetic-2.rs:156:9
    |
 LL |         simd_ctpop(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:129:9
+  --> $DIR/generic-arithmetic-2.rs:158:9
    |
 LL |         simd_cttz(z);
    |         ^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
index e4eb2a9da27..4a18c0164e4 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
@@ -23,25 +23,54 @@ macro_rules! all_eq {
     }};
 }
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(x: T, y: T) -> T;
-    fn simd_sub<T>(x: T, y: T) -> T;
-    fn simd_mul<T>(x: T, y: T) -> T;
-    fn simd_div<T>(x: T, y: T) -> T;
-    fn simd_rem<T>(x: T, y: T) -> T;
-    fn simd_shl<T>(x: T, y: T) -> T;
-    fn simd_shr<T>(x: T, y: T) -> T;
-    fn simd_and<T>(x: T, y: T) -> T;
-    fn simd_or<T>(x: T, y: T) -> T;
-    fn simd_xor<T>(x: T, y: T) -> T;
-
-    fn simd_neg<T>(x: T) -> T;
-    fn simd_bswap<T>(x: T) -> T;
-    fn simd_bitreverse<T>(x: T) -> T;
-    fn simd_ctlz<T>(x: T) -> T;
-    fn simd_ctpop<T>(x: T) -> T;
-    fn simd_cttz<T>(x: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_add<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_sub<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_mul<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_div<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_rem<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_shl<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_shr<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_and<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_or<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_xor<T>(x: T, y: T) -> T;
+
+
+#[rustc_intrinsic]
+unsafe fn simd_neg<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_bswap<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_bitreverse<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_ctlz<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_ctpop<T>(x: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_cttz<T>(x: T) -> T;
 
 fn main() {
     let x1 = i32x4([1, 2, 3, 4]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
index ec6ac78df1a..85464402d6a 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
@@ -14,10 +14,12 @@ pub struct x4<T>(pub [T; 4]);
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_saturating_add<T>(x: T, y: T) -> T;
-    fn simd_saturating_sub<T>(x: T, y: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_saturating_add<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_saturating_sub<T>(x: T, y: T) -> T;
+
 
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
index f349cb56560..cf275db7e43 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
@@ -1,11 +1,11 @@
 error[E0511]: invalid monomorphization of `simd_saturating_add` intrinsic: expected element type `f32` of vector type `f32x4` to be a signed or unsigned integer type
-  --> $DIR/generic-arithmetic-saturating-2.rs:33:9
+  --> $DIR/generic-arithmetic-saturating-2.rs:35:9
    |
 LL |         simd_saturating_add(z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_saturating_sub` intrinsic: expected element type `f32` of vector type `f32x4` to be a signed or unsigned integer type
-  --> $DIR/generic-arithmetic-saturating-2.rs:35:9
+  --> $DIR/generic-arithmetic-saturating-2.rs:37:9
    |
 LL |         simd_saturating_sub(z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
index 57bda5c2d62..5fe65257d15 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
@@ -12,10 +12,12 @@ struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 struct I32<const N: usize>([i32; N]);
 
-extern "rust-intrinsic" {
-    fn simd_saturating_add<T>(x: T, y: T) -> T;
-    fn simd_saturating_sub<T>(x: T, y: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_saturating_add<T>(x: T, y: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_saturating_sub<T>(x: T, y: T) -> T;
+
 
 fn main() {
     // unsigned
diff --git a/tests/ui/simd/intrinsic/generic-as.rs b/tests/ui/simd/intrinsic/generic-as.rs
index e97bf12c144..124ca56bc88 100644
--- a/tests/ui/simd/intrinsic/generic-as.rs
+++ b/tests/ui/simd/intrinsic/generic-as.rs
@@ -2,9 +2,9 @@
 
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_as<T, U>(x: T) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_as<T, U>(x: T) -> U;
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/intrinsic/generic-bitmask-pass.rs b/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
index db10020bd46..08526991fbe 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
@@ -21,9 +21,8 @@ struct u8x4(pub [u8; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct Tx4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(x: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_bitmask<T, U>(x: T) -> U;
 
 fn main() {
     let z = u32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-bitmask.rs b/tests/ui/simd/intrinsic/generic-bitmask.rs
index 29b9279c370..49589d22bbf 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask.rs
+++ b/tests/ui/simd/intrinsic/generic-bitmask.rs
@@ -30,9 +30,8 @@ struct u8x32([u8; 32]);
 #[derive(Copy, Clone)]
 struct u8x64([u8; 64]);
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(x: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_bitmask<T, U>(x: T) -> U;
 
 fn main() {
     let m2 = u32x2([0; 2]);
diff --git a/tests/ui/simd/intrinsic/generic-bitmask.stderr b/tests/ui/simd/intrinsic/generic-bitmask.stderr
index 0de3f8eead8..c217bb2d8f1 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask.stderr
+++ b/tests/ui/simd/intrinsic/generic-bitmask.stderr
@@ -1,29 +1,29 @@
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-bitmask.rs:53:22
+  --> $DIR/generic-bitmask.rs:52:22
    |
 LL |         let _: u16 = simd_bitmask(m2);
    |                      ^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-bitmask.rs:56:22
+  --> $DIR/generic-bitmask.rs:55:22
    |
 LL |         let _: u16 = simd_bitmask(m8);
    |                      ^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u32`, expected `u16` or `[u8; 2]`
-  --> $DIR/generic-bitmask.rs:59:22
+  --> $DIR/generic-bitmask.rs:58:22
    |
 LL |         let _: u32 = simd_bitmask(m16);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u64`, expected `u32` or `[u8; 4]`
-  --> $DIR/generic-bitmask.rs:62:22
+  --> $DIR/generic-bitmask.rs:61:22
    |
 LL |         let _: u64 = simd_bitmask(m32);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u128`, expected `u64` or `[u8; 8]`
-  --> $DIR/generic-bitmask.rs:65:23
+  --> $DIR/generic-bitmask.rs:64:23
    |
 LL |         let _: u128 = simd_bitmask(m64);
    |                       ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-bswap-byte.rs b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
index f1702538165..4521573636c 100644
--- a/tests/ui/simd/intrinsic/generic-bswap-byte.rs
+++ b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
@@ -10,9 +10,8 @@ struct i8x4([i8; 4]);
 #[derive(Copy, Clone)]
 struct u8x4([u8; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_bswap<T>(x: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_bswap<T>(x: T) -> T;
 
 fn main() {
     unsafe {
diff --git a/tests/ui/simd/intrinsic/generic-cast-pass.rs b/tests/ui/simd/intrinsic/generic-cast-pass.rs
index e0319a6461a..2155d845864 100644
--- a/tests/ui/simd/intrinsic/generic-cast-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-cast-pass.rs
@@ -3,9 +3,9 @@
 
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_cast<T, U>(x: T) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_cast<T, U>(x: T) -> U;
 
 use std::cmp::{max, min};
 
diff --git a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
index 1c09a9fbf3b..9f28898654f 100644
--- a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
+++ b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
@@ -1,9 +1,8 @@
 //@ run-pass
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_cast<T, U>(x: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_cast<T, U>(x: T) -> U;
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/intrinsic/generic-cast.rs b/tests/ui/simd/intrinsic/generic-cast.rs
index 33978a2f739..7f398804eb4 100644
--- a/tests/ui/simd/intrinsic/generic-cast.rs
+++ b/tests/ui/simd/intrinsic/generic-cast.rs
@@ -21,9 +21,8 @@ struct f32x4([f32; 4]);
 struct f32x8([f32; 8]);
 
 
-extern "rust-intrinsic" {
-    fn simd_cast<T, U>(x: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_cast<T, U>(x: T) -> U;
 
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-cast.stderr b/tests/ui/simd/intrinsic/generic-cast.stderr
index 2f9d44037af..1b6ac03f8c9 100644
--- a/tests/ui/simd/intrinsic/generic-cast.stderr
+++ b/tests/ui/simd/intrinsic/generic-cast.stderr
@@ -1,23 +1,23 @@
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:32:9
+  --> $DIR/generic-cast.rs:31:9
    |
 LL |         simd_cast::<i32, i32>(0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:34:9
+  --> $DIR/generic-cast.rs:33:9
    |
 LL |         simd_cast::<i32, i32x4>(0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:36:9
+  --> $DIR/generic-cast.rs:35:9
    |
 LL |         simd_cast::<i32x4, i32>(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i32x8` with length 8
-  --> $DIR/generic-cast.rs:38:9
+  --> $DIR/generic-cast.rs:37:9
    |
 LL |         simd_cast::<_, i32x8>(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-comparison-pass.rs b/tests/ui/simd/intrinsic/generic-comparison-pass.rs
index a4d84a4c534..68f98372e1d 100644
--- a/tests/ui/simd/intrinsic/generic-comparison-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-comparison-pass.rs
@@ -14,14 +14,24 @@ struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_eq<T, U>(x: T, y: T) -> U;
-    fn simd_ne<T, U>(x: T, y: T) -> U;
-    fn simd_lt<T, U>(x: T, y: T) -> U;
-    fn simd_le<T, U>(x: T, y: T) -> U;
-    fn simd_gt<T, U>(x: T, y: T) -> U;
-    fn simd_ge<T, U>(x: T, y: T) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_eq<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_ne<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_lt<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_le<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_gt<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_ge<T, U>(x: T, y: T) -> U;
 
 macro_rules! cmp {
     ($method: ident($lhs: expr, $rhs: expr)) => {{
diff --git a/tests/ui/simd/intrinsic/generic-comparison.rs b/tests/ui/simd/intrinsic/generic-comparison.rs
index f7f0655f3d2..e5adb49f6a3 100644
--- a/tests/ui/simd/intrinsic/generic-comparison.rs
+++ b/tests/ui/simd/intrinsic/generic-comparison.rs
@@ -11,14 +11,24 @@ struct i32x4([i32; 4]);
 #[allow(non_camel_case_types)]
 struct i16x8([i16; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_eq<T, U>(x: T, y: T) -> U;
-    fn simd_ne<T, U>(x: T, y: T) -> U;
-    fn simd_lt<T, U>(x: T, y: T) -> U;
-    fn simd_le<T, U>(x: T, y: T) -> U;
-    fn simd_gt<T, U>(x: T, y: T) -> U;
-    fn simd_ge<T, U>(x: T, y: T) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_eq<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_ne<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_lt<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_le<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_gt<T, U>(x: T, y: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_ge<T, U>(x: T, y: T) -> U;
 
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-comparison.stderr b/tests/ui/simd/intrinsic/generic-comparison.stderr
index ac4d4918827..cc66d2ce40a 100644
--- a/tests/ui/simd/intrinsic/generic-comparison.stderr
+++ b/tests/ui/simd/intrinsic/generic-comparison.stderr
@@ -1,107 +1,107 @@
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:27:9
+  --> $DIR/generic-comparison.rs:37:9
    |
 LL |         simd_eq::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:29:9
+  --> $DIR/generic-comparison.rs:39:9
    |
 LL |         simd_ne::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:31:9
+  --> $DIR/generic-comparison.rs:41:9
    |
 LL |         simd_lt::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:33:9
+  --> $DIR/generic-comparison.rs:43:9
    |
 LL |         simd_le::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:35:9
+  --> $DIR/generic-comparison.rs:45:9
    |
 LL |         simd_gt::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:37:9
+  --> $DIR/generic-comparison.rs:47:9
    |
 LL |         simd_ge::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:40:9
+  --> $DIR/generic-comparison.rs:50:9
    |
 LL |         simd_eq::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:42:9
+  --> $DIR/generic-comparison.rs:52:9
    |
 LL |         simd_ne::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:44:9
+  --> $DIR/generic-comparison.rs:54:9
    |
 LL |         simd_lt::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:46:9
+  --> $DIR/generic-comparison.rs:56:9
    |
 LL |         simd_le::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:48:9
+  --> $DIR/generic-comparison.rs:58:9
    |
 LL |         simd_gt::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:50:9
+  --> $DIR/generic-comparison.rs:60:9
    |
 LL |         simd_ge::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:53:9
+  --> $DIR/generic-comparison.rs:63:9
    |
 LL |         simd_eq::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:55:9
+  --> $DIR/generic-comparison.rs:65:9
    |
 LL |         simd_ne::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:57:9
+  --> $DIR/generic-comparison.rs:67:9
    |
 LL |         simd_lt::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:59:9
+  --> $DIR/generic-comparison.rs:69:9
    |
 LL |         simd_le::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:61:9
+  --> $DIR/generic-comparison.rs:71:9
    |
 LL |         simd_gt::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:63:9
+  --> $DIR/generic-comparison.rs:73:9
    |
 LL |         simd_ge::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-elements-pass.rs b/tests/ui/simd/intrinsic/generic-elements-pass.rs
index 7b1bda4fbcd..8cb600bc9e4 100644
--- a/tests/ui/simd/intrinsic/generic-elements-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-elements-pass.rs
@@ -16,12 +16,15 @@ struct i32x4([i32; 4]);
 #[allow(non_camel_case_types)]
 struct i32x8([i32; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-    fn simd_extract<T, E>(x: T, idx: u32) -> E;
+#[rustc_intrinsic]
+unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
 
-    fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
+
+
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
 
 #[repr(simd)]
 struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
diff --git a/tests/ui/simd/intrinsic/generic-elements.rs b/tests/ui/simd/intrinsic/generic-elements.rs
index 5d784a25eab..4be6645f029 100644
--- a/tests/ui/simd/intrinsic/generic-elements.rs
+++ b/tests/ui/simd/intrinsic/generic-elements.rs
@@ -29,13 +29,20 @@ struct f32x4([f32; 4]);
 #[allow(non_camel_case_types)]
 struct f32x8([f32; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-    fn simd_extract<T, E>(x: T, idx: u32) -> E;
 
-    fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-    fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
+
+
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
+
 
 #[repr(simd)]
 struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
diff --git a/tests/ui/simd/intrinsic/generic-elements.stderr b/tests/ui/simd/intrinsic/generic-elements.stderr
index fd726d75326..8104c3ba5a2 100644
--- a/tests/ui/simd/intrinsic/generic-elements.stderr
+++ b/tests/ui/simd/intrinsic/generic-elements.stderr
@@ -1,125 +1,125 @@
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:47:9
+  --> $DIR/generic-elements.rs:54:9
    |
 LL |         simd_insert(0, 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64`
-  --> $DIR/generic-elements.rs:49:9
+  --> $DIR/generic-elements.rs:56:9
    |
 LL |         simd_insert(x, 0, 1.0);
    |         ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32`
-  --> $DIR/generic-elements.rs:51:9
+  --> $DIR/generic-elements.rs:58:9
    |
 LL |         simd_extract::<_, f32>(x, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:55:9
+  --> $DIR/generic-elements.rs:62:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:58:9
+  --> $DIR/generic-elements.rs:65:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:61:9
+  --> $DIR/generic-elements.rs:68:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:64:9
+  --> $DIR/generic-elements.rs:71:9
    |
 LL |         simd_shuffle::<_, _, f32x2>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:66:9
+  --> $DIR/generic-elements.rs:73:9
    |
 LL |         simd_shuffle::<_, _, f32x4>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:68:9
+  --> $DIR/generic-elements.rs:75:9
    |
 LL |         simd_shuffle::<_, _, f32x8>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:71:9
+  --> $DIR/generic-elements.rs:78:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:73:9
+  --> $DIR/generic-elements.rs:80:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:75:9
+  --> $DIR/generic-elements.rs:82:9
    |
 LL |         simd_shuffle::<_, _, i32x2>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:79:9
+  --> $DIR/generic-elements.rs:86:9
    |
 LL |         simd_shuffle_generic::<i32, i32, I2>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:82:9
+  --> $DIR/generic-elements.rs:89:9
    |
 LL |         simd_shuffle_generic::<i32, i32, I4>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:85:9
+  --> $DIR/generic-elements.rs:92:9
    |
 LL |         simd_shuffle_generic::<i32, i32, I8>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:88:9
+  --> $DIR/generic-elements.rs:95:9
    |
 LL |         simd_shuffle_generic::<_, f32x2, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:90:9
+  --> $DIR/generic-elements.rs:97:9
    |
 LL |         simd_shuffle_generic::<_, f32x4, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:92:9
+  --> $DIR/generic-elements.rs:99:9
    |
 LL |         simd_shuffle_generic::<_, f32x8, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:95:9
+  --> $DIR/generic-elements.rs:102:9
    |
 LL |         simd_shuffle_generic::<_, i32x8, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:97:9
+  --> $DIR/generic-elements.rs:104:9
    |
 LL |         simd_shuffle_generic::<_, i32x8, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_generic` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:99:9
+  --> $DIR/generic-elements.rs:106:9
    |
 LL |         simd_shuffle_generic::<_, i32x2, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-gather-pass.rs b/tests/ui/simd/intrinsic/generic-gather-pass.rs
index 3315d1cdaa2..0b2cf47e989 100644
--- a/tests/ui/simd/intrinsic/generic-gather-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-gather-pass.rs
@@ -10,10 +10,11 @@
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct x4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-    fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
-}
+#[rustc_intrinsic]
+unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
 
 fn main() {
     let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.];
diff --git a/tests/ui/simd/intrinsic/generic-reduction-pass.rs b/tests/ui/simd/intrinsic/generic-reduction-pass.rs
index 699fb396259..8408d0f203b 100644
--- a/tests/ui/simd/intrinsic/generic-reduction-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-reduction-pass.rs
@@ -24,19 +24,38 @@ struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone)]
 struct b8x4(pub [i8; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_reduce_add_unordered<T, U>(x: T) -> U;
-    fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
-    fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
-    fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
-    fn simd_reduce_min<T, U>(x: T) -> U;
-    fn simd_reduce_max<T, U>(x: T) -> U;
-    fn simd_reduce_and<T, U>(x: T) -> U;
-    fn simd_reduce_or<T, U>(x: T) -> U;
-    fn simd_reduce_xor<T, U>(x: T) -> U;
-    fn simd_reduce_all<T>(x: T) -> bool;
-    fn simd_reduce_any<T>(x: T) -> bool;
-}
+#[rustc_intrinsic]
+unsafe fn simd_reduce_add_unordered<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_min<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_max<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_and<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_or<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_xor<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_all<T>(x: T) -> bool;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_any<T>(x: T) -> bool;
 
 fn main() {
     unsafe {
diff --git a/tests/ui/simd/intrinsic/generic-reduction.rs b/tests/ui/simd/intrinsic/generic-reduction.rs
index 1986deafb6a..ead13250643 100644
--- a/tests/ui/simd/intrinsic/generic-reduction.rs
+++ b/tests/ui/simd/intrinsic/generic-reduction.rs
@@ -15,16 +15,26 @@ pub struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone)]
 pub struct u32x4(pub [u32; 4]);
 
+#[rustc_intrinsic]
+unsafe fn simd_reduce_add_ordered<T, U>(x: T, y: U) -> U;
 
-extern "rust-intrinsic" {
-    fn simd_reduce_add_ordered<T, U>(x: T, y: U) -> U;
-    fn simd_reduce_mul_ordered<T, U>(x: T, y: U) -> U;
-    fn simd_reduce_and<T, U>(x: T) -> U;
-    fn simd_reduce_or<T, U>(x: T) -> U;
-    fn simd_reduce_xor<T, U>(x: T) -> U;
-    fn simd_reduce_all<T>(x: T) -> bool;
-    fn simd_reduce_any<T>(x: T) -> bool;
-}
+#[rustc_intrinsic]
+unsafe fn simd_reduce_mul_ordered<T, U>(x: T, y: U) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_and<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_or<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_xor<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_all<T>(x: T) -> bool;
+
+#[rustc_intrinsic]
+unsafe fn simd_reduce_any<T>(x: T) -> bool;
 
 fn main() {
     let x = u32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-reduction.stderr b/tests/ui/simd/intrinsic/generic-reduction.stderr
index 1028faf69a7..302b9ae1d77 100644
--- a/tests/ui/simd/intrinsic/generic-reduction.stderr
+++ b/tests/ui/simd/intrinsic/generic-reduction.stderr
@@ -1,59 +1,59 @@
 error[E0511]: invalid monomorphization of `simd_reduce_add_ordered` intrinsic: expected return type `f32` (element of input `f32x4`), found `i32`
-  --> $DIR/generic-reduction.rs:34:9
+  --> $DIR/generic-reduction.rs:44:9
    |
 LL |         simd_reduce_add_ordered(z, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_mul_ordered` intrinsic: expected return type `f32` (element of input `f32x4`), found `i32`
-  --> $DIR/generic-reduction.rs:36:9
+  --> $DIR/generic-reduction.rs:46:9
    |
 LL |         simd_reduce_mul_ordered(z, 1);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:39:22
+  --> $DIR/generic-reduction.rs:49:22
    |
 LL |         let _: f32 = simd_reduce_and(x);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:41:22
+  --> $DIR/generic-reduction.rs:51:22
    |
 LL |         let _: f32 = simd_reduce_or(x);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:43:22
+  --> $DIR/generic-reduction.rs:53:22
    |
 LL |         let _: f32 = simd_reduce_xor(x);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: unsupported simd_reduce_and from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:46:22
+  --> $DIR/generic-reduction.rs:56:22
    |
 LL |         let _: f32 = simd_reduce_and(z);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: unsupported simd_reduce_or from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:48:22
+  --> $DIR/generic-reduction.rs:58:22
    |
 LL |         let _: f32 = simd_reduce_or(z);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: unsupported simd_reduce_xor from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:50:22
+  --> $DIR/generic-reduction.rs:60:22
    |
 LL |         let _: f32 = simd_reduce_xor(z);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_all` intrinsic: unsupported simd_reduce_all from `f32x4` with element `f32` to `bool`
-  --> $DIR/generic-reduction.rs:53:23
+  --> $DIR/generic-reduction.rs:63:23
    |
 LL |         let _: bool = simd_reduce_all(z);
    |                       ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_any` intrinsic: unsupported simd_reduce_any from `f32x4` with element `f32` to `bool`
-  --> $DIR/generic-reduction.rs:55:23
+  --> $DIR/generic-reduction.rs:65:23
    |
 LL |         let _: bool = simd_reduce_any(z);
    |                       ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-select-pass.rs b/tests/ui/simd/intrinsic/generic-select-pass.rs
index 5690bad5048..6b1b6cb79db 100644
--- a/tests/ui/simd/intrinsic/generic-select-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-select-pass.rs
@@ -29,10 +29,12 @@ struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct b8x4(pub [i8; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_select<T, U>(x: T, a: U, b: U) -> U;
-    fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_select<T, U>(x: T, a: U, b: U) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
+
 
 fn main() {
     let m0 = b8x4([!0, !0, !0, !0]);
diff --git a/tests/ui/simd/intrinsic/generic-select.rs b/tests/ui/simd/intrinsic/generic-select.rs
index 52e02649590..340fe3f3592 100644
--- a/tests/ui/simd/intrinsic/generic-select.rs
+++ b/tests/ui/simd/intrinsic/generic-select.rs
@@ -22,10 +22,13 @@ struct b8x4(pub [i8; 4]);
 #[derive(Copy, Clone, PartialEq)]
 struct b8x8(pub [i8; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_select<T, U>(x: T, a: U, b: U) -> U;
-    fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_select<T, U>(x: T, a: U, b: U) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
+
 
 fn main() {
     let m4 = b8x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-select.stderr b/tests/ui/simd/intrinsic/generic-select.stderr
index d576f1bc774..a97fc91f951 100644
--- a/tests/ui/simd/intrinsic/generic-select.stderr
+++ b/tests/ui/simd/intrinsic/generic-select.stderr
@@ -1,47 +1,47 @@
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mismatched lengths: mask length `8` != other vector length `4`
-  --> $DIR/generic-select.rs:39:9
+  --> $DIR/generic-select.rs:42:9
    |
 LL |         simd_select(m8, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `u32`, expected `i_`
-  --> $DIR/generic-select.rs:42:9
+  --> $DIR/generic-select.rs:45:9
    |
 LL |         simd_select(x, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `f32`, expected `i_`
-  --> $DIR/generic-select.rs:45:9
+  --> $DIR/generic-select.rs:48:9
    |
 LL |         simd_select(z, z, z);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: expected SIMD argument type, found non-SIMD `u32`
-  --> $DIR/generic-select.rs:48:9
+  --> $DIR/generic-select.rs:51:9
    |
 LL |         simd_select(m4, 0u32, 1u32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:51:9
+  --> $DIR/generic-select.rs:54:9
    |
 LL |         simd_select_bitmask(0u16, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: expected SIMD argument type, found non-SIMD `u32`
-  --> $DIR/generic-select.rs:54:9
+  --> $DIR/generic-select.rs:57:9
    |
 LL |         simd_select_bitmask(0u8, 1u32, 2u32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `f32`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:57:9
+  --> $DIR/generic-select.rs:60:9
    |
 LL |         simd_select_bitmask(0.0f32, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `&str`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:60:9
+  --> $DIR/generic-select.rs:63:9
    |
 LL |         simd_select_bitmask("x", x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-shuffle.rs b/tests/ui/simd/intrinsic/generic-shuffle.rs
index 2752718d99d..1223b8ebe19 100644
--- a/tests/ui/simd/intrinsic/generic-shuffle.rs
+++ b/tests/ui/simd/intrinsic/generic-shuffle.rs
@@ -9,9 +9,9 @@
 #[derive(Copy, Clone)]
 pub struct Simd<T, const N: usize>([T; N]);
 
-extern "rust-intrinsic" {
-    fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
+
 
 fn main() {
     const I: Simd<u32, 2> = Simd([0; 2]);
diff --git a/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs b/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
index d9239ef5801..b324ac40749 100644
--- a/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
+++ b/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
@@ -5,9 +5,8 @@
 //@ compile-flags: -Zmir-opt-level=4
 #![feature(intrinsics, repr_simd)]
 
-extern "rust-intrinsic" {
-    fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
 
 #[repr(simd)]
 #[derive(Debug, PartialEq)]
diff --git a/tests/ui/simd/intrinsic/inlining-issue67557.rs b/tests/ui/simd/intrinsic/inlining-issue67557.rs
index 23dd5075f96..319bb15c015 100644
--- a/tests/ui/simd/intrinsic/inlining-issue67557.rs
+++ b/tests/ui/simd/intrinsic/inlining-issue67557.rs
@@ -5,9 +5,8 @@
 //@ compile-flags: -Zmir-opt-level=4
 #![feature(intrinsics, repr_simd)]
 
-extern "rust-intrinsic" {
-    fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
 
 #[repr(simd)]
 #[derive(Debug, PartialEq)]
diff --git a/tests/ui/simd/intrinsic/issue-85855.rs b/tests/ui/simd/intrinsic/issue-85855.rs
index dc04699f7f8..daeea793d1b 100644
--- a/tests/ui/simd/intrinsic/issue-85855.rs
+++ b/tests/ui/simd/intrinsic/issue-85855.rs
@@ -5,15 +5,18 @@
 #![feature(intrinsics)]
 #![crate_type="lib"]
 
-extern "rust-intrinsic" {
-    fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
-    //~^ ERROR: intrinsic has wrong number of lifetime parameters
 
-    fn simd_add<'a, T>(x: T, y: T) -> T;
+#[rustc_intrinsic]
+unsafe fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
+//~^ ERROR: intrinsic has wrong number of lifetime parameters
 
-    fn simd_sub<T, U>(x: T, y: U);
-    //~^ ERROR: intrinsic has wrong number of type parameters
+#[rustc_intrinsic]
+unsafe fn simd_add<'a, T>(x: T, y: T) -> T;
 
-    fn simd_mul<T, const N: usize>(x: T, y: T);
-    //~^ ERROR: intrinsic has wrong number of const parameters
-}
+#[rustc_intrinsic]
+unsafe fn simd_sub<T, U>(x: T, y: U);
+//~^ ERROR: intrinsic has wrong number of type parameters
+
+#[rustc_intrinsic]
+unsafe fn simd_mul<T, const N: usize>(x: T, y: T);
+//~^ ERROR: intrinsic has wrong number of const parameters
diff --git a/tests/ui/simd/intrinsic/issue-85855.stderr b/tests/ui/simd/intrinsic/issue-85855.stderr
index fb2f1fbc5b1..b91a606ba68 100644
--- a/tests/ui/simd/intrinsic/issue-85855.stderr
+++ b/tests/ui/simd/intrinsic/issue-85855.stderr
@@ -1,20 +1,20 @@
 error[E0094]: intrinsic has wrong number of lifetime parameters: found 1, expected 0
-  --> $DIR/issue-85855.rs:9:27
+  --> $DIR/issue-85855.rs:10:30
    |
-LL |     fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
-   |                           ^^^^^^^^^^^ expected 0 lifetime parameters
+LL | unsafe fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
+   |                              ^^^^^^^^^^^ expected 0 lifetime parameters
 
 error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1
-  --> $DIR/issue-85855.rs:14:16
+  --> $DIR/issue-85855.rs:17:19
    |
-LL |     fn simd_sub<T, U>(x: T, y: U);
-   |                ^^^^^^ expected 1 type parameter
+LL | unsafe fn simd_sub<T, U>(x: T, y: U);
+   |                   ^^^^^^ expected 1 type parameter
 
 error[E0094]: intrinsic has wrong number of const parameters: found 1, expected 0
-  --> $DIR/issue-85855.rs:17:16
+  --> $DIR/issue-85855.rs:21:19
    |
-LL |     fn simd_mul<T, const N: usize>(x: T, y: T);
-   |                ^^^^^^^^^^^^^^^^^^^ expected 0 const parameters
+LL | unsafe fn simd_mul<T, const N: usize>(x: T, y: T);
+   |                   ^^^^^^^^^^^^^^^^^^^ expected 0 const parameters
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/simd/intrinsic/ptr-cast.rs b/tests/ui/simd/intrinsic/ptr-cast.rs
index 0490734b48a..559b8ba1b5c 100644
--- a/tests/ui/simd/intrinsic/ptr-cast.rs
+++ b/tests/ui/simd/intrinsic/ptr-cast.rs
@@ -2,11 +2,15 @@
 
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_cast_ptr<T, U>(x: T) -> U;
-    fn simd_expose_provenance<T, U>(x: T) -> U;
-    fn simd_with_exposed_provenance<T, U>(x: T) -> U;
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_cast_ptr<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_expose_provenance<T, U>(x: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_with_exposed_provenance<T, U>(x: T) -> U;
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/issue-105439.rs b/tests/ui/simd/issue-105439.rs
index 3cb43fc8b1a..108bb282df2 100644
--- a/tests/ui/simd/issue-105439.rs
+++ b/tests/ui/simd/issue-105439.rs
@@ -9,9 +9,8 @@
 #[repr(simd)]
 struct i32x4([i32; 4]);
 
-extern "rust-intrinsic" {
-    pub(crate) fn simd_add<T>(x: T, y: T) -> T;
-}
+#[rustc_intrinsic]
+pub(crate) unsafe fn simd_add<T>(x: T, y: T) -> T;
 
 #[inline(always)]
 fn to_array(a: i32x4) -> [i32; 4] {
diff --git a/tests/ui/simd/issue-39720.rs b/tests/ui/simd/issue-39720.rs
index 2b51c0224c6..8d7666faaf9 100644
--- a/tests/ui/simd/issue-39720.rs
+++ b/tests/ui/simd/issue-39720.rs
@@ -11,9 +11,8 @@ pub struct Char3(pub [i8; 3]);
 #[derive(Copy, Clone, Debug)]
 pub struct Short3(pub [i16; 3]);
 
-extern "rust-intrinsic" {
-    fn simd_cast<T, U>(x: T) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_cast<T, U>(x: T) -> U;
 
 fn main() {
     let cast: Short3 = unsafe { simd_cast(Char3([10, -3, -9])) };
diff --git a/tests/ui/simd/issue-85915-simd-ptrs.rs b/tests/ui/simd/issue-85915-simd-ptrs.rs
index edf60e0205c..2e7baf48ee3 100644
--- a/tests/ui/simd/issue-85915-simd-ptrs.rs
+++ b/tests/ui/simd/issue-85915-simd-ptrs.rs
@@ -22,10 +22,12 @@ struct f32x4([f32; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct i32x4([i32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-    fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
 
 fn main() {
     let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.];
diff --git a/tests/ui/simd/issue-89193.rs b/tests/ui/simd/issue-89193.rs
index 9530124a7cc..4b4fb9d9169 100644
--- a/tests/ui/simd/issue-89193.rs
+++ b/tests/ui/simd/issue-89193.rs
@@ -10,9 +10,8 @@
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct x4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
 
 fn main() {
     let x: [usize; 4] = [10, 11, 12, 13];
diff --git a/tests/ui/simd/masked-load-store-build-fail.rs b/tests/ui/simd/masked-load-store-build-fail.rs
index fbd657763c9..b8742184eb0 100644
--- a/tests/ui/simd/masked-load-store-build-fail.rs
+++ b/tests/ui/simd/masked-load-store-build-fail.rs
@@ -1,10 +1,12 @@
 //@ build-fail
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-    fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
-}
+
+#[rustc_intrinsic]
+unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/masked-load-store-build-fail.stderr b/tests/ui/simd/masked-load-store-build-fail.stderr
index 59af83fe0e8..8a8d8eb99e2 100644
--- a/tests/ui/simd/masked-load-store-build-fail.stderr
+++ b/tests/ui/simd/masked-load-store-build-fail.stderr
@@ -1,5 +1,5 @@
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
-  --> $DIR/masked-load-store-build-fail.rs:18:9
+  --> $DIR/masked-load-store-build-fail.rs:20:9
    |
 LL | /         simd_masked_load(
 LL | |             Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]),
@@ -9,7 +9,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
-  --> $DIR/masked-load-store-build-fail.rs:25:9
+  --> $DIR/masked-load-store-build-fail.rs:27:9
    |
 LL | /         simd_masked_load(
 LL | |             Simd::<i8, 4>([-1, 0, -1, -1]),
@@ -19,7 +19,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
-  --> $DIR/masked-load-store-build-fail.rs:32:9
+  --> $DIR/masked-load-store-build-fail.rs:34:9
    |
 LL | /         simd_masked_load(
 LL | |             Simd::<i8, 4>([-1, 0, -1, -1]),
@@ -29,7 +29,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
-  --> $DIR/masked-load-store-build-fail.rs:39:9
+  --> $DIR/masked-load-store-build-fail.rs:41:9
    |
 LL | /         simd_masked_load(
 LL | |             Simd::<u8, 4>([1, 0, 1, 1]),
@@ -39,7 +39,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
-  --> $DIR/masked-load-store-build-fail.rs:46:9
+  --> $DIR/masked-load-store-build-fail.rs:48:9
    |
 LL | /         simd_masked_store(
 LL | |             Simd([-1i8; 4]),
@@ -49,7 +49,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
-  --> $DIR/masked-load-store-build-fail.rs:53:9
+  --> $DIR/masked-load-store-build-fail.rs:55:9
    |
 LL | /         simd_masked_store(
 LL | |             Simd([-1i8; 4]),
@@ -59,7 +59,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
-  --> $DIR/masked-load-store-build-fail.rs:60:9
+  --> $DIR/masked-load-store-build-fail.rs:62:9
    |
 LL | /         simd_masked_store(
 LL | |             Simd([-1i8; 4]),
@@ -69,7 +69,7 @@ LL | |         );
    | |_________^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
-  --> $DIR/masked-load-store-build-fail.rs:67:9
+  --> $DIR/masked-load-store-build-fail.rs:69:9
    |
 LL | /         simd_masked_store(
 LL | |             Simd([1u32; 4]),
diff --git a/tests/ui/simd/masked-load-store-check-fail.rs b/tests/ui/simd/masked-load-store-check-fail.rs
index 39c82c41385..0f36bf6443f 100644
--- a/tests/ui/simd/masked-load-store-check-fail.rs
+++ b/tests/ui/simd/masked-load-store-check-fail.rs
@@ -1,10 +1,11 @@
 //@ check-fail
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-    fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
-}
+#[rustc_intrinsic]
+unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/masked-load-store-check-fail.stderr b/tests/ui/simd/masked-load-store-check-fail.stderr
index 5d205d607c9..fa65798fc94 100644
--- a/tests/ui/simd/masked-load-store-check-fail.stderr
+++ b/tests/ui/simd/masked-load-store-check-fail.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/masked-load-store-check-fail.rs:21:13
+  --> $DIR/masked-load-store-check-fail.rs:22:13
    |
 LL |         let _x: Simd<u8, 2> = simd_masked_load(
    |                               ---------------- arguments to this function are incorrect
@@ -10,7 +10,7 @@ LL |             Simd::<u8, 4>([9; 4])
    = note: expected struct `Simd<_, 2>`
               found struct `Simd<_, 4>`
 help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
-  --> $DIR/masked-load-store-check-fail.rs:18:31
+  --> $DIR/masked-load-store-check-fail.rs:19:31
    |
 LL |           let _x: Simd<u8, 2> = simd_masked_load(
    |  _______________________________^
@@ -21,13 +21,13 @@ LL | |             Simd::<u8, 4>([9; 4])
 LL | |         );
    | |_________^
 note: function defined here
-  --> $DIR/masked-load-store-check-fail.rs:5:8
+  --> $DIR/masked-load-store-check-fail.rs:5:11
    |
-LL |     fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-   |        ^^^^^^^^^^^^^^^^
+LL | unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+   |           ^^^^^^^^^^^^^^^^                               ---------
 
 error[E0308]: mismatched types
-  --> $DIR/masked-load-store-check-fail.rs:28:13
+  --> $DIR/masked-load-store-check-fail.rs:29:13
    |
 LL |         let _x: Simd<u32, 4> = simd_masked_load(
    |                                ---------------- arguments to this function are incorrect
@@ -38,7 +38,7 @@ LL |             default
    = note: expected struct `Simd<u32, _>`
               found struct `Simd<u8, _>`
 help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
-  --> $DIR/masked-load-store-check-fail.rs:25:32
+  --> $DIR/masked-load-store-check-fail.rs:26:32
    |
 LL |           let _x: Simd<u32, 4> = simd_masked_load(
    |  ________________________________^
@@ -49,10 +49,10 @@ LL | |             default
 LL | |         );
    | |_________^
 note: function defined here
-  --> $DIR/masked-load-store-check-fail.rs:5:8
+  --> $DIR/masked-load-store-check-fail.rs:5:11
    |
-LL |     fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-   |        ^^^^^^^^^^^^^^^^
+LL | unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+   |           ^^^^^^^^^^^^^^^^                               ---------
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/simd/masked-load-store.rs b/tests/ui/simd/masked-load-store.rs
index 902143f9261..4b4195f51f1 100644
--- a/tests/ui/simd/masked-load-store.rs
+++ b/tests/ui/simd/masked-load-store.rs
@@ -1,10 +1,11 @@
 //@ run-pass
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-    fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
-}
+#[rustc_intrinsic]
+unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
+
+#[rustc_intrinsic]
+unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
index 2d1fa1f8da2..b0a8da59fac 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
+++ b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
@@ -1,5 +1,5 @@
 error: overly complex generic constant
-  --> $DIR/monomorphize-shuffle-index.rs:29:45
+  --> $DIR/monomorphize-shuffle-index.rs:32:45
    |
 LL |         return simd_shuffle_generic::<_, _, { &Self::I.0 }>(a, b);
    |                                             ^^----------^^
diff --git a/tests/ui/simd/monomorphize-shuffle-index.rs b/tests/ui/simd/monomorphize-shuffle-index.rs
index 140cf6fbe96..01926408a2c 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.rs
+++ b/tests/ui/simd/monomorphize-shuffle-index.rs
@@ -4,12 +4,15 @@
 #![feature(repr_simd, intrinsics, adt_const_params, unsized_const_params, generic_const_exprs)]
 #![allow(incomplete_features)]
 
-extern "rust-intrinsic" {
-    #[cfg(old)]
-    fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
-    #[cfg(any(generic, generic_with_fn))]
-    fn simd_shuffle_generic<T, U, const I: &'static [u32]>(a: T, b: T) -> U;
-}
+
+#[rustc_intrinsic]
+#[cfg(old)]
+unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
+
+#[rustc_intrinsic]
+#[cfg(any(generic, generic_with_fn))]
+unsafe fn simd_shuffle_generic<T, U, const I: &'static [u32]>(a: T, b: T) -> U;
+
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/repr_packed.rs b/tests/ui/simd/repr_packed.rs
index 1ba15bda98d..a666892226e 100644
--- a/tests/ui/simd/repr_packed.rs
+++ b/tests/ui/simd/repr_packed.rs
@@ -22,9 +22,8 @@ fn check_ty<T>() {
     check_size_align::<T, 15>();
 }
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(a: T, b: T) -> T;
-}
+#[rustc_intrinsic]
+unsafe fn simd_add<T>(a: T, b: T) -> T;
 
 fn main() {
     check_ty::<u8>();
diff --git a/tests/ui/simd/shuffle.rs b/tests/ui/simd/shuffle.rs
index 96c0ed2118f..2cae5a1e7de 100644
--- a/tests/ui/simd/shuffle.rs
+++ b/tests/ui/simd/shuffle.rs
@@ -8,9 +8,8 @@
 
 use std::marker::ConstParamTy;
 
-extern "rust-intrinsic" {
-    fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
 
 #[derive(Copy, Clone, ConstParamTy, PartialEq, Eq)]
 #[repr(simd)]
diff --git a/tests/ui/simd/simd-bitmask-notpow2.rs b/tests/ui/simd/simd-bitmask-notpow2.rs
index 3499bf33ed5..d7572ef4a2a 100644
--- a/tests/ui/simd/simd-bitmask-notpow2.rs
+++ b/tests/ui/simd/simd-bitmask-notpow2.rs
@@ -4,10 +4,12 @@
 //@ ignore-endian-big
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(v: T) -> U;
-    fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_bitmask<T, U>(v: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
+
 
 fn main() {
     // Non-power-of-2 multi-byte mask.
diff --git a/tests/ui/simd/simd-bitmask.rs b/tests/ui/simd/simd-bitmask.rs
index 82f73fca951..4275ab0f40c 100644
--- a/tests/ui/simd/simd-bitmask.rs
+++ b/tests/ui/simd/simd-bitmask.rs
@@ -1,10 +1,12 @@
 //@run-pass
 #![feature(repr_simd, intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(v: T) -> U;
-    fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
-}
+#[rustc_intrinsic]
+unsafe fn simd_bitmask<T, U>(v: T) -> U;
+
+#[rustc_intrinsic]
+unsafe fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
+
 
 #[derive(Copy, Clone)]
 #[repr(simd)]