new_dynarec: fix invalid CPU instruction generation in emit_writeword()

This commit is contained in:
Rosalie Wanders 2024-05-08 20:13:20 +02:00
parent 3407229ddc
commit da3b9bfbdd
3 changed files with 3 additions and 0 deletions

View file

@ -2040,6 +2040,7 @@ static void emit_writebyte_indexed_tlb(int rt, int addr, int rs, int map)
}
static void emit_writeword(int rt, int addr)
{
if(rt<0) return;
u_int offset = addr-(u_int)&g_dev.r4300.new_dynarec_hot_state;
assert(offset<4096);
assem_debug("str %s,fp+%d",regname[rt],offset);

View file

@ -2393,6 +2393,7 @@ static void emit_writebyte_indexed_tlb(int rt, int addr, int rs, int map)
static void emit_writeword(int rt, intptr_t addr)
{
if(rt<0) return;
intptr_t offset = addr-(intptr_t)&g_dev.r4300.new_dynarec_hot_state;
assert(offset<16380LL);
assert(offset%4 == 0); /* 4 bytes aligned */

View file

@ -2309,6 +2309,7 @@ static void emit_xchg64(int rs, int rt)
}
static void emit_writeword(int rt, intptr_t addr)
{
if(rt<0) return;
assert((intptr_t)addr-(intptr_t)out>=-2147483648LL&&(intptr_t)addr-(intptr_t)out<2147483647LL);
assem_debug("movl %%%s,%llx",regname[rt],addr);
output_byte(0x89);