[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 04/22] tcg/ppc: Create TCGPowerISA and have_isa
From: |
Richard Henderson |
Subject: |
[PATCH v7 04/22] tcg/ppc: Create TCGPowerISA and have_isa |
Date: |
Mon, 30 Sep 2019 13:21:07 -0700 |
Introduce an enum to hold base < 2.06 < 3.00. Use macros to
preserve the existing have_isa_2_06 and have_isa_3_00 predicates.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/ppc/tcg-target.h | 12 ++++++++++--
tcg/ppc/tcg-target.inc.c | 8 ++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index 690fa744e1..35ba8693fa 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -58,8 +58,16 @@ typedef enum {
TCG_AREG0 = TCG_REG_R27
} TCGReg;
-extern bool have_isa_2_06;
-extern bool have_isa_3_00;
+typedef enum {
+ tcg_isa_base,
+ tcg_isa_2_06,
+ tcg_isa_3_00,
+} TCGPowerISA;
+
+extern TCGPowerISA have_isa;
+
+#define have_isa_2_06 (have_isa >= tcg_isa_2_06)
+#define have_isa_3_00 (have_isa >= tcg_isa_3_00)
/* optional instructions automatically implemented */
#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */
diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c
index 4aad5d2b36..0bfaef9418 100644
--- a/tcg/ppc/tcg-target.inc.c
+++ b/tcg/ppc/tcg-target.inc.c
@@ -64,8 +64,7 @@
static tcg_insn_unit *tb_ret_addr;
-bool have_isa_2_06;
-bool have_isa_3_00;
+TCGPowerISA have_isa;
#define HAVE_ISA_2_06 have_isa_2_06
#define HAVE_ISEL have_isa_2_06
@@ -2787,12 +2786,13 @@ static void tcg_target_init(TCGContext *s)
unsigned long hwcap = qemu_getauxval(AT_HWCAP);
unsigned long hwcap2 = qemu_getauxval(AT_HWCAP2);
+ have_isa = tcg_isa_base;
if (hwcap & PPC_FEATURE_ARCH_2_06) {
- have_isa_2_06 = true;
+ have_isa = tcg_isa_2_06;
}
#ifdef PPC_FEATURE2_ARCH_3_00
if (hwcap2 & PPC_FEATURE2_ARCH_3_00) {
- have_isa_3_00 = true;
+ have_isa = tcg_isa_3_00;
}
#endif
--
2.17.1
- [PATCH v7 00/22] tcg/ppc: Add vector opcodes, Richard Henderson, 2019/09/30
- [PATCH v7 01/22] tcg/ppc: Introduce Altivec registers, Richard Henderson, 2019/09/30
- [PATCH v7 02/22] tcg/ppc: Introduce macro VX4(), Richard Henderson, 2019/09/30
- [PATCH v7 03/22] tcg/ppc: Introduce macros VRT(), VRA(), VRB(), VRC(), Richard Henderson, 2019/09/30
- [PATCH v7 05/22] tcg/ppc: Replace HAVE_ISA_2_06, Richard Henderson, 2019/09/30
- [PATCH v7 06/22] tcg/ppc: Replace HAVE_ISEL macro with a variable, Richard Henderson, 2019/09/30
- [PATCH v7 04/22] tcg/ppc: Create TCGPowerISA and have_isa,
Richard Henderson <=
- [PATCH v7 07/22] tcg/ppc: Enable tcg backend vector compilation, Richard Henderson, 2019/09/30
- [PATCH v7 10/22] tcg/ppc: Add support for vector add/subtract, Richard Henderson, 2019/09/30
- [PATCH v7 08/22] tcg/ppc: Add support for load/store/logic/comparison, Richard Henderson, 2019/09/30
- [PATCH v7 09/22] tcg/ppc: Add support for vector maximum/minimum, Richard Henderson, 2019/09/30
- [PATCH v7 11/22] tcg/ppc: Add support for vector saturated add/subtract, Richard Henderson, 2019/09/30
- [PATCH v7 14/22] tcg/ppc: Support vector dup2, Richard Henderson, 2019/09/30
- [PATCH v7 12/22] tcg/ppc: Support vector shift by immediate, Richard Henderson, 2019/09/30
- [PATCH v7 13/22] tcg/ppc: Support vector multiply, Richard Henderson, 2019/09/30
- [PATCH v7 15/22] tcg/ppc: Enable Altivec detection, Richard Henderson, 2019/09/30
- [PATCH v7 18/22] tcg/ppc: Update vector support for v2.07 VSX, Richard Henderson, 2019/09/30