Skip to content

Commit 75c52f8

Browse files
lu-zeroAmanieu
authored andcommitted
Add vec_loge
1 parent 8f893fe commit 75c52f8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/core_arch/src/powerpc/altivec.rs

+11
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ extern "C" {
321321

322322
#[link_name = "llvm.ppc.altivec.mfvscr"]
323323
fn mfvscr() -> vector_unsigned_short;
324+
325+
#[link_name = "llvm.ppc.altivec.vlogefp"]
326+
fn vlogefp(a: vector_float) -> vector_float;
324327
}
325328

326329
macro_rules! s_t_l {
@@ -2504,6 +2507,14 @@ where
25042507
p.vec_lde(off)
25052508
}
25062509

2510+
/// Vector Base-2 Logarithm Estimate
2511+
#[inline]
2512+
#[target_feature(enable = "altivec")]
2513+
#[cfg_attr(test, assert_instr(vlogefp))]
2514+
pub unsafe fn vec_loge(a: vector_float) -> vector_float {
2515+
vlogefp(a)
2516+
}
2517+
25072518
/// Vector floor.
25082519
#[inline]
25092520
#[target_feature(enable = "altivec")]

0 commit comments

Comments
 (0)