提交 c4aaba92 编写于 作者: J Jovanovic, Petar 提交者: Aurelien Jarno

target-mips: Make repl_ph to sign extend to target-long

The immediate value is 9bits, should sign-extend to 16bits. The return value to
register should sign-extend to target_long, as Richard says, removing an
unnecessary cast works fun.
Signed-off-by: NDongxue Zhang <elta.era@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 fe65a1fa
...@@ -13769,9 +13769,10 @@ static void gen_mipsdsp_bitinsn(CPUMIPSState *env, DisasContext *ctx, ...@@ -13769,9 +13769,10 @@ static void gen_mipsdsp_bitinsn(CPUMIPSState *env, DisasContext *ctx,
check_dsp(ctx); check_dsp(ctx);
{ {
imm = (ctx->opcode >> 16) & 0x03FF; imm = (ctx->opcode >> 16) & 0x03FF;
imm = (int16_t)(imm << 6) >> 6;
tcg_gen_movi_tl(cpu_gpr[ret], \ tcg_gen_movi_tl(cpu_gpr[ret], \
(target_long)((int32_t)imm << 16 | \ (target_long)((int32_t)imm << 16 | \
(uint32_t)(uint16_t)imm)); (uint16_t)imm));
} }
break; break;
case OPC_REPLV_PH: case OPC_REPLV_PH:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册