[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 40/63] tcg/ppc: Split out tcg_out_ext{8,16,32}s
From: |
Richard Henderson |
Subject: |
[PULL 40/63] tcg/ppc: Split out tcg_out_ext{8,16,32}s |
Date: |
Tue, 29 Jun 2021 11:54:32 -0700 |
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>
---
tcg/ppc/tcg-target.c.inc | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 795701442b..aa35ff8250 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]);
--
2.25.1
- [PULL 32/63] tcg: Add tcg_gen_vec_shl{shr}{sar}8i_i32, (continued)
- [PULL 32/63] tcg: Add tcg_gen_vec_shl{shr}{sar}8i_i32, Richard Henderson, 2021/06/29
- [PULL 28/63] target/cris: Do not exit tb for X_FLAG changes, Richard Henderson, 2021/06/29
- [PULL 35/63] tcg: Add flags argument to bswap opcodes, Richard Henderson, 2021/06/29
- [PULL 34/63] tcg: Use correct trap number for page faults on *BSD systems, Richard Henderson, 2021/06/29
- [PULL 16/63] target/cris: Mark exceptions as DISAS_NORETURN, Richard Henderson, 2021/06/29
- [PULL 36/63] tcg/i386: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 38/63] tcg/aarch64: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 39/63] tcg/arm: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 33/63] tcg: Implement tcg_gen_vec_add{sub}32_tl, Richard Henderson, 2021/06/29
- [PULL 37/63] tcg/aarch64: Merge tcg_out_rev{16,32,64}, Richard Henderson, 2021/06/29
- [PULL 40/63] tcg/ppc: Split out tcg_out_ext{8,16,32}s,
Richard Henderson <=
- [PULL 41/63] tcg/ppc: Split out tcg_out_sari{32,64}, Richard Henderson, 2021/06/29
- [PULL 45/63] tcg/ppc: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 42/63] tcg/ppc: Split out tcg_out_bswap16, Richard Henderson, 2021/06/29
- [PULL 43/63] tcg/ppc: Split out tcg_out_bswap32, Richard Henderson, 2021/06/29
- [PULL 44/63] tcg/ppc: Split out tcg_out_bswap64, Richard Henderson, 2021/06/29
- [PULL 48/63] tcg/mips: Support bswap flags in tcg_out_bswap16, Richard Henderson, 2021/06/29
- [PULL 47/63] tcg/s390: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 49/63] tcg/mips: Support bswap flags in tcg_out_bswap32, Richard Henderson, 2021/06/29
- [PULL 46/63] tcg/ppc: Use power10 byte-reverse instructions, Richard Henderson, 2021/06/29
- [PULL 52/63] tcg: Add flags argument to tcg_gen_bswap16_*, tcg_gen_bswap32_i64, Richard Henderson, 2021/06/29