hv_vm: Implement scalar LDNP instructions

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2023-10-04 16:39:28 +09:00 committed by Hector Martin
parent c3820a5016
commit 250f96bb15

View file

@ -571,16 +571,16 @@ static bool emulate_load(struct exc_info *ctx, u32 insn, u64 *val, u64 *width, u
regs[Rt] = (s64)EXT(*val, (8 << *width)); regs[Rt] = (s64)EXT(*val, (8 << *width));
if (insn & (1 << 22)) if (insn & (1 << 22))
regs[Rt] &= 0xffffffff; regs[Rt] &= 0xffffffff;
} else if ((insn & 0xffc00000) == 0x29400000) { } else if ((insn & 0xfec00000) == 0x28400000) {
// LDP (Signed offset, 32-bit) // LD[N]P (Signed offset, 32-bit)
*width = 3; *width = 3;
*vaddr = regs[Rn] + (imm7 * 4); *vaddr = regs[Rn] + (imm7 * 4);
DECODE_OK; DECODE_OK;
u64 Rt2 = (insn >> 10) & 0x1f; u64 Rt2 = (insn >> 10) & 0x1f;
regs[Rt] = val[0] & 0xffffffff; regs[Rt] = val[0] & 0xffffffff;
regs[Rt2] = val[0] >> 32; regs[Rt2] = val[0] >> 32;
} else if ((insn & 0xffc00000) == 0xa9400000) { } else if ((insn & 0xfec00000) == 0xa8400000) {
// LDP (Signed offset, 64-bit) // LD[N]P (Signed offset, 64-bit)
*width = 4; *width = 4;
*vaddr = regs[Rn] + (imm7 * 8); *vaddr = regs[Rn] + (imm7 * 8);
DECODE_OK; DECODE_OK;