From d834f538b470412e818816277c5101e2f4a1a787 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 25 Jun 2023 07:24:38 +0000 Subject: [PATCH] Add vec_loge --- .../stdarch/crates/core_arch/src/powerpc/altivec.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/stdarch/crates/core_arch/src/powerpc/altivec.rs b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs index 846e57a75206..aaf8baf414e5 100644 --- a/library/stdarch/crates/core_arch/src/powerpc/altivec.rs +++ b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs @@ -321,6 +321,9 @@ extern "C" { #[link_name = "llvm.ppc.altivec.mfvscr"] fn mfvscr() -> vector_unsigned_short; + + #[link_name = "llvm.ppc.altivec.vlogefp"] + fn vlogefp(a: vector_float) -> vector_float; } macro_rules! s_t_l { @@ -2504,6 +2507,14 @@ where p.vec_lde(off) } +/// Vector Base-2 Logarithm Estimate +#[inline] +#[target_feature(enable = "altivec")] +#[cfg_attr(test, assert_instr(vlogefp))] +pub unsafe fn vec_loge(a: vector_float) -> vector_float { + vlogefp(a) +} + /// Vector floor. #[inline] #[target_feature(enable = "altivec")]