target/mips: Add unaligned access support for MIPS64R6 and Loongson-3

MIPSR6 (not only MIPS32R6) processors support unaligned access in
hardware, so set MO_UNALN in their default_tcg_memop_mask. Btw, new
Loongson-3 (such as Loongson-3A4000) also support unaligned access,
since both old and new Loongson-3 use the same binaries, we can simply
set MO_UNALN for all Loongson-3 processors.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1604053541-27822-3-git-send-email-chenhc@lemote.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Huacai Chen 2020-10-28 12:18:00 +08:00 committed by Philippe Mathieu-Daudé
parent 89975214e6
commit 8a805609d1
1 changed files with 2 additions and 2 deletions

View File

@ -31442,8 +31442,8 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
#else #else
ctx->mem_idx = hflags_mmu_index(ctx->hflags); ctx->mem_idx = hflags_mmu_index(ctx->hflags);
#endif #endif
ctx->default_tcg_memop_mask = (ctx->insn_flags & ISA_MIPS32R6) ? ctx->default_tcg_memop_mask = (ctx->insn_flags & (ISA_MIPS32R6 | ISA_MIPS64R6 |
MO_UNALN : MO_ALIGN; INSN_LOONGSON3A)) ? MO_UNALN : MO_ALIGN;
LOG_DISAS("\ntb %p idx %d hflags %04x\n", ctx->base.tb, ctx->mem_idx, LOG_DISAS("\ntb %p idx %d hflags %04x\n", ctx->base.tb, ctx->mem_idx,
ctx->hflags); ctx->hflags);