about summary refs log tree commit diff
path: root/tests/codegen/simd-intrinsic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen/simd-intrinsic')
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs104
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs23
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs19
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs20
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs2
22 files changed, 131 insertions, 193 deletions
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
index 4a5a6391c05..485ba92272d 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fabs;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fabs<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fabs_32x2
 #[no_mangle]
 pub unsafe fn fabs_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
index 89e54f579ff..e8bda7c29c4 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_ceil;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_ceil<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @ceil_32x2
 #[no_mangle]
 pub unsafe fn ceil_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
index b40fd5365de..8dc967bc3ad 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fcos;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fcos<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fcos_32x2
 #[no_mangle]
 pub unsafe fn fcos_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
index fef003dde5b..00caca2f294 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fexp;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fexp<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @exp_32x2
 #[no_mangle]
 pub unsafe fn exp_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
index 779c0fc403a..eda4053189c 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fexp2;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fexp2<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @exp2_32x2
 #[no_mangle]
 pub unsafe fn exp2_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
index b2bd27a5b75..ad69d4cdd88 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_floor;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_floor<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @floor_32x2
 #[no_mangle]
 pub unsafe fn floor_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
index 37f4782626a..cbeefdc31c0 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fma;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fma<T>(x: T, b: T, c: T) -> T;
-}
-
 // CHECK-LABEL: @fma_32x2
 #[no_mangle]
 pub unsafe fn fma_32x2(a: f32x2, b: f32x2, c: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
index 336adf6db73..618daa4b44d 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fsqrt;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fsqrt<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fsqrt_32x2
 #[no_mangle]
 pub unsafe fn fsqrt_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
index 8e97abc3a66..98a481e4004 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log_32x2
 #[no_mangle]
 pub unsafe fn log_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
index 1d4d4dc24e9..9108cd963f0 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog10;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog10<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log10_32x2
 #[no_mangle]
 pub unsafe fn log10_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
index 28f2f151617..2b20850dbd9 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog2;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog2<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log2_32x2
 #[no_mangle]
 pub unsafe fn log2_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
index 50c51bebe37..ce07b212e84 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
@@ -1,19 +1,15 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_fmax, simd_fmin};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_fmin<T>(x: T, y: T) -> T;
-    fn simd_fmax<T>(x: T, y: T) -> T;
-}
-
 // CHECK-LABEL: @fmin
 #[no_mangle]
 pub unsafe fn fmin(a: f32x4, b: f32x4) -> f32x4 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
index 4173809e3a9..7de26b415bb 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fsin;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fsin<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fsin_32x2
 #[no_mangle]
 pub unsafe fn fsin_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
index a5afa27876a..ecf5eb24ee5 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
@@ -1,71 +1,71 @@
 //@ compile-flags: -C no-prepopulate-passes
-//
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 #![deny(unused)]
 
