Skip to content

Commit 999b963

Browse files
authored
Merge pull request #1923 from usamoi/intrinsic-test-fix
intrinsic-test: test intrinsics with patched `core_arch`
2 parents 9f12c1a + 21e1e41 commit 999b963

File tree

7 files changed

+10303
-1022
lines changed

7 files changed

+10303
-1022
lines changed

crates/core_arch/src/aarch64/neon/generated.rs

Lines changed: 907 additions & 96 deletions
Large diffs are not rendered by default.

crates/core_arch/src/arm_shared/neon/generated.rs

Lines changed: 9379 additions & 904 deletions
Large diffs are not rendered by default.

crates/core_arch/src/wasm32/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn unreachable() -> ! {
4343
#[must_use = "method returns a new number and does not mutate the original value"]
4444
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
4545
pub fn f32_ceil(a: f32) -> f32 {
46-
unsafe { crate::intrinsics::ceilf32(a) }
46+
crate::intrinsics::ceilf32(a)
4747
}
4848

4949
/// Generates the [`f32.floor`] instruction, returning the largest integer less than or equal to `a`.
@@ -57,7 +57,7 @@ pub fn f32_ceil(a: f32) -> f32 {
5757
#[must_use = "method returns a new number and does not mutate the original value"]
5858
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
5959
pub fn f32_floor(a: f32) -> f32 {
60-
unsafe { crate::intrinsics::floorf32(a) }
60+
crate::intrinsics::floorf32(a)
6161
}
6262

6363
/// Generates the [`f32.trunc`] instruction, roundinging to the nearest integer towards zero.
@@ -71,7 +71,7 @@ pub fn f32_floor(a: f32) -> f32 {
7171
#[must_use = "method returns a new number and does not mutate the original value"]
7272
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
7373
pub fn f32_trunc(a: f32) -> f32 {
74-
unsafe { crate::intrinsics::truncf32(a) }
74+
crate::intrinsics::truncf32(a)
7575
}
7676

7777
/// Generates the [`f32.nearest`] instruction, roundinging to the nearest integer. Rounds half-way
@@ -100,7 +100,7 @@ pub fn f32_nearest(a: f32) -> f32 {
100100
#[must_use = "method returns a new number and does not mutate the original value"]
101101
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
102102
pub fn f32_sqrt(a: f32) -> f32 {
103-
unsafe { crate::intrinsics::sqrtf32(a) }
103+
crate::intrinsics::sqrtf32(a)
104104
}
105105

106106
/// Generates the [`f64.ceil`] instruction, returning the smallest integer greater than or equal to `a`.
@@ -114,7 +114,7 @@ pub fn f32_sqrt(a: f32) -> f32 {
114114
#[must_use = "method returns a new number and does not mutate the original value"]
115115
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
116116
pub fn f64_ceil(a: f64) -> f64 {
117-
unsafe { crate::intrinsics::ceilf64(a) }
117+
crate::intrinsics::ceilf64(a)
118118
}
119119

120120
/// Generates the [`f64.floor`] instruction, returning the largest integer less than or equal to `a`.
@@ -128,7 +128,7 @@ pub fn f64_ceil(a: f64) -> f64 {
128128
#[must_use = "method returns a new number and does not mutate the original value"]
129129
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
130130
pub fn f64_floor(a: f64) -> f64 {
131-
unsafe { crate::intrinsics::floorf64(a) }
131+
crate::intrinsics::floorf64(a)
132132
}
133133

134134
/// Generates the [`f64.trunc`] instruction, roundinging to the nearest integer towards zero.
@@ -142,7 +142,7 @@ pub fn f64_floor(a: f64) -> f64 {
142142
#[must_use = "method returns a new number and does not mutate the original value"]
143143
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
144144
pub fn f64_trunc(a: f64) -> f64 {
145-
unsafe { crate::intrinsics::truncf64(a) }
145+
crate::intrinsics::truncf64(a)
146146
}
147147

148148
/// Generates the [`f64.nearest`] instruction, roundinging to the nearest integer. Rounds half-way
@@ -171,7 +171,7 @@ pub fn f64_nearest(a: f64) -> f64 {
171171
#[must_use = "method returns a new number and does not mutate the original value"]
172172
#[unstable(feature = "wasm_numeric_instr", issue = "133908")]
173173
pub fn f64_sqrt(a: f64) -> f64 {
174-
unsafe { crate::intrinsics::sqrtf64(a) }
174+
crate::intrinsics::sqrtf64(a)
175175
}
176176

177177
unsafe extern "C-unwind" {

crates/intrinsic-test/src/arm/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ pub const AARCH_CONFIGURATIONS: &str = r#"
125125
#![feature(stdarch_neon_f16)]
126126
127127
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
128-
use core::arch::aarch64::*;
128+
use core_arch::arch::aarch64::*;
129129
130130
#[cfg(target_arch = "arm")]
131-
use core::arch::arm::*;
131+
use core_arch::arch::arm::*;
132132
"#;

crates/intrinsic-test/src/common/gen_rust.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub fn write_bin_cargo_toml(
3737
write_cargo_toml_header(w, "intrinsic-test-programs")?;
3838

3939
writeln!(w, "[dependencies]")?;
40+
writeln!(w, "core_arch = {{ path = \"../crates/core_arch\" }}")?;
4041

4142
for i in 0..module_count {
4243
writeln!(w, "mod_{i} = {{ path = \"mod_{i}/\" }}")?;

crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,7 @@ intrinsics:
31083108
types:
31093109
- [f16, 'h_']
31103110
compose:
3111-
- FnCall: [roundf16, [a], [], true]
3111+
- FnCall: [roundf16, [a], []]
31123112

31133113
- name: "vrndn{neon_type.no}"
31143114
doc: "Floating-point round to integral, to nearest with ties to even"
@@ -3208,7 +3208,7 @@ intrinsics:
32083208
types:
32093209
- [f16, 'h_']
32103210
compose:
3211-
- FnCall: [floorf16, [a], [], true]
3211+
- FnCall: [floorf16, [a], []]
32123212

32133213

32143214

@@ -3257,7 +3257,7 @@ intrinsics:
32573257
types:
32583258
- [f16, 'h_']
32593259
compose:
3260-
- FnCall: [ceilf16, [a], [], true]
3260+
- FnCall: [ceilf16, [a], []]
32613261

32623262
- name: "vrnd{neon_type.no}"
32633263
doc: "Floating-point round to integral, toward zero"
@@ -3304,7 +3304,7 @@ intrinsics:
33043304
types:
33053305
- [f16, 'h_']
33063306
compose:
3307-
- FnCall: [truncf16, [a], [], true]
3307+
- FnCall: [truncf16, [a], []]
33083308

33093309

33103310
- name: "vrndi{neon_type.no}"
@@ -8499,7 +8499,7 @@ intrinsics:
84998499
types:
85008500
- [f16, 'h_']
85018501
compose:
8502-
- FnCall: [sqrtf16, [a], [], true]
8502+
- FnCall: [sqrtf16, [a], []]
85038503

85048504
- name: "vrsqrts{type[0]}"
85058505
doc: "Floating-point reciprocal square root step"
@@ -8781,7 +8781,6 @@ intrinsics:
87818781
- [float64x1_t, float32x2_t]
87828782
- [float32x4_t, float64x2_t]
87838783
- [float64x2_t, float32x4_t]
8784-
big_endian_inverse: false
87858784
compose:
87868785
- FnCall: [transmute, [a]]
87878786

@@ -8802,7 +8801,6 @@ intrinsics:
88028801
# q
88038802
- [float64x2_t, float16x8_t]
88048803
- [float16x8_t, float64x2_t]
8805-
big_endian_inverse: false
88068804
compose:
88078805
- FnCall: [transmute, [a]]
88088806

@@ -10464,7 +10462,7 @@ intrinsics:
1046410462
types:
1046510463
- ["f16", "h_f16"]
1046610464
compose:
10467-
- FnCall: [fmaf16, [b, c, a], [], true]
10465+
- FnCall: [fmaf16, [b, c, a], []]
1046810466

1046910467

1047010468
- name: "vfmah_lane{type[2]}"

crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8480,7 +8480,6 @@ intrinsics:
84808480
- [poly16x8_t, p128]
84818481
- [int8x16_t, p128]
84828482
- [uint8x16_t, p128]
8483-
big_endian_inverse: false
84848483
compose:
84858484
- FnCall: [transmute, [a]]
84868485

@@ -8718,7 +8717,6 @@ intrinsics:
87188717
- [poly8x16_t, float32x4_t]
87198718
- [poly16x8_t, float32x4_t]
87208719
- [p128, float32x4_t]
8721-
big_endian_inverse: false
87228720
compose:
87238721
- FnCall: [transmute, [a]]
87248722

@@ -8782,7 +8780,6 @@ intrinsics:
87828780
- [float16x8_t, uint16x8_t]
87838781
- [float16x8_t, uint32x4_t]
87848782
- [float16x8_t, uint64x2_t]
8785-
big_endian_inverse: false
87868783
compose:
87878784
- FnCall: [transmute, [a]]
87888785

@@ -8807,7 +8804,6 @@ intrinsics:
88078804
- [poly128_t, float16x8_t]
88088805
- [float16x8_t, poly128_t]
88098806
- [float16x8_t, poly64x2_t]
8810-
big_endian_inverse: false
88118807
compose:
88128808
- FnCall: [transmute, [a]]
88138809

0 commit comments

Comments
 (0)