From f7ad9c89dd115a0d18105935165dedef5497ffee Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 19 Oct 2013 14:36:32 -0700 Subject: [PATCH] Messing with stvlx. --- src/xenia/cpu/x64/x64_emit_altivec.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/x64/x64_emit_altivec.cc b/src/xenia/cpu/x64/x64_emit_altivec.cc index 1fd07e987..c208cd9a1 100644 --- a/src/xenia/cpu/x64/x64_emit_altivec.cc +++ b/src/xenia/cpu/x64/x64_emit_altivec.cc @@ -389,10 +389,9 @@ static void __emulated_stvlx(uint64_t addr, __m128i vd) { // addr here is the fully translated address. const uint8_t eb = addr & 0xF; const size_t size = 16 - eb; - addr &= ~0xF; uint8_t* p = (uint8_t*)addr; for (size_t i = 0; i < size; i++) { - p[i] = vd.m128i_u8[size - eb - 1 - i]; + p[i] = vd.m128i_u8[size - i]; } } int InstrEmit_stvlx_(X64Emitter& e, X86Compiler& c, InstrData& i, uint32_t vd, uint32_t ra, uint32_t rb) { @@ -436,6 +435,7 @@ static void __emulated_stvrx(uint64_t addr, __m128i vd) { const size_t size = eb; addr &= ~0xF; uint8_t* p = (uint8_t*)addr; + // Note that if the input is already 16b aligned no bytes are stored. for (size_t i = 0; i < size; i++) { p[i + (size - 1 - i)] = vd.m128i_u8[i]; }