mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 13:51:11 +00:00
target/arm: Fix offset for LD1R instructions
The immediate should be scaled by the size of the memory reference, not the size of the elements into which it is loaded. Backports commit d0e372b0298f897993f831dbff7ad4f1c70f138e from qemu
This commit is contained in:
parent
7487c66bee
commit
86d6bb4d43
|
@ -4993,6 +4993,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn)
|
|||
unsigned vsz = vec_full_reg_size(s);
|
||||
unsigned psz = pred_full_reg_size(s);
|
||||
unsigned esz = dtype_esz[a->dtype];
|
||||
unsigned msz = dtype_msz(a->dtype);
|
||||
TCGLabel *over = gen_new_label(tcg_ctx);
|
||||
TCGv_i64 temp;
|
||||
|
||||
|
@ -5016,7 +5017,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn)
|
|||
|
||||
/* Load the data. */
|
||||
temp = tcg_temp_new_i64(tcg_ctx);
|
||||
tcg_gen_addi_i64(tcg_ctx, temp, cpu_reg_sp(s, a->rn), a->imm << esz);
|
||||
tcg_gen_addi_i64(tcg_ctx, temp, cpu_reg_sp(s, a->rn), a->imm << msz);
|
||||
tcg_gen_qemu_ld_i64(s->uc, temp, temp, get_mem_index(s),
|
||||
s->be_data | dtype_mop[a->dtype]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue