[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/68] target/arm: Use tcg_op_supported
From: |
Richard Henderson |
Subject: |
[PULL 09/68] target/arm: Use tcg_op_supported |
Date: |
Fri, 17 Jan 2025 10:23:57 -0800 |
Do not reference TCG_TARGET_HAS_* directly.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/translate-a64.c | 10 ++++++----
target/arm/tcg/translate-sve.c | 2 +-
target/arm/tcg/translate.c | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 7c65fc3a3b..bd814849c1 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -8219,6 +8219,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a)
TCGv_i64 tcg_rn, tcg_y;
DisasCompare c;
unsigned nzcv;
+ bool has_andc;
/* Set T0 = !COND. */
arm_test_cc(&c, a->cond);
@@ -8249,17 +8250,18 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a)
tcg_gen_subi_i32(tcg_t2, tcg_t0, 1);
nzcv = a->nzcv;
+ has_andc = tcg_op_supported(INDEX_op_andc_i32, TCG_TYPE_I32, 0);
if (nzcv & 8) { /* N */
tcg_gen_or_i32(cpu_NF, cpu_NF, tcg_t1);
} else {
- if (TCG_TARGET_HAS_andc_i32) {
+ if (has_andc) {
tcg_gen_andc_i32(cpu_NF, cpu_NF, tcg_t1);
} else {
tcg_gen_and_i32(cpu_NF, cpu_NF, tcg_t2);
}
}
if (nzcv & 4) { /* Z */
- if (TCG_TARGET_HAS_andc_i32) {
+ if (has_andc) {
tcg_gen_andc_i32(cpu_ZF, cpu_ZF, tcg_t1);
} else {
tcg_gen_and_i32(cpu_ZF, cpu_ZF, tcg_t2);
@@ -8270,7 +8272,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a)
if (nzcv & 2) { /* C */
tcg_gen_or_i32(cpu_CF, cpu_CF, tcg_t0);
} else {
- if (TCG_TARGET_HAS_andc_i32) {
+ if (has_andc) {
tcg_gen_andc_i32(cpu_CF, cpu_CF, tcg_t1);
} else {
tcg_gen_and_i32(cpu_CF, cpu_CF, tcg_t2);
@@ -8279,7 +8281,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a)
if (nzcv & 1) { /* V */
tcg_gen_or_i32(cpu_VF, cpu_VF, tcg_t1);
} else {
- if (TCG_TARGET_HAS_andc_i32) {
+ if (has_andc) {
tcg_gen_andc_i32(cpu_VF, cpu_VF, tcg_t1);
} else {
tcg_gen_and_i32(cpu_VF, cpu_VF, tcg_t2);
diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c
index 732453db6f..e303196592 100644
--- a/target/arm/tcg/translate-sve.c
+++ b/target/arm/tcg/translate-sve.c
@@ -622,7 +622,7 @@ static void gen_bsl2n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64
m, TCGv_i64 k)
* = | ~(m | k)
*/
tcg_gen_and_i64(n, n, k);
- if (TCG_TARGET_HAS_orc_i64) {
+ if (tcg_op_supported(INDEX_op_orc_i64, TCG_TYPE_I64, 0)) {
tcg_gen_or_i64(m, m, k);
tcg_gen_orc_i64(d, n, m);
} else {
diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
index c16b59ab88..68ac393415 100644
--- a/target/arm/tcg/translate.c
+++ b/target/arm/tcg/translate.c
@@ -493,7 +493,7 @@ static void gen_add_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32
t1)
static void gen_adc_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1)
{
TCGv_i32 tmp = tcg_temp_new_i32();
- if (TCG_TARGET_HAS_add2_i32) {
+ if (tcg_op_supported(INDEX_op_add2_i32, TCG_TYPE_I32, 0)) {
tcg_gen_movi_i32(tmp, 0);
tcg_gen_add2_i32(cpu_NF, cpu_CF, t0, tmp, cpu_CF, tmp);
tcg_gen_add2_i32(cpu_NF, cpu_CF, cpu_NF, cpu_CF, t1, tmp);
--
2.43.0
- [PULL 00/68] tcg patch queue, Richard Henderson, 2025/01/17
- [PULL 01/68] disas/riscv: Guard dec->cfg dereference for host disassemble, Richard Henderson, 2025/01/17
- [PULL 06/68] tcg: Add TCGOP_FLAGS, Richard Henderson, 2025/01/17
- [PULL 02/68] tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc, Richard Henderson, 2025/01/17
- [PULL 03/68] tcg: Replace TCGOP_VECL with TCGOP_TYPE, Richard Henderson, 2025/01/17
- [PULL 04/68] tcg: Move tcg_op_insert_{after, before} decls to tcg-internal.h, Richard Henderson, 2025/01/17
- [PULL 05/68] tcg: Copy TCGOP_TYPE in tcg_op_insert_{after,before}, Richard Henderson, 2025/01/17
- [PULL 08/68] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec, Richard Henderson, 2025/01/17
- [PULL 10/68] target/tricore: Use tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 14/68] target/i386: Use tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 09/68] target/arm: Use tcg_op_supported,
Richard Henderson <=
- [PULL 12/68] target/i386: Remove TCG_TARGET_extract_tl_valid, Richard Henderson, 2025/01/17
- [PULL 13/68] target/i386: Use tcg_op_deposit_valid, Richard Henderson, 2025/01/17
- [PULL 07/68] tcg: Add type and flags arguments to tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 16/68] tcg: Rename tcg-target.opc.h to tcg-target-opc.h.inc, Richard Henderson, 2025/01/17
- [PULL 17/68] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc, Richard Henderson, 2025/01/17
- [PULL 11/68] tcg: Add tcg_op_deposit_valid, Richard Henderson, 2025/01/17
- [PULL 15/68] tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS, Richard Henderson, 2025/01/17
- [PULL 18/68] tcg: Move fallback tcg_can_emit_vec_op out of line, Richard Henderson, 2025/01/17
- [PULL 22/68] tcg/arm: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 21/68] tcg/aarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17