arm32: support 64b immediate mem writes

This commit is contained in:
Flyinghead 2019-09-30 16:53:08 +02:00
parent bad10bae20
commit dde8bf3b42
1 changed files with 8 additions and 3 deletions

View File

@ -1075,7 +1075,7 @@ bool ngen_readm_immediate(RuntimeBlockInfo* block, shil_opcode* op, bool staging
mem_op_type optp = memop_type(op);
bool isram = false;
void* ptr = _vmem_read_const(op->rs1._imm, isram, memop_bytes(optp));
void* ptr = _vmem_read_const(op->rs1._imm, isram, max(4u, memop_bytes(optp)));
eReg rd = (optp != SZ_32F && optp != SZ_64F) ? reg.mapg(op->rd) : r0;
if (isram)
@ -1147,7 +1147,7 @@ bool ngen_writemem_immediate(RuntimeBlockInfo* block, shil_opcode* op, bool stag
mem_op_type optp = memop_type(op);
bool isram = false;
void* ptr = _vmem_write_const(op->rs1._imm, isram, memop_bytes(optp));
void* ptr = _vmem_write_const(op->rs1._imm, isram, max(4u, memop_bytes(optp)));
eReg rs2 = r1;
eFSReg rs2f = f0;
@ -1155,7 +1155,7 @@ bool ngen_writemem_immediate(RuntimeBlockInfo* block, shil_opcode* op, bool stag
MOV32(rs2, op->rs2._imm);
else if (optp == SZ_32F)
rs2f = reg.mapf(op->rs2);
else
else if (optp != SZ_64F)
rs2 = reg.mapg(op->rs2);
if (isram)
@ -1179,6 +1179,11 @@ bool ngen_writemem_immediate(RuntimeBlockInfo* block, shil_opcode* op, bool stag
VSTR(rs2f, r0, 0);
break;
case SZ_64F:
VLDR(d0, r8, op->rs2.reg_nofs() / 4);
VSTR(d0, r0, 0);
break;
default:
die("Invalid size");
break;