Messing with stvlx.

This commit is contained in:
Ben Vanik 2013-10-19 14:36:32 -07:00
parent 91e6c4ed9a
commit f7ad9c89dd
1 changed files with 2 additions and 2 deletions

View File

@ -389,10 +389,9 @@ static void __emulated_stvlx(uint64_t addr, __m128i vd) {
// addr here is the fully translated address. // addr here is the fully translated address.
const uint8_t eb = addr & 0xF; const uint8_t eb = addr & 0xF;
const size_t size = 16 - eb; const size_t size = 16 - eb;
addr &= ~0xF;
uint8_t* p = (uint8_t*)addr; uint8_t* p = (uint8_t*)addr;
for (size_t i = 0; i < size; i++) { 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) { 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; const size_t size = eb;
addr &= ~0xF; addr &= ~0xF;
uint8_t* p = (uint8_t*)addr; 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++) { for (size_t i = 0; i < size; i++) {
p[i + (size - 1 - i)] = vd.m128i_u8[i]; p[i + (size - 1 - i)] = vd.m128i_u8[i];
} }