[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/81] target/arm: Use tcg_op_supported
From: |
Richard Henderson |
Subject: |
[PATCH v2 08/81] target/arm: Use tcg_op_supported |
Date: |
Mon, 6 Jan 2025 23:59:59 -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
- [RFC PATCH v2 00/81] tcg: Merge *_i32 and *_i64 opcodes, Richard Henderson, 2025/01/07
- [PATCH v2 01/81] tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc, Richard Henderson, 2025/01/07
- [PATCH v2 03/81] tcg: Move tcg_op_insert_{after, before} decls to tcg-internal.h, Richard Henderson, 2025/01/07
- [PATCH v2 04/81] tcg: Copy TCGOP_TYPE in tcg_op_insert_{after, before}, Richard Henderson, 2025/01/07
- [PATCH v2 08/81] target/arm: Use tcg_op_supported,
Richard Henderson <=
- [PATCH v2 13/81] target/i386: Use tcg_op_supported, Richard Henderson, 2025/01/07
- [PATCH v2 19/81] tcg: Split out tcg-target-mo.h, Richard Henderson, 2025/01/07
- [PATCH v2 05/81] tcg: Add TCGOP_FLAGS, Richard Henderson, 2025/01/07
- [PATCH v2 16/81] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc, Richard Henderson, 2025/01/07
- [PATCH v2 09/81] target/tricore: Use tcg_op_supported, Richard Henderson, 2025/01/07
- [PATCH v2 17/81] tcg: Move fallback tcg_can_emit_vec_op out of line, Richard Henderson, 2025/01/07
- [PATCH v2 20/81] tcg: Use C_NotImplemented in tcg_target_op_def, Richard Henderson, 2025/01/07
- [PATCH v2 02/81] tcg: Replace TCGOP_VECL with TCGOP_TYPE, Richard Henderson, 2025/01/07