[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/85] target/sparc: Define AM_CHECK for sparc32
From: |
Richard Henderson |
Subject: |
[PATCH 05/85] target/sparc: Define AM_CHECK for sparc32 |
Date: |
Fri, 13 Oct 2023 14:27:26 -0700 |
Define as false, which allows some ifdef removal.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/translate.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 59e5289693..da6503e101 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -258,20 +258,21 @@ static void gen_move_Q(DisasContext *dc, unsigned int rd,
unsigned int rs)
#endif
#endif
-#ifdef TARGET_SPARC64
-#ifndef TARGET_ABI32
-#define AM_CHECK(dc) ((dc)->address_mask_32bit)
+#if !defined(TARGET_SPARC64)
+# define AM_CHECK(dc) false
+#elif defined(TARGET_ABI32)
+# define AM_CHECK(dc) true
+#elif defined(CONFIG_USER_ONLY)
+# define AM_CHECK(dc) false
#else
-#define AM_CHECK(dc) (1)
-#endif
+# define AM_CHECK(dc) ((dc)->address_mask_32bit)
#endif
static void gen_address_mask(DisasContext *dc, TCGv addr)
{
-#ifdef TARGET_SPARC64
- if (AM_CHECK(dc))
+ if (AM_CHECK(dc)) {
tcg_gen_andi_tl(addr, addr, 0xffffffffULL);
-#endif
+ }
}
static TCGv gen_load_gpr(DisasContext *dc, int reg)
@@ -1327,11 +1328,9 @@ static void do_branch(DisasContext *dc, int32_t offset,
uint32_t insn, int cc)
unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29));
target_ulong target = dc->pc + offset;
-#ifdef TARGET_SPARC64
if (unlikely(AM_CHECK(dc))) {
target &= 0xffffffffULL;
}
-#endif
if (cond == 0x0) {
/* unconditional not taken */
if (a) {
@@ -1367,11 +1366,9 @@ static void do_fbranch(DisasContext *dc, int32_t offset,
uint32_t insn, int cc)
unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29));
target_ulong target = dc->pc + offset;
-#ifdef TARGET_SPARC64
if (unlikely(AM_CHECK(dc))) {
target &= 0xffffffffULL;
}
-#endif
if (cond == 0x0) {
/* unconditional not taken */
if (a) {
--
2.34.1
- [PATCH 00/85] target/sparc: Convert to decodetree, Richard Henderson, 2023/10/13
- [PATCH 01/85] target/sparc: Set TCG_GUEST_DEFAULT_MO, Richard Henderson, 2023/10/13
- [PATCH 02/85] configs: Enable MTTCG for sparc, sparc64, Richard Henderson, 2023/10/13
- [PATCH 03/85] target/sparc: Remove always-set cpu features, Richard Henderson, 2023/10/13
- [PATCH 04/85] target/sparc: Add decodetree infrastructure, Richard Henderson, 2023/10/13
- [PATCH 05/85] target/sparc: Define AM_CHECK for sparc32,
Richard Henderson <=
- [PATCH 06/85] target/sparc: Move CALL to decodetree, Richard Henderson, 2023/10/13
- [PATCH 08/85] target/sparc: Move BPr to decodetree, Richard Henderson, 2023/10/13
- [PATCH 09/85] target/sparc: Move FBPfcc and FBfcc to decodetree, Richard Henderson, 2023/10/13
- [PATCH 10/85] target/sparc: Merge gen_cond with only caller, Richard Henderson, 2023/10/13
- [PATCH 07/85] target/sparc: Move BPcc and Bicc to decodetree, Richard Henderson, 2023/10/13
- [PATCH 11/85] target/sparc: Merge gen_fcond with only caller, Richard Henderson, 2023/10/13
- [PATCH 12/85] target/sparc: Merge gen_branch_[an] with only caller, Richard Henderson, 2023/10/13
- [PATCH 13/85] target/sparc: Pass DisasCompare to advance_jump_cond, Richard Henderson, 2023/10/13