[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/54] tcg: Replace if + tcg_abort with tcg_debug_assert
From: |
Richard Henderson |
Subject: |
[PATCH v2 01/54] tcg: Replace if + tcg_abort with tcg_debug_assert |
Date: |
Mon, 10 Apr 2023 18:04:19 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg.c | 4 +---
tcg/i386/tcg-target.c.inc | 8 +++-----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index bb52bc060b..100f81edb2 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1174,9 +1174,7 @@ static TCGTemp *tcg_global_reg_new_internal(TCGContext
*s, TCGType type,
{
TCGTemp *ts;
- if (TCG_TARGET_REG_BITS == 32 && type != TCG_TYPE_I32) {
- tcg_abort();
- }
+ tcg_debug_assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
ts = tcg_global_alloc(s);
ts->base_type = type;
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 5a151fe64a..dfd41c7bf1 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -1369,8 +1369,8 @@ static void tcg_out_addi(TCGContext *s, int reg,
tcg_target_long val)
}
}
-/* Use SMALL != 0 to force a short forward branch. */
-static void tcg_out_jxx(TCGContext *s, int opc, TCGLabel *l, int small)
+/* Set SMALL to force a short forward branch. */
+static void tcg_out_jxx(TCGContext *s, int opc, TCGLabel *l, bool small)
{
int32_t val, val1;
@@ -1385,9 +1385,7 @@ static void tcg_out_jxx(TCGContext *s, int opc, TCGLabel
*l, int small)
}
tcg_out8(s, val1);
} else {
- if (small) {
- tcg_abort();
- }
+ tcg_debug_assert(!small);
if (opc == -1) {
tcg_out8(s, OPC_JMP_long);
tcg_out32(s, val - 5);
--
2.34.1
- [PATCH v2 00/54] tcg: Simplify calls to load/store helpers, Richard Henderson, 2023/04/10
- [PATCH v2 01/54] tcg: Replace if + tcg_abort with tcg_debug_assert,
Richard Henderson <=
- [PATCH v2 03/54] tcg: Split out tcg_out_ext8s, Richard Henderson, 2023/04/10
- [PATCH v2 02/54] tcg: Replace tcg_abort with g_assert_not_reached, Richard Henderson, 2023/04/10
- [PATCH v2 05/54] tcg: Split out tcg_out_ext16s, Richard Henderson, 2023/04/10
- [PATCH v2 06/54] tcg: Split out tcg_out_ext16u, Richard Henderson, 2023/04/10
- [PATCH v2 04/54] tcg: Split out tcg_out_ext8u, Richard Henderson, 2023/04/10