aboutsummaryrefslogtreecommitdiff
path: root/tcg/sparc64
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-04-24 03:11:38 -0500
committerRichard Henderson <richard.henderson@linaro.org>2023-05-16 15:21:39 -0700
commit1a42d9d472b61e4db2fb16800495d402cb9b94af (patch)
treee8460791c9d9d81949153ef7546f1cbc51104863 /tcg/sparc64
parent2cb3f794b6d903f18f84bc0c223ec5c40ffd7064 (diff)
downloadqemu-1a42d9d472b61e4db2fb16800495d402cb9b94af.zip
qemu-1a42d9d472b61e4db2fb16800495d402cb9b94af.tar.gz
qemu-1a42d9d472b61e4db2fb16800495d402cb9b94af.tar.bz2
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>
Diffstat (limited to 'tcg/sparc64')
-rw-r--r--tcg/sparc64/tcg-target.c.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc
index e244209..4375a06 100644
--- a/tcg/sparc64/tcg-target.c.inc
+++ b/tcg/sparc64/tcg-target.c.inc
@@ -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);
}
+/* 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. */
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. */
if (arg == lo) {
- tcg_out_sethi(s, ret, ~arg);
- tcg_out_arithi(s, ret, ret, (arg & 0x3ff) | -0x400, ARITH_XOR);
+ tcg_out_movi_s32(s, ret, arg);
return;
}