[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/39] tcg/tci: Support TCG_COND_TST{EQ,NE}
From: |
Richard Henderson |
Subject: |
[PULL 39/39] tcg/tci: Support TCG_COND_TST{EQ,NE} |
Date: |
Mon, 5 Feb 2024 07:40:52 +1000 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tci/tcg-target.h | 2 +-
tcg/tci.c | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h
index 609b2f4e4a..a076f401d2 100644
--- a/tcg/tci/tcg-target.h
+++ b/tcg/tci/tcg-target.h
@@ -117,7 +117,7 @@
#define TCG_TARGET_HAS_qemu_ldst_i128 0
-#define TCG_TARGET_HAS_tst 0
+#define TCG_TARGET_HAS_tst 1
/* Number of registers available. */
#define TCG_TARGET_NB_REGS 16
diff --git a/tcg/tci.c b/tcg/tci.c
index 3cc851b7bd..39adcb7d82 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -228,6 +228,12 @@ static bool tci_compare32(uint32_t u0, uint32_t u1,
TCGCond condition)
case TCG_COND_GTU:
result = (u0 > u1);
break;
+ case TCG_COND_TSTEQ:
+ result = (u0 & u1) == 0;
+ break;
+ case TCG_COND_TSTNE:
+ result = (u0 & u1) != 0;
+ break;
default:
g_assert_not_reached();
}
@@ -270,6 +276,12 @@ static bool tci_compare64(uint64_t u0, uint64_t u1,
TCGCond condition)
case TCG_COND_GTU:
result = (u0 > u1);
break;
+ case TCG_COND_TSTEQ:
+ result = (u0 & u1) == 0;
+ break;
+ case TCG_COND_TSTNE:
+ result = (u0 & u1) != 0;
+ break;
default:
g_assert_not_reached();
}
@@ -1041,6 +1053,8 @@ static const char *str_c(TCGCond c)
[TCG_COND_GEU] = "geu",
[TCG_COND_LEU] = "leu",
[TCG_COND_GTU] = "gtu",
+ [TCG_COND_TSTEQ] = "tsteq",
+ [TCG_COND_TSTNE] = "tstne",
};
assert((unsigned)c < ARRAY_SIZE(cond));
--
2.34.1
- [PULL 25/39] tcg/i386: Support TCG_COND_TST{EQ,NE}, (continued)
- [PULL 25/39] tcg/i386: Support TCG_COND_TST{EQ,NE}, Richard Henderson, 2024/02/04
- [PULL 28/39] tcg/sparc64: Hoist read of tcg_cond_to_rcond, Richard Henderson, 2024/02/04
- [PULL 29/39] tcg/sparc64: Pass TCGCond to tcg_out_cmp, Richard Henderson, 2024/02/04
- [PULL 32/39] tcg/ppc: Use cr0 in tcg_to_bc and tcg_to_isel, Richard Henderson, 2024/02/04
- [PULL 33/39] tcg/ppc: Tidy up tcg_target_const_match, Richard Henderson, 2024/02/04
- [PULL 34/39] tcg/ppc: Add TCG_CT_CONST_CMP, Richard Henderson, 2024/02/04
- [PULL 35/39] tcg/ppc: Support TCG_COND_TST{EQ,NE}, Richard Henderson, 2024/02/04
- [PULL 36/39] tcg/s390x: Split constraint A into J+U, Richard Henderson, 2024/02/04
- [PULL 37/39] tcg/s390x: Add TCG_CT_CONST_CMP, Richard Henderson, 2024/02/04
- [PULL 38/39] tcg/s390x: Support TCG_COND_TST{EQ,NE}, Richard Henderson, 2024/02/04
- [PULL 39/39] tcg/tci: Support TCG_COND_TST{EQ,NE},
Richard Henderson <=
- Re: [PULL 00/39] tcg patch queue, Peter Maydell, 2024/02/05