[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 137/162] tcg/ppc: Remove support for add2/sub2
From: |
Richard Henderson |
Subject: |
[PATCH v3 137/162] tcg/ppc: Remove support for add2/sub2 |
Date: |
Sun, 16 Feb 2025 15:09:46 -0800 |
We have replaced this with support for add/sub carry.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/ppc/tcg-target-con-set.h | 2 --
tcg/ppc/tcg-target-has.h | 11 +++----
tcg/ppc/tcg-target.c.inc | 60 ------------------------------------
3 files changed, 4 insertions(+), 69 deletions(-)
diff --git a/tcg/ppc/tcg-target-con-set.h b/tcg/ppc/tcg-target-con-set.h
index 9ea26c40ae..da7a383bff 100644
--- a/tcg/ppc/tcg-target-con-set.h
+++ b/tcg/ppc/tcg-target-con-set.h
@@ -41,5 +41,3 @@ C_O1_I4(r, r, r, rU, rC)
C_O2_I1(r, r, r)
C_N1O1_I1(o, m, r)
C_O2_I2(r, r, r, r)
-C_O2_I4(r, r, rI, rZM, r, r)
-C_O2_I4(r, r, r, r, rI, rZM)
diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h
index 8d832ce99c..4dda668706 100644
--- a/tcg/ppc/tcg-target-has.h
+++ b/tcg/ppc/tcg-target-has.h
@@ -18,16 +18,13 @@
/* optional instructions */
#define TCG_TARGET_HAS_qemu_st8_i32 0
-
-#if TCG_TARGET_REG_BITS == 64
#define TCG_TARGET_HAS_add2_i32 0
#define TCG_TARGET_HAS_sub2_i32 0
+
+#if TCG_TARGET_REG_BITS == 64
#define TCG_TARGET_HAS_extr_i64_i32 0
-#define TCG_TARGET_HAS_add2_i64 1
-#define TCG_TARGET_HAS_sub2_i64 1
-#else
-#define TCG_TARGET_HAS_add2_i32 1
-#define TCG_TARGET_HAS_sub2_i32 1
+#define TCG_TARGET_HAS_add2_i64 0
+#define TCG_TARGET_HAS_sub2_i64 0
#endif
#define TCG_TARGET_HAS_qemu_ldst_i128 \
diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 0b151db0e4..91df9610ec 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -3663,8 +3663,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
TCGType type,
const TCGArg args[TCG_MAX_OP_ARGS],
const int const_args[TCG_MAX_OP_ARGS])
{
- TCGArg a0, a1;
-
switch (opc) {
case INDEX_op_goto_ptr:
tcg_out32(s, MTSPR | RS(args[0]) | CTR);
@@ -3760,57 +3758,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
TCGType type,
tcg_out_qemu_ldst_i128(s, args[0], args[1], args[2], args[3], false);
break;
-#if TCG_TARGET_REG_BITS == 64
- case INDEX_op_add2_i64:
-#else
- case INDEX_op_add2_i32:
-#endif
- /* Note that the CA bit is defined based on the word size of the
- environment. So in 64-bit mode it's always carry-out of bit 63.
- The fallback code using deposit works just as well for 32-bit. */
- a0 = args[0], a1 = args[1];
- if (a0 == args[3] || (!const_args[5] && a0 == args[5])) {
- a0 = TCG_REG_R0;
- }
- if (const_args[4]) {
- tcg_out32(s, ADDIC | TAI(a0, args[2], args[4]));
- } else {
- tcg_out32(s, ADDC | TAB(a0, args[2], args[4]));
- }
- if (const_args[5]) {
- tcg_out32(s, (args[5] ? ADDME : ADDZE) | RT(a1) | RA(args[3]));
- } else {
- tcg_out32(s, ADDE | TAB(a1, args[3], args[5]));
- }
- if (a0 != args[0]) {
- tcg_out_mov(s, TCG_TYPE_REG, args[0], a0);
- }
- break;
-
-#if TCG_TARGET_REG_BITS == 64
- case INDEX_op_sub2_i64:
-#else
- case INDEX_op_sub2_i32:
-#endif
- a0 = args[0], a1 = args[1];
- if (a0 == args[5] || (!const_args[3] && a0 == args[3])) {
- a0 = TCG_REG_R0;
- }
- if (const_args[2]) {
- tcg_out32(s, SUBFIC | TAI(a0, args[4], args[2]));
- } else {
- tcg_out32(s, SUBFC | TAB(a0, args[4], args[2]));
- }
- if (const_args[3]) {
- tcg_out32(s, (args[3] ? SUBFME : SUBFZE) | RT(a1) | RA(args[5]));
- } else {
- tcg_out32(s, SUBFE | TAB(a1, args[5], args[3]));
- }
- if (a0 != args[0]) {
- tcg_out_mov(s, TCG_TYPE_REG, args[0], a0);
- }
- break;
-
case INDEX_op_mb:
tcg_out_mb(s, args[0]);
break;
@@ -4456,13 +4403,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned
flags)
case INDEX_op_st_i64:
return C_O0_I2(r, r);
- case INDEX_op_add2_i64:
- case INDEX_op_add2_i32:
- return C_O2_I4(r, r, r, r, rI, rZM);
- case INDEX_op_sub2_i64:
- case INDEX_op_sub2_i32:
- return C_O2_I4(r, r, rI, rZM, r, r);
-
case INDEX_op_qemu_ld_i32:
return C_O1_I1(r, r);
case INDEX_op_qemu_ld_i64:
--
2.43.0
- [PATCH v3 116/162] tcg: Use add carry opcodes to expand add2, (continued)
- [PATCH v3 116/162] tcg: Use add carry opcodes to expand add2, Richard Henderson, 2025/02/16
- [PATCH v3 120/162] tcg/i386: Remove support for add2/sub2, Richard Henderson, 2025/02/16
- [PATCH v3 129/162] target/sh4: Use tcg_gen_addcio_i32 for addc, Richard Henderson, 2025/02/16
- [PATCH v3 122/162] tcg: Add tcg_gen_addcio_{i32,i64,tl}, Richard Henderson, 2025/02/16
- [PATCH v3 131/162] target/tricore: Use tcg_gen_addcio_i32 for gen_addc_CC, Richard Henderson, 2025/02/16
- [PATCH v3 134/162] tcg/arm: Implement add/sub carry opcodes, Richard Henderson, 2025/02/16
- [PATCH v3 136/162] tcg/ppc: Implement add/sub carry opcodes, Richard Henderson, 2025/02/16
- [PATCH v3 146/162] tcg/tci: Implement add/sub carry opcodes, Richard Henderson, 2025/02/16
- [PATCH v3 121/162] tcg/i386: Special case addci r, 0, 0, Richard Henderson, 2025/02/16
- [PATCH v3 125/162] target/microblaze: Use tcg_gen_addcio_i32, Richard Henderson, 2025/02/16
- [PATCH v3 137/162] tcg/ppc: Remove support for add2/sub2,
Richard Henderson <=
- [PATCH v3 138/162] tcg/s390x: Honor carry_live in tcg_out_movi, Richard Henderson, 2025/02/16
- [PATCH v3 152/162] tcg: Assign TCGOP_TYPE in liveness_pass_2, Richard Henderson, 2025/02/16
- [PATCH v3 128/162] target/s390x: Use tcg_gen_addcio_i64 for op_addc64, Richard Henderson, 2025/02/16
- [PATCH v3 133/162] tcg/aarch64: Remove support for add2/sub2, Richard Henderson, 2025/02/16
- [PATCH v3 132/162] tcg/aarch64: Implement add/sub carry opcodes, Richard Henderson, 2025/02/16
- [PATCH v3 135/162] tcg/arm: Remove support for add2/sub2, Richard Henderson, 2025/02/16
- [PATCH v3 145/162] tcg/sparc64: Remove support for add2/sub2, Richard Henderson, 2025/02/16
- [PATCH v3 153/162] tcg: Convert ld to TCGOutOpLoad, Richard Henderson, 2025/02/16
- [PATCH v3 123/162] target/arm: Use tcg_gen_addcio_* for ADCS, Richard Henderson, 2025/02/16
- [PATCH v3 126/162] target/openrisc: Use tcg_gen_addcio_* for ADDC, Richard Henderson, 2025/02/16