Skip to content

Commit 6b17a2a

Browse files
authored
Merge pull request #2010 from folkertdev/powerpc-vnmsub-llvm-22
powerpc: implement `vnmsubfp` using `intrinsics::simd`
2 parents 5018acc + b7aecd9 commit 6b17a2a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

crates/core_arch/src/powerpc/altivec.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ unsafe extern "C" {
177177
b: vector_signed_short,
178178
c: vector_signed_int,
179179
) -> vector_signed_int;
180-
#[link_name = "llvm.ppc.altivec.vnmsubfp"]
181-
fn vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float;
182180
#[link_name = "llvm.ppc.altivec.vsum2sws"]
183181
fn vsum2sws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
184182
#[link_name = "llvm.ppc.altivec.vsum4ubs"]
@@ -1929,9 +1927,9 @@ mod sealed {
19291927

19301928
#[inline]
19311929
#[target_feature(enable = "altivec")]
1932-
#[cfg_attr(test, assert_instr(vnmsubfp))]
1933-
unsafe fn vec_vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
1934-
vnmsubfp(a, b, c)
1930+
#[cfg_attr(test, assert_instr(xvnmsubasp))]
1931+
pub unsafe fn vec_vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
1932+
simd_neg(simd_fma(a, b, simd_neg(c)))
19351933
}
19361934

19371935
#[inline]
@@ -4329,7 +4327,7 @@ pub unsafe fn vec_madd(a: vector_float, b: vector_float, c: vector_float) -> vec
43294327
#[target_feature(enable = "altivec")]
43304328
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
43314329
pub unsafe fn vec_nmsub(a: vector_float, b: vector_float, c: vector_float) -> vector_float {
4332-
vnmsubfp(a, b, c)
4330+
sealed::vec_vnmsubfp(a, b, c)
43334331
}
43344332

43354333
/// Vector Select

0 commit comments

Comments
 (0)