Skip to content

Commit eb1b14b

Browse files
folkertdevAmanieu
authored andcommitted
nvptx: use simd_fmin and simd_fmax for minnum and maxnum
1 parent 7690a98 commit eb1b14b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

crates/core_arch/src/nvptx/packed.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ use crate::intrinsics::simd::*;
88

99
#[allow(improper_ctypes)]
1010
unsafe extern "C" {
11-
#[link_name = "llvm.minnum.v2f16"]
12-
fn llvm_f16x2_minnum(a: f16x2, b: f16x2) -> f16x2;
1311
#[link_name = "llvm.minimum.v2f16"]
1412
fn llvm_f16x2_minimum(a: f16x2, b: f16x2) -> f16x2;
15-
#[link_name = "llvm.maxnum.v2f16"]
16-
fn llvm_f16x2_maxnum(a: f16x2, b: f16x2) -> f16x2;
1713
#[link_name = "llvm.maximum.v2f16"]
1814
fn llvm_f16x2_maximum(a: f16x2, b: f16x2) -> f16x2;
1915
}
@@ -103,7 +99,7 @@ pub unsafe fn f16x2_neg(a: f16x2) -> f16x2 {
10399
#[cfg_attr(test, assert_instr(min.f16x2))]
104100
#[unstable(feature = "stdarch_nvptx", issue = "111199")]
105101
pub unsafe fn f16x2_min(a: f16x2, b: f16x2) -> f16x2 {
106-
llvm_f16x2_minnum(a, b)
102+
simd_fmin(a, b)
107103
}
108104

109105
/// Find the minimum of two values, NaNs pass through.
@@ -127,7 +123,7 @@ pub unsafe fn f16x2_min_nan(a: f16x2, b: f16x2) -> f16x2 {
127123
#[cfg_attr(test, assert_instr(max.f16x2))]
128124
#[unstable(feature = "stdarch_nvptx", issue = "111199")]
129125
pub unsafe fn f16x2_max(a: f16x2, b: f16x2) -> f16x2 {
130-
llvm_f16x2_maxnum(a, b)
126+
simd_fmax(a, b)
131127
}
132128

133129
/// Find the maximum of two values, NaNs pass through.

0 commit comments

Comments
 (0)