Skip to content

Commit

Permalink
target/mips: Enable LBX/LWX/* instructions for Octeon
Browse files Browse the repository at this point in the history
This patch changes condition and function name for enabling
indexed load instructions for Octeon vCPUs. Octeons do not
have DSP extension, but implement LBX-and-others.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <166728058455.229236.13834649461181619195.stgit@pasha-ThinkPad-X280>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
Dovgalyuk authored and philmd committed Nov 8, 2022
1 parent 0e8b301 commit 4525ea7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions target/mips/tcg/translate.c
Expand Up @@ -12173,12 +12173,16 @@ enum {
#include "nanomips_translate.c.inc"

/* MIPSDSP functions. */
static void gen_mipsdsp_ld(DisasContext *ctx, uint32_t opc,
int rd, int base, int offset)

/* Indexed load is not for DSP only */
static void gen_mips_lx(DisasContext *ctx, uint32_t opc,
int rd, int base, int offset)
{
TCGv t0;

check_dsp(ctx);
if (!(ctx->insn_flags & INSN_OCTEON)) {
check_dsp(ctx);
}
t0 = tcg_temp_new();

if (base == 0) {
Expand Down Expand Up @@ -14523,7 +14527,7 @@ static void decode_opc_special3_legacy(CPUMIPSState *env, DisasContext *ctx)
case OPC_LBUX:
case OPC_LHX:
case OPC_LWX:
gen_mipsdsp_ld(ctx, op2, rd, rs, rt);
gen_mips_lx(ctx, op2, rd, rs, rt);
break;
default: /* Invalid */
MIPS_INVAL("MASK LX");
Expand Down

0 comments on commit 4525ea7

Please sign in to comment.