Use llvm.ppc.altivec.lvx intrinsic for vec_ld

The `vec_ld` intrinsic is expected to automatically round the given
address down to a 16-byte boundary.
This commit is contained in:
Amanieu d'Antras 2022-08-20 19:56:16 +01:00
parent 8119ecd492
commit 53d56091c6

View file

@ -51,6 +51,8 @@ types! {
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.ppc.altivec.lvx"]
fn lvx(p: *const i8) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vperm"]
fn vperm(
a: vector_signed_int,
@ -442,8 +444,7 @@ mod sealed {
#[inline(always)]
unsafe fn load(off: i32, p: *const i8) -> u32x4 {
let addr = p.offset(off as isize);
*(addr as *const u32x4)
transmute(lvx(addr))
}
pub trait VectorLd {