-// signed integer types
+use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub};
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x2([i8; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x4([i8; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x8([i8; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x16([i8; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x32([i8; 32]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x64([i8; 64]);
+#[rustfmt::skip]
+mod types {
+    // signed integer types
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x2([i16; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x4([i16; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x8([i16; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x16([i16; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x32([i16; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x2([i8; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x4([i8; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x8([i8; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x16([i8; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x32([i8; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x64([i8; 64]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x2([i32; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x4([i32; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x8([i32; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x16([i32; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x2([i16; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x4([i16; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x8([i16; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x16([i16; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x32([i16; 32]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x2([i64; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x4([i64; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x8([i64; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x2([i32; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x4([i32; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x8([i32; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x16([i32; 16]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i128x2([i128; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i128x4([i128; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x2([i64; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x4([i64; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x8([i64; 8]);
 
-// unsigned integer types
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x2([i128; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x4([i128; 4]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x2([u8; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x4([u8; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x8([u8; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x16([u8; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x32([u8; 32]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x64([u8; 64]);
+    // unsigned integer types
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x2([u16; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x4([u16; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x8([u16; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x16([u16; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x32([u16; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x2([u8; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x4([u8; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x8([u8; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x16([u8; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x32([u8; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x64([u8; 64]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x2([u32; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x4([u32; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x8([u32; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x16([u32; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x2([u16; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x4([u16; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x8([u16; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x16([u16; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x32([u16; 32]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x2([u64; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x4([u64; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x8([u64; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x2([u32; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x4([u32; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x8([u32; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x16([u32; 16]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u128x2([u128; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u128x4([u128; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x2([u64; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x4([u64; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x8([u64; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_saturating_add<T>(x: T, y: T) -> T;
-    fn simd_saturating_sub<T>(x: T, y: T) -> T;
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x2([u128; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x4([u128; 4]);
 }
 
+use types::*;
+
 // NOTE(eddyb) `%{{x|0}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
@@ -213,8 +213,6 @@ pub unsafe fn sadd_i128x4(x: i128x4, y: i128x4) -> i128x4 {
     simd_saturating_add(x, y)
 }
 
-
-
 // CHECK-LABEL: @uadd_u8x2
 #[no_mangle]
 pub unsafe fn uadd_u8x2(x: u8x2, y: u8x2) -> u8x2 {
@@ -355,10 +353,6 @@ pub unsafe fn uadd_u128x4(x: u128x4, y: u128x4) -> u128x4 {
     simd_saturating_add(x, y)
 }
 
-
-
-
-
 // CHECK-LABEL: @ssub_i8x2
 #[no_mangle]
 pub unsafe fn ssub_i8x2(x: i8x2, y: i8x2) -> i8x2 {
@@ -499,8 +493,6 @@ pub unsafe fn ssub_i128x4(x: i128x4, y: i128x4) -> i128x4 {
     simd_saturating_sub(x, y)
 }
 
-
-
 // CHECK-LABEL: @usub_u8x2
 #[no_mangle]
 pub unsafe fn usub_u8x2(x: u8x2, y: u8x2) -> u8x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
index e9112f1f321..a2c40aa91b5 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
@@ -2,10 +2,11 @@
 //
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_bitmask;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct u32x2([u32; 2]);
@@ -18,10 +19,6 @@ pub struct i32x2([i32; 2]);
 #[derive(Copy, Clone)]
 pub struct i8x16([i8; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(x: T) -> U;
-}
-
 // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
index 7f99f695bf4..9bb46a3546b 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
@@ -3,10 +3,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_gather;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -15,14 +16,13 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_gather<T, P, M>(value: T, pointers: P, mask: M) -> T;
-}
-
 // CHECK-LABEL: @gather_f32x2
 #[no_mangle]
-pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
-                           values: Vec2<f32>) -> Vec2<f32> {
+pub unsafe fn gather_f32x2(
+    pointers: Vec2<*const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<f32>,
+) -> Vec2<f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
@@ -31,8 +31,11 @@ pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
 
 // CHECK-LABEL: @gather_pf32x2
 #[no_mangle]
-pub unsafe fn gather_pf32x2(pointers: Vec2<*const *const f32>, mask: Vec2<i32>,
-                           values: Vec2<*const f32>) -> Vec2<*const f32> {
+pub unsafe fn gather_pf32x2(
+    pointers: Vec2<*const *const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<*const f32>,
+) -> Vec2<*const f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x ptr> @llvm.masked.gather.v2p0.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x ptr> {{.*}})
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
index 7f46630e920..fcc4cb5d630 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_masked_load;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -13,14 +14,9 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-}
-
 // CHECK-LABEL: @load_f32x2
 #[no_mangle]
-pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32,
-                         values: Vec2<f32>) -> Vec2<f32> {
+pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32, values: Vec2<f32>) -> Vec2<f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}})
@@ -29,8 +25,11 @@ pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32,
 
 // CHECK-LABEL: @load_pf32x4
 #[no_mangle]
-pub unsafe fn load_pf32x4(mask: Vec4<i32>, pointer: *const *const f32,
-                          values: Vec4<*const f32>) -> Vec4<*const f32> {
+pub unsafe fn load_pf32x4(
+    mask: Vec4<i32>,
+    pointer: *const *const f32,
+    values: Vec4<*const f32>,
+) -> Vec4<*const f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <4 x i32> {{.*}}, {{<i32 31, i32 31, i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1>
     // CHECK: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}})
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
index 0d43234f1e2..04f4a0c6382 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_masked_store;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -13,10 +14,6 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
-}
-
 // CHECK-LABEL: @store_f32x2
 #[no_mangle]
 pub unsafe fn store_f32x2(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>) {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
index ef7827bd96f..9506f8f6d3a 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
@@ -3,10 +3,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_scatter;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -15,25 +16,22 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_scatter<T, P, M>(value: T, pointers: P, mask: M);
-}
-
 // CHECK-LABEL: @scatter_f32x2
 #[no_mangle]
-pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>,
-                            values: Vec2<f32>) {
+pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>, values: Vec2<f32>) {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]]
     simd_scatter(values, pointers, mask)
 }
 
-
 // CHECK-LABEL: @scatter_pf32x2
 #[no_mangle]
-pub unsafe fn scatter_pf32x2(pointers: Vec2<*mut *const f32>, mask: Vec2<i32>,
-                             values: Vec2<*const f32>) {
+pub unsafe fn scatter_pf32x2(
+    pointers: Vec2<*mut *const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<*const f32>,
+) {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call void @llvm.masked.scatter.v2p0.v2p0(<2 x ptr> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]]
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
index 33ed2b437f9..71279d9f0ea 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_select, simd_select_bitmask};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x4(pub [f32; 4]);
@@ -21,11 +22,6 @@ pub struct b8x4(pub [i8; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct i32x4([i32; 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;
-}
-
 // CHECK-LABEL: @select_m8
 #[no_mangle]
 pub unsafe fn select_m8(m: b8x4, a: f32x4, b: f32x4) -> f32x4 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
index 92067db9b15..269fe41225e 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
-//
 
 #![crate_type = "lib"]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_reduce_all, simd_reduce_any};
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct mask32x2([i32; 2]);
@@ -13,11 +14,6 @@ pub struct mask32x2([i32; 2]);
 #[derive(Copy, Clone)]
 pub struct mask8x16([i8; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_reduce_all<T>(x: T) -> bool;
-    fn simd_reduce_any<T>(x: T) -> bool;
-}
-
 // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
index 0d21d510557..d3853361de9 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
@@ -12,7 +12,7 @@
 
 #![crate_type = "lib"]
 #![allow(non_camel_case_types)]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]