tcg: Generic expansion of tcg_gen_neg_*

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson committed 2026-10-24 17:14:49 +02:00
1 parent c86a4fdc41
commit 3336852097
3 files changed
+6 -13

No files matched your search

-3
View File
@@ -218,7 +218,6 @@ void tcg_gen_shl_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_shr_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_sar_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_mul_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_neg_i32(TCGv_i32 ret, TCGv_i32 arg);
void tcg_gen_not_i32(TCGv_i32 ret, TCGv_i32 arg);
/* 64 bit ops */
@@ -327,8 +326,6 @@ void tcg_gen_shl_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_shr_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_sar_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_mul_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_neg_i64(TCGv_i64 ret, TCGv_i64 arg);
/* Size changing operations. */
+1
View File
@@ -6,5 +6,6 @@ DEF3(addi, TCGV, TCGV, TINT)
DEF1(discard, TCGV)
DEF2(mov, TCGV, TCGV)
DEF2(movi, TCGV, TINT)
DEF2(neg, TCGV, TCGV)
DEF3(sub, TCGV, TCGV, TCGV)
DEF3(subi, TCGV, TCGV, TINT)
+5 -10
View File
@@ -394,6 +394,11 @@ void tcg_gen_movi(TCGType type, TCGTemp *dst, int64_t src)
tcg_gen_op_tt(INDEX_op_mov, type, dst, tcg_constant_internal(type, src));
}
void tcg_gen_neg(TCGType type, TCGTemp *dst, TCGTemp *src)
{
tcg_gen_op_tt(INDEX_op_neg, type, dst, src);
}
void tcg_gen_sub(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
tcg_gen_op_ttt(INDEX_op_sub, type, dst, src1, src2);
@@ -415,11 +420,6 @@ void tcg_gen_subfi_i32(TCGv_i32 ret, int32_t arg1, TCGv_i32 arg2)
}
}
void tcg_gen_neg_i32(TCGv_i32 ret, TCGv_i32 arg)
{
tcg_gen_op2_i32(INDEX_op_neg, ret, arg);
}
void tcg_gen_and_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
{
tcg_gen_op3_i32(INDEX_op_and, ret, arg1, arg2);
@@ -1537,11 +1537,6 @@ void tcg_gen_subfi_i64(TCGv_i64 ret, int64_t arg1, TCGv_i64 arg2)
}
}
void tcg_gen_neg_i64(TCGv_i64 ret, TCGv_i64 arg)
{
tcg_gen_op2_i64(INDEX_op_neg, ret, arg);
}
void tcg_gen_andi_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2)
{
/* Some cases can be optimized here. */