All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [PULL 04/23] tcg/ppc: Create TCGPowerISA and have_isa
Date: Sun, 13 Oct 2019 15:25:25 -0700	[thread overview]
Message-ID: <20191013222544.3679-5-richard.henderson@linaro.org> (raw)
In-Reply-To: <20191013222544.3679-1-richard.henderson@linaro.org>

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.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 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



  parent reply	other threads:[~2019-10-13 22:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13 22:25 [PULL 00/23] tcg patch queue Richard Henderson
2019-10-13 22:25 ` [PULL 01/23] tcg/ppc: Introduce Altivec registers Richard Henderson
2019-10-13 22:25 ` [PULL 02/23] tcg/ppc: Introduce macro VX4() Richard Henderson
2019-10-13 22:25 ` [PULL 03/23] tcg/ppc: Introduce macros VRT(), VRA(), VRB(), VRC() Richard Henderson
2019-10-13 22:25 ` Richard Henderson [this message]
2019-10-13 22:25 ` [PULL 05/23] tcg/ppc: Replace HAVE_ISA_2_06 Richard Henderson
2019-10-13 22:25 ` [PULL 06/23] tcg/ppc: Replace HAVE_ISEL macro with a variable Richard Henderson
2019-10-13 22:25 ` [PULL 07/23] tcg/ppc: Enable tcg backend vector compilation Richard Henderson
2019-10-13 22:25 ` [PULL 08/23] tcg/ppc: Add support for load/store/logic/comparison Richard Henderson
2019-10-13 22:25 ` [PULL 09/23] tcg/ppc: Add support for vector maximum/minimum Richard Henderson
2019-10-13 22:25 ` [PULL 10/23] tcg/ppc: Add support for vector add/subtract Richard Henderson
2019-10-13 22:25 ` [PULL 11/23] tcg/ppc: Add support for vector saturated add/subtract Richard Henderson
2019-10-13 22:25 ` [PULL 12/23] tcg/ppc: Support vector shift by immediate Richard Henderson
2019-10-13 22:25 ` [PULL 13/23] tcg/ppc: Support vector multiply Richard Henderson
2019-10-13 22:25 ` [PULL 14/23] tcg/ppc: Support vector dup2 Richard Henderson
2019-10-13 22:25 ` [PULL 15/23] tcg/ppc: Enable Altivec detection Richard Henderson
2019-10-13 22:25 ` [PULL 16/23] tcg/ppc: Update vector support for VSX Richard Henderson
2019-10-13 22:25 ` [PULL 17/23] tcg/ppc: Update vector support for v2.07 Altivec Richard Henderson
2019-10-13 22:25 ` [PULL 18/23] tcg/ppc: Update vector support for v2.07 VSX Richard Henderson
2019-10-13 22:25 ` [PULL 19/23] tcg/ppc: Update vector support for v2.07 FP Richard Henderson
2019-10-13 22:25 ` [PULL 20/23] tcg/ppc: Update vector support for v3.00 Altivec Richard Henderson
2019-10-13 22:25 ` [PULL 21/23] tcg/ppc: Update vector support for v3.00 load/store Richard Henderson
2019-10-13 22:25 ` [PULL 22/23] tcg/ppc: Update vector support for v3.00 dup/dupi Richard Henderson
2019-10-13 22:25 ` [PULL 23/23] cpus: kick all vCPUs when running thread=single Richard Henderson
2019-10-13 23:26 ` [PULL 00/23] tcg patch queue no-reply
2019-10-13 23:53 ` Aleksandar Markovic
2019-10-14  3:23   ` Richard Henderson
2019-10-14  4:41     ` Aleksandar Markovic
2019-10-17 14:55 ` Richard Henderson
2019-10-17 17:16   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191013222544.3679-5-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.