Skip to content

Commit ffeb056

Browse files
committed
remove most simd_ intrinsic declaration in tests
instead, we can just import the intrinsics from core
1 parent 6eea027 commit ffeb056

File tree

86 files changed

+515
-1040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+515
-1040
lines changed

tests/codegen/issues/issue-84268.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//@ compile-flags: -Copt-level=3 --crate-type=rlib
22
#![feature(intrinsics, repr_simd)]
33

4-
extern "rust-intrinsic" {
5-
fn simd_fabs<T>(x: T) -> T;
6-
fn simd_eq<T, U>(x: T, y: T) -> U;
7-
}
4+
use std::intrinsics::simd::{simd_eq, simd_fabs};
85

96
#[repr(simd)]
107
pub struct V([f32; 4]);

tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fabs;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fabs<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @fabs_32x2
2926
#[no_mangle]
3027
pub unsafe fn fabs_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_ceil;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_ceil<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @ceil_32x2
2926
#[no_mangle]
3027
pub unsafe fn ceil_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fcos;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fcos<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @fcos_32x2
2926
#[no_mangle]
3027
pub unsafe fn fcos_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fexp;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fexp<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @exp_32x2
2926
#[no_mangle]
3027
pub unsafe fn exp_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fexp2;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fexp2<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @exp2_32x2
2926
#[no_mangle]
3027
pub unsafe fn exp2_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_floor;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_floor<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @floor_32x2
2926
#[no_mangle]
3027
pub unsafe fn floor_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fma;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fma<T>(x: T, b: T, c: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @fma_32x2
2926
#[no_mangle]
3027
pub unsafe fn fma_32x2(a: f32x2, b: f32x2, c: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fsqrt;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fsqrt<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @fsqrt_32x2
2926
#[no_mangle]
3027
pub unsafe fn fsqrt_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_flog;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_flog<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @log_32x2
2926
#[no_mangle]
3027
pub unsafe fn log_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_flog10;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_flog10<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @log10_32x2
2926
#[no_mangle]
3027
pub unsafe fn log10_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_flog2;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_flog2<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @log2_32x2
2926
#[no_mangle]
3027
pub unsafe fn log2_32x2(a: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::{simd_fmax, simd_fmin};
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x4(pub [f32; 4]);
1112

12-
extern "rust-intrinsic" {
13-
fn simd_fmin<T>(x: T, y: T) -> T;
14-
fn simd_fmax<T>(x: T, y: T) -> T;
15-
}
16-
1713
// CHECK-LABEL: @fmin
1814
#[no_mangle]
1915
pub unsafe fn fmin(a: f32x4, b: f32x4) -> f32x4 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics, intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
// use std::intrinsics::simd::simd_fpow; FIXME this intrinsic is not defined
8+
9+
extern "rust-intrinsic" {
10+
fn simd_fpow<T>(x: T, b: T) -> T;
11+
}
12+
813
#[repr(simd)]
914
#[derive(Copy, Clone, PartialEq, Debug)]
1015
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +26,6 @@ pub struct f32x8(pub [f32; 8]);
2126
#[derive(Copy, Clone, PartialEq, Debug)]
2227
pub struct f32x16(pub [f32; 16]);
2328

24-
extern "rust-intrinsic" {
25-
fn simd_fpow<T>(x: T, b: T) -> T;
26-
}
27-
2829
// CHECK-LABEL: @fpow_32x2
2930
#[no_mangle]
3031
pub unsafe fn fpow_32x2(a: f32x2, b: f32x2) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics, intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
// use std::intrinsics::simd::simd_fpowi; FIXME this intrinsic is not defined
8+
9+
extern "rust-intrinsic" {
10+
fn simd_fpowi<T>(x: T, b: i32) -> T;
11+
}
12+
813
#[repr(simd)]
914
#[derive(Copy, Clone, PartialEq, Debug)]
1015
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +26,6 @@ pub struct f32x8(pub [f32; 8]);
2126
#[derive(Copy, Clone, PartialEq, Debug)]
2227
pub struct f32x16(pub [f32; 16]);
2328

24-
extern "rust-intrinsic" {
25-
fn simd_fpowi<T>(x: T, b: i32) -> T;
26-
}
27-
2829
// CHECK-LABEL: @fpowi_32x2
2930
#[no_mangle]
3031
pub unsafe fn fpowi_32x2(a: f32x2, b: i32) -> f32x2 {

tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//@ compile-flags: -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
5-
#![feature(repr_simd, intrinsics)]
4+
#![feature(repr_simd, core_intrinsics)]
65
#![allow(non_camel_case_types)]
76

7+
use std::intrinsics::simd::simd_fsin;
8+
89
#[repr(simd)]
910
#[derive(Copy, Clone, PartialEq, Debug)]
1011
pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
2122
#[derive(Copy, Clone, PartialEq, Debug)]
2223
pub struct f32x16(pub [f32; 16]);
2324

24-
extern "rust-intrinsic" {
25-
fn simd_fsin<T>(x: T) -> T;
26-
}
27-
2825
// CHECK-LABEL: @fsin_32x2
2926
#[no_mangle]
3027
pub unsafe fn fsin_32x2(a: f32x2) -> f32x2 {

0 commit comments

Comments
 (0)