mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-17 23:22:12 -06:00
tcg/sparc64: Split out tcg_out_movi_s32
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2cb3f794b6
commit
1a42d9d472
1 changed files with 8 additions and 2 deletions
|
@ -405,6 +405,13 @@ static void tcg_out_movi_s13(TCGContext *s, TCGReg ret, int32_t arg)
|
||||||
tcg_out_arithi(s, ret, TCG_REG_G0, arg, ARITH_OR);
|
tcg_out_arithi(s, ret, TCG_REG_G0, arg, ARITH_OR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A 32-bit constant sign-extended to 64 bits. */
|
||||||
|
static void tcg_out_movi_s32(TCGContext *s, TCGReg ret, int32_t arg)
|
||||||
|
{
|
||||||
|
tcg_out_sethi(s, ret, ~arg);
|
||||||
|
tcg_out_arithi(s, ret, ret, (arg & 0x3ff) | -0x400, ARITH_XOR);
|
||||||
|
}
|
||||||
|
|
||||||
/* A 32-bit constant zero-extended to 64 bits. */
|
/* A 32-bit constant zero-extended to 64 bits. */
|
||||||
static void tcg_out_movi_u32(TCGContext *s, TCGReg ret, uint32_t arg)
|
static void tcg_out_movi_u32(TCGContext *s, TCGReg ret, uint32_t arg)
|
||||||
{
|
{
|
||||||
|
@ -444,8 +451,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret,
|
||||||
|
|
||||||
/* A 32-bit constant sign-extended to 64-bits. */
|
/* A 32-bit constant sign-extended to 64-bits. */
|
||||||
if (arg == lo) {
|
if (arg == lo) {
|
||||||
tcg_out_sethi(s, ret, ~arg);
|
tcg_out_movi_s32(s, ret, arg);
|
||||||
tcg_out_arithi(s, ret, ret, (arg & 0x3ff) | -0x400, ARITH_XOR);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue