mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-03-14 14:56:05 -06:00
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: Dongxue Zhang <elta.era@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
fe65a1fad6
commit
c4aaba92e5
1 changed files with 2 additions and 1 deletions
|
|
@ -13769,9 +13769,10 @@ static void gen_mipsdsp_bitinsn(CPUMIPSState *env, DisasContext *ctx,
|
|||
check_dsp(ctx);
|
||||
{
|
||||
imm = (ctx->opcode >> 16) & 0x03FF;
|
||||
imm = (int16_t)(imm << 6) >> 6;
|
||||
tcg_gen_movi_tl(cpu_gpr[ret], \
|
||||
(target_long)((int32_t)imm << 16 | \
|
||||
(uint32_t)(uint16_t)imm));
|
||||
(uint16_t)imm));
|
||||
}
|
||||
break;
|
||||
case OPC_REPLV_PH:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue