Signed-off-by: Richard Henderson <[email protected]>
---
include/tcg/tcg-op-common.h | 2 --
include/tcg/tcg-op-def2.h.inc | 1 +
tcg/tcg-op.c | 27 +++++++++------------------
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/include/tcg/tcg-op-common.h b/include/tcg/tcg-op-common.h
index de0e535cc10..1b7f9cf473f 100644
--- a/include/tcg/tcg-op-common.h
+++ b/include/tcg/tcg-op-common.h
@@ -166,7 +166,6 @@ void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, MemOp opc);
void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags);
void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg);
void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg);
-void tcg_gen_umax_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_ussub_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_abs_i32(TCGv_i32, TCGv_i32);
void tcg_gen_revbit8_i32(TCGv_i32 ret, TCGv_i32 arg);
@@ -207,7 +206,6 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int
flags);
void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg);
void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg);
void tcg_gen_wswap_i64(TCGv_i64 ret, TCGv_i64 arg);
-void tcg_gen_umax_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_ussub_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_abs_i64(TCGv_i64, TCGv_i64);
void tcg_gen_revbit8_i64(TCGv_i64 ret, TCGv_i64 arg);
diff --git a/include/tcg/tcg-op-def2.h.inc b/include/tcg/tcg-op-def2.h.inc
index fb76cb39ec3..4dfe7513e37 100644
--- a/include/tcg/tcg-op-def2.h.inc
+++ b/include/tcg/tcg-op-def2.h.inc
@@ -55,6 +55,7 @@ DEF_RRR(shr)
DEF_RRR(smax)
DEF_RRR(smin)
DEF_RRR(sub)
+DEF_RRR(umax)
DEF_RRR(umin)
DEF_RRR(xor)
DEF_RRRUU(deposit)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 5afc0cca18d..b2b201c33f4 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -1110,6 +1110,15 @@ static void gen_subfi(TCGType type, TCGTemp *dst,
int64_t src1, TCGTemp *src2)
}
}
+static void gen_umax(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
+{
+ if (tcg_op_supported(INDEX_op_umax, type, 0)) {
+ gen_op_ttt(INDEX_op_umax, type, dst, src1, src2);
+ } else {
+ gen_movcond(type, TCG_COND_GTU, dst, src1, src2, src1, src2);
+ }
+}
+
static void gen_umin(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
if (tcg_op_supported(INDEX_op_umin, type, 0)) {
@@ -1514,15 +1523,6 @@ void tcg_gen_revbit32_i32(TCGv_i32 ret, TCGv_i32 arg)
}
}
-void tcg_gen_umax_i32(TCGv_i32 ret, TCGv_i32 a, TCGv_i32 b)
-{
- if (tcg_op_supported(INDEX_op_umax, TCG_TYPE_I32, 0)) {
- tcg_gen_op3_i32(INDEX_op_umax, ret, a, b);
- } else {
- tcg_gen_movcond_i32(TCG_COND_LTU, ret, a, b, b, a);
- }
-}
-
void tcg_gen_ussub_i32(TCGv_i32 ret, TCGv_i32 a, TCGv_i32 b)
{
TCGv_i32 t = tcg_temp_ebb_new_i32();
@@ -2027,15 +2027,6 @@ void tcg_gen_mulsu2_i64(TCGv_i64 rl, TCGv_i64 rh,
TCGv_i64 arg1, TCGv_i64 arg2)
tcg_temp_free_i64(t2);
}
-void tcg_gen_umax_i64(TCGv_i64 ret, TCGv_i64 a, TCGv_i64 b)
-{
- if (tcg_op_supported(INDEX_op_umax, TCG_TYPE_I64, 0)) {
- tcg_gen_op3_i64(INDEX_op_umax, ret, a, b);
- } else {
- tcg_gen_movcond_i64(TCG_COND_LTU, ret, a, b, b, a);
- }
-}
-
void tcg_gen_ussub_i64(TCGv_i64 ret, TCGv_i64 a, TCGv_i64 b)
{
TCGv_i64 t = tcg_temp_ebb_new_i64();
--
2.53.0