[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] target/mips: Fix handling of unaligned memory access for nan
From: |
Stefan Pejic |
Subject: |
[PATCH 5/7] target/mips: Fix handling of unaligned memory access for nanoMips ISA |
Date: |
Wed, 4 May 2022 13:04:01 +0200 |
From: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
nanoMips ISA does not support unaligned memory access. Adjust
DisasContext's default_tcg_memop_mask to reflect this.
Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Stefan Pejic <stefan.pejic@syrmia.com>
---
target/mips/tcg/translate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 6de5b66650..5f460fb687 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -16023,8 +16023,9 @@ static void mips_tr_init_disas_context(DisasContextBase
*dcbase, CPUState *cs)
#else
ctx->mem_idx = hflags_mmu_index(ctx->hflags);
#endif
- ctx->default_tcg_memop_mask = (ctx->insn_flags & (ISA_MIPS_R6 |
- INSN_LOONGSON3A)) ? MO_UNALN : MO_ALIGN;
+ ctx->default_tcg_memop_mask = (!(ctx->insn_flags & ISA_NANOMIPS32) &&
+ (ctx->insn_flags & (ISA_MIPS_R6 |
+ INSN_LOONGSON3A))) ? MO_UNALN : MO_ALIGN;
/*
* Execute a branch and its delay slot as a single instruction.
--
2.25.1
- [PATCH 0/7] Undeprecate nanoMIPS and fix multiple bugs, Stefan Pejic, 2022/05/04
- [PATCH 4/7] target/mips: Fix emulation of nanoMips BNEC[32] instruction, Stefan Pejic, 2022/05/04
- [PATCH 5/7] target/mips: Fix handling of unaligned memory access for nanoMips ISA,
Stefan Pejic <=
- [PATCH 1/7] target/mips: Fix emulation of nanoMips MTHLIP instruction, Stefan Pejic, 2022/05/04
- [PATCH 3/7] target/mips: Fix emulation of nanoMips BPOSGE32C instruction, Stefan Pejic, 2022/05/04
- [PATCH 2/7] target/mips: Fix emulation of nanoMips EXTRV_S.H instruction, Stefan Pejic, 2022/05/04
- [PATCH 6/7] target/mips: Add missing default cases for some nanoMips pools, Stefan Pejic, 2022/05/04
- [PATCH 7/7] target/mips: Undeprecate nanoMips ISA support in QEMU, Stefan Pejic, 2022/05/04