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:
parent
8119ecd492
commit
53d56091c6
1 changed files with 3 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue