diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-05-19 21:13:32 +0200 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-05-20 14:26:46 +0000 |
| commit | 42e6ad3ee80f04b7ecde49ee3f1c9669f671bf8f (patch) | |
| tree | 814395a9724a185ef75467c4823bc4996bf8de1f | |
| parent | a850e8738a5232eb5614dd0db51c892d17bbdf97 (diff) | |
| download | rust-42e6ad3ee80f04b7ecde49ee3f1c9669f671bf8f.tar.gz rust-42e6ad3ee80f04b7ecde49ee3f1c9669f671bf8f.zip | |
use the right load instruction
| -rw-r--r-- | library/stdarch/crates/core_arch/src/powerpc/altivec.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/stdarch/crates/core_arch/src/powerpc/altivec.rs b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs index 3cb3f098bba..3243b98a6d4 100644 --- a/library/stdarch/crates/core_arch/src/powerpc/altivec.rs +++ b/library/stdarch/crates/core_arch/src/powerpc/altivec.rs @@ -547,7 +547,7 @@ mod sealed { #[target_feature(enable = "altivec")] #[cfg_attr(test, assert_instr($instr))] pub unsafe fn $fun(a: isize, b: *const $ty) -> t_t_l!($ty) { - let addr = (b as *const i8).offset(a); + let addr = b.byte_offset(a).cast::<i8>(); transmute($instr(addr)) } @@ -4785,7 +4785,7 @@ mod tests { unsafe fn test_vec_lde_u16() { let pat = [u16x8::new(0, 1, 2, 3, 4, 5, 6, 7)]; for off in 0..8 { - let v: u16x8 = transmute(vec_lde(off * 2, pat.as_ptr() as *const u8)); + let v: u16x8 = transmute(vec_lde(off * 2, pat.as_ptr() as *const u16)); assert_eq!(off as u16, v.extract(off as _)); } } @@ -4794,7 +4794,7 @@ mod tests { unsafe fn test_vec_lde_u32() { let pat = [u32x4::new(0, 1, 2, 3)]; for off in 0..4 { - let v: u32x4 = transmute(vec_lde(off * 4, pat.as_ptr() as *const u8)); + let v: u32x4 = transmute(vec_lde(off * 4, pat.as_ptr() as *const u32)); assert_eq!(off as u32, v.extract(off as _)); } } |
