aboutsummaryrefslogtreecommitdiff
path: root/tcg/ppc/tcg-target.c.inc
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-06-13 15:52:30 +0000
committerRichard Henderson <richard.henderson@linaro.org>2021-06-29 10:04:57 -0700
commitf4bf14f4018b6fb57bdd9566fce874da691a6369 (patch)
tree0470ff60b8bc008108f7d20e4fe30425233b2142 /tcg/ppc/tcg-target.c.inc
parent2ec89a78a518c4275c6a56ba51b6e1b8ab9e8199 (diff)
downloadqemu-f4bf14f4018b6fb57bdd9566fce874da691a6369.zip
qemu-f4bf14f4018b6fb57bdd9566fce874da691a6369.tar.gz
qemu-f4bf14f4018b6fb57bdd9566fce874da691a6369.tar.bz2
tcg/ppc: Split out tcg_out_ext{8,16,32}s
We will shortly require these in other context; make the expansion as clear as possible. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/ppc/tcg-target.c.inc')
-rw-r--r--tcg/ppc/tcg-target.c.inc31
1 files changed, 21 insertions, 10 deletions
diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 7957014..aa35ff8 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -738,6 +738,21 @@ static inline void tcg_out_rlw(TCGContext *s, int op, TCGReg ra, TCGReg rs,
tcg_out32(s, op | RA(ra) | RS(rs) | SH(sh) | MB(mb) | ME(me));
}
+static inline void tcg_out_ext8s(TCGContext *s, TCGReg dst, TCGReg src)
+{
+ tcg_out32(s, EXTSB | RA(dst) | RS(src));
+}
+
+static inline void tcg_out_ext16s(TCGContext *s, TCGReg dst, TCGReg src)
+{
+ tcg_out32(s, EXTSH | RA(dst) | RS(src));
+}
+
+static inline void tcg_out_ext32s(TCGContext *s, TCGReg dst, TCGReg src)
+{
+ tcg_out32(s, EXTSW | RA(dst) | RS(src));
+}
+
static inline void tcg_out_ext32u(TCGContext *s, TCGReg dst, TCGReg src)
{
tcg_out_rld(s, RLDICL, dst, src, 0, 32);
@@ -2322,7 +2337,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
const int const_args[TCG_MAX_OP_ARGS])
{
TCGArg a0, a1, a2;
- int c;
switch (opc) {
case INDEX_op_exit_tb:
@@ -2390,7 +2404,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_ld8s_i32:
case INDEX_op_ld8s_i64:
tcg_out_mem_long(s, LBZ, LBZX, args[0], args[1], args[2]);
- tcg_out32(s, EXTSB | RS(args[0]) | RA(args[0]));
+ tcg_out_ext8s(s, args[0], args[0]);
break;
case INDEX_op_ld16u_i32:
case INDEX_op_ld16u_i64:
@@ -2728,18 +2742,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_ext8s_i32:
case INDEX_op_ext8s_i64:
- c = EXTSB;
- goto gen_ext;
+ tcg_out_ext8s(s, args[0], args[1]);
+ break;
case INDEX_op_ext16s_i32:
case INDEX_op_ext16s_i64:
- c = EXTSH;
- goto gen_ext;
+ tcg_out_ext16s(s, args[0], args[1]);
+ break;
case INDEX_op_ext_i32_i64:
case INDEX_op_ext32s_i64:
- c = EXTSW;
- goto gen_ext;
- gen_ext:
- tcg_out32(s, c | RS(args[1]) | RA(args[0]));
+ tcg_out_ext32s(s, args[0], args[1]);
break;
case INDEX_op_extu_i32_i64:
tcg_out_ext32u(s, args[0], args[1]);