tcg: Generic expansion of tcg_gen_umin_*

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 f58aa8dd76
commit 2fd3f2a9f2
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_umin_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2);
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);
@@ -187,7 +186,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_umin_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2);
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);
+1
View File
@@ -60,5 +60,6 @@ DEF3(smin, TCGV, TCGV, TCGV)
DEF3(sub, TCGV, TCGV, TCGV)
DEF3(subi, TCGV, TCGV, TINT)
DEF3(subfi, TCGV, TINT, 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_umin(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
if (tcg_op_supported(INDEX_op_umin, type, 0)) {
tcg_gen_op_ttt(INDEX_op_umin, type, dst, src1, src2);
} else {
tcg_gen_movcond(type, TCG_COND_LTU, dst, src1, src2, src1, src2);
}
}
void tcg_gen_xor(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
tcg_gen_op_ttt(INDEX_op_xor, type, dst, src1, src2);
@@ -1347,15 +1356,6 @@ void tcg_gen_revbit32_i32(TCGv_i32 ret, TCGv_i32 arg)
}
}
void tcg_gen_umin_i32(TCGv_i32 ret, TCGv_i32 a, TCGv_i32 b)
{
if (tcg_op_supported(INDEX_op_umin, TCG_TYPE_I32, 0)) {
tcg_gen_op3_i32(INDEX_op_umin, ret, a, b);
} else {
tcg_gen_movcond_i32(TCG_COND_LTU, ret, a, b, a, b);
}
}
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)) {
@@ -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_umin_i64(TCGv_i64 ret, TCGv_i64 a, TCGv_i64 b)
{
if (tcg_op_supported(INDEX_op_umin, TCG_TYPE_I64, 0)) {
tcg_gen_op3_i64(INDEX_op_umin, ret, a, b);
} else {
tcg_gen_movcond_i64(TCG_COND_LTU, ret, a, b, a, b);
}
}
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)) {