mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 19:10:57 +00:00
target/arm: Strict alignment for ARMv6-M and ARMv8-M Baseline
Unlike ARMv7-M, ARMv6-M and ARMv8-M Baseline only supports naturally aligned memory accesses for load/store instructions. Backports commit 2aeba0d007d33efa12a6339bb140aa634e0d52eb from qemu
This commit is contained in:
parent
65d0e176c3
commit
f28514178a
|
@ -1137,7 +1137,14 @@ static void gen_aa32_ld_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32,
|
||||||
int index, TCGMemOp opc)
|
int index, TCGMemOp opc)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
TCGv addr = gen_aa32_addr(s, a32, opc);
|
TCGv addr;
|
||||||
|
|
||||||
|
if (arm_dc_feature(s, ARM_FEATURE_M) &&
|
||||||
|
!arm_dc_feature(s, ARM_FEATURE_M_MAIN)) {
|
||||||
|
opc |= MO_ALIGN;
|
||||||
|
}
|
||||||
|
|
||||||
|
addr = gen_aa32_addr(s, a32, opc);
|
||||||
tcg_gen_qemu_ld_i32(s->uc, val, addr, index, opc);
|
tcg_gen_qemu_ld_i32(s->uc, val, addr, index, opc);
|
||||||
tcg_temp_free(tcg_ctx, addr);
|
tcg_temp_free(tcg_ctx, addr);
|
||||||
}
|
}
|
||||||
|
@ -1146,7 +1153,14 @@ static void gen_aa32_st_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32,
|
||||||
int index, TCGMemOp opc)
|
int index, TCGMemOp opc)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
TCGv addr = gen_aa32_addr(s, a32, opc);
|
TCGv addr;
|
||||||
|
|
||||||
|
if (arm_dc_feature(s, ARM_FEATURE_M) &&
|
||||||
|
!arm_dc_feature(s, ARM_FEATURE_M_MAIN)) {
|
||||||
|
opc |= MO_ALIGN;
|
||||||
|
}
|
||||||
|
|
||||||
|
addr = gen_aa32_addr(s, a32, opc);
|
||||||
tcg_gen_qemu_st_i32(s->uc, val, addr, index, opc);
|
tcg_gen_qemu_st_i32(s->uc, val, addr, index, opc);
|
||||||
tcg_temp_free(tcg_ctx, addr);
|
tcg_temp_free(tcg_ctx, addr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue