Signed-off-by: Richard Henderson <[email protected]>
---
include/tcg/tcg-op-common.h | 9 +++--
include/tcg/tcg-op-def2.h.inc | 1 +
tcg/tcg-op.c | 71 +++++++++++++++--------------------
3 files changed, 37 insertions(+), 44 deletions(-)
diff --git a/include/tcg/tcg-op-common.h b/include/tcg/tcg-op-common.h
index 4223229c78b..04fe772c1e0 100644
--- a/include/tcg/tcg-op-common.h
+++ b/include/tcg/tcg-op-common.h
@@ -122,6 +122,10 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned
meminfo);
#define DEF_CRRI(NAME) \
void glue(glue(tcg_gen_,NAME),TEXT)(TCGCond a, TCGV b, TCGV c, TINT d);
+#define DEF_CRRRRR(NAME) \
+ void glue(glue(tcg_gen_,NAME),TEXT)(TCGCond a, TCGV b, TCGV c, \
+ TCGV d, TCGV e, TCGV f);
+
#include "tcg-op-def.h.inc"
#undef DEF_R
@@ -134,6 +138,7 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo);
#undef DEF_CRIL
#undef DEF_CRRR
#undef DEF_CRRI
+#undef DEF_CRRRRR
/* 32 bit ops */
@@ -157,8 +162,6 @@ void tcg_gen_sextract_i32(TCGv_i32 ret, TCGv_i32 arg,
unsigned int ofs, unsigned int len);
void tcg_gen_extract2_i32(TCGv_i32 ret, TCGv_i32 al, TCGv_i32 ah,
unsigned int ofs);
-void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 c1,
- TCGv_i32 c2, TCGv_i32 v1, TCGv_i32 v2);
void tcg_gen_add2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al,
TCGv_i32 ah, TCGv_i32 bl, TCGv_i32 bh);
void tcg_gen_sub2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al,
@@ -220,8 +223,6 @@ void tcg_gen_sextract_i64(TCGv_i64 ret, TCGv_i64 arg,
unsigned int ofs, unsigned int len);
void tcg_gen_extract2_i64(TCGv_i64 ret, TCGv_i64 al, TCGv_i64 ah,
unsigned int ofs);
-void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 c1,
- TCGv_i64 c2, TCGv_i64 v1, TCGv_i64 v2);
void tcg_gen_add2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al,
TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh);
void tcg_gen_sub2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al,
diff --git a/include/tcg/tcg-op-def2.h.inc b/include/tcg/tcg-op-def2.h.inc
index bc27e1b2af6..cbaaba72ffa 100644
--- a/include/tcg/tcg-op-def2.h.inc
+++ b/include/tcg/tcg-op-def2.h.inc
@@ -6,6 +6,7 @@ DEF_CRRI(setcondi)
DEF_CRRL(brcond)
DEF_CRRR(negsetcond)
DEF_CRRR(setcond)
+DEF_CRRRRR(movcond)
DEF_R(discard)
DEF_RI(movi)
DEF_RIR(subfi)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 14139fa5784..6145a171665 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -135,6 +135,14 @@ static TCGOp *gen_op_ttttt(TCGOpcode opc, TCGType type,
temp_arg(t3), temp_arg(t4));
}
+static TCGOp *gen_op_ttttti(TCGOpcode opc, TCGType type,
+ TCGTemp *t0, TCGTemp *t1, TCGTemp *t2,
+ TCGTemp *t3, TCGTemp *t4, TCGArg a5)
+{
+ return tcg_gen_op6(opc, type, temp_arg(t0), temp_arg(t1), temp_arg(t2),
+ temp_arg(t3), temp_arg(t4), a5);
+}
+
/*
* With CONFIG_DEBUG_TCG, tcgv_*_tmp via tcgv_*_arg, is an out-of-line
* assertion check. Force tail calls to avoid too much code expansion.
@@ -256,22 +264,6 @@ static void DNI tcg_gen_op5ii_i64(TCGOpcode opc, TCGv_i64
a1, TCGv_i64 a2,
tcgv_i64_arg(a3), a4, a5);
}
-static void DNI tcg_gen_op6i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2,
- TCGv_i32 a3, TCGv_i32 a4,
- TCGv_i32 a5, TCGArg a6)
-{
- tcg_gen_op6(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2),
- tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5), a6);
-}
-
-static void DNI tcg_gen_op6i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2,
- TCGv_i64 a3, TCGv_i64 a4,
- TCGv_i64 a5, TCGArg a6)
-{
- tcg_gen_op6(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2),
- tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5), a6);
-}
-
/* Generic ops. */
void gen_set_label(TCGLabel *l)
@@ -356,6 +348,10 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo)
#define DEF_CRRI(NAME) \
static void glue(gen_,NAME)(TCGType, TCGCond, TCGTemp *, TCGTemp *,
int64_t);
+#define DEF_CRRRRR(NAME) \
+ static void glue(gen_,NAME)(TCGType, TCGCond, TCGTemp *, TCGTemp *, \
+ TCGTemp *, TCGTemp *, TCGTemp *);
+
#include "tcg/tcg-op-def2.h.inc"
#undef DEF_R
@@ -368,6 +364,7 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo)
#undef DEF_CRIL
#undef DEF_CRRR
#undef DEF_CRRI
+#undef DEF_CRRRRR
/*
* Generic expansions for templated operations.
@@ -507,6 +504,18 @@ static void gen_movi(TCGType type, TCGTemp *dst, int64_t
src)
gen_op_tt(INDEX_op_mov, type, dst, tcg_constant_internal(type, src));
}
+static void gen_movcond(TCGType type, TCGCond cond, TCGTemp *dst,
+ TCGTemp *c1, TCGTemp *c2, TCGTemp *v1, TCGTemp *v2)
+{
+ if (cond == TCG_COND_ALWAYS) {
+ gen_mov(type, dst, v1);
+ } else if (cond == TCG_COND_NEVER) {
+ gen_mov(type, dst, v2);
+ } else {
+ gen_op_ttttti(INDEX_op_movcond, type, dst, c1, c2, v1, v2, cond);
+ }
+}
+
static void gen_mul(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
gen_op_ttt(INDEX_op_mul, type, dst, src1, src2);
@@ -793,6 +802,11 @@ static void gen_xori(TCGType type, TCGTemp *dst, TCGTemp
*src1, int64_t src2)
void glue(glue(tcg_gen_,NAME),TEXT)(TCGCond a, TCGV b, TCGV c, TINT d) \
{ gen_##NAME(TYPE, a, TTMP(b), TTMP(c), d); }
+#define DEF_CRRRRR(NAME) \
+ void glue(glue(tcg_gen_,NAME),TEXT)(TCGCond a, TCGV b, TCGV c, \
+ TCGV d, TCGV e, TCGV f) \
+ { gen_##NAME(TYPE, a, TTMP(b), TTMP(c), TTMP(d), TTMP(e), TTMP(f)); }
+
#include "tcg/tcg-op-def.h.inc"
#undef DEF_R
@@ -805,6 +819,7 @@ static void gen_xori(TCGType type, TCGTemp *dst, TCGTemp
*src1, int64_t src2)
#undef DEF_CRIL
#undef DEF_CRRR
#undef DEF_CRRI
+#undef DEF_CRRRRR
/* 32 bit ops */
@@ -1117,18 +1132,6 @@ void tcg_gen_extract2_i32(TCGv_i32 ret, TCGv_i32 al,
TCGv_i32 ah,
}
}
-void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 c1,
- TCGv_i32 c2, TCGv_i32 v1, TCGv_i32 v2)
-{
- if (cond == TCG_COND_ALWAYS) {
- tcg_gen_mov_i32(ret, v1);
- } else if (cond == TCG_COND_NEVER) {
- tcg_gen_mov_i32(ret, v2);
- } else {
- tcg_gen_op6i_i32(INDEX_op_movcond, ret, c1, c2, v1, v2, cond);
- }
-}
-
void tcg_gen_add2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al,
TCGv_i32 ah, TCGv_i32 bl, TCGv_i32 bh)
{
@@ -2042,18 +2045,6 @@ void tcg_gen_extract2_i64(TCGv_i64 ret, TCGv_i64 al,
TCGv_i64 ah,
}
}
-void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 c1,
- TCGv_i64 c2, TCGv_i64 v1, TCGv_i64 v2)
-{
- if (cond == TCG_COND_ALWAYS) {
- tcg_gen_mov_i64(ret, v1);
- } else if (cond == TCG_COND_NEVER) {
- tcg_gen_mov_i64(ret, v2);
- } else {
- tcg_gen_op6i_i64(INDEX_op_movcond, ret, c1, c2, v1, v2, cond);
- }
-}
-
void tcg_gen_add2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al,
TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh)
{
--
2.53.0