tcg: Generic expansion of tcg_gen_umax_*

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson committed 2026-10-24 17:14:50 +02:00
1 parent 2fd3f2a9f2
commit 6889e598a3
3 files changed
+10 -20

No files matched your search

-2
View File
@@ -146,7 +146,6 @@ void tcg_gen_mulsu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2);
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);
@@ -186,7 +185,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);
+1
View File
@@ -60,6 +60,7 @@ DEF3(smin, TCGV, TCGV, TCGV)
DEF3(sub, TCGV, TCGV, TCGV)
DEF3(subi, TCGV, TCGV, TINT)
DEF3(subfi, TCGV, TINT, TCGV)
DEF3(umax, TCGV, TCGV, TCGV)
DEF3(umin, TCGV, TCGV, TCGV)
DEF3(xor, TCGV, TCGV, TCGV)
DEF3(xori, TCGV, TCGV, TINT)
+9 -18
View File
@@ -1050,6 +1050,15 @@ void tcg_gen_subfi(TCGType type, TCGTemp *dst, int64_t src1, TCGTemp *src2)
}
}
void tcg_gen_umax(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
if (tcg_op_supported(INDEX_op_umax, type, 0)) {
tcg_gen_op_ttt(INDEX_op_umax, type, dst, src1, src2);
} else {
tcg_gen_movcond(type, TCG_COND_GTU, dst, src1, src2, src1, src2);
}
}
void tcg_gen_umin(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
if (tcg_op_supported(INDEX_op_umin, type, 0)) {
@@ -1356,15 +1365,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();
@@ -1869,15 +1869,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();