All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PATCH 10/22] tcg/s390: Convert to tcg-target-constr.h
Date: Tue, 22 Dec 2020 22:01:52 -0800	[thread overview]
Message-ID: <20201223060204.576856-11-richard.henderson@linaro.org> (raw)
In-Reply-To: <20201223060204.576856-1-richard.henderson@linaro.org>

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/s390/tcg-target-constr.h | 15 ++++++++++++++
 tcg/s390/tcg-target.h        |  1 +
 tcg/s390/tcg-target.c.inc    | 40 ------------------------------------
 3 files changed, 16 insertions(+), 40 deletions(-)
 create mode 100644 tcg/s390/tcg-target-constr.h

diff --git a/tcg/s390/tcg-target-constr.h b/tcg/s390/tcg-target-constr.h
new file mode 100644
index 0000000000..885e91e19b
--- /dev/null
+++ b/tcg/s390/tcg-target-constr.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * S390 target-specific operand constaints.
+ * Copyright (c) 2020 Linaro
+ */
+
+REGS('r', 0xffff)
+REGS('L', 0xffff & ~((1 << TCG_REG_R2) | (1 << TCG_REG_R3) | (1 << TCG_REG_R4)))
+REGS('a', 1u << TCG_REG_R2)
+REGS('b', 1u << TCG_REG_R3)
+
+CONST('A', TCG_CT_CONST_S33)
+CONST('I', TCG_CT_CONST_S16)
+CONST('J', TCG_CT_CONST_S32)
+CONST('Z', TCG_CT_CONST_ZERO)
diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
index 63c8797bd3..3aff3cc572 100644
--- a/tcg/s390/tcg-target.h
+++ b/tcg/s390/tcg-target.h
@@ -162,5 +162,6 @@ static inline void tb_target_set_jmp_target(uintptr_t tc_ptr,
 #define TCG_TARGET_NEED_LDST_LABELS
 #endif
 #define TCG_TARGET_NEED_POOL_LABELS
+#define TCG_TARGET_CONSTR_H
 
 #endif
diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc
index c5e096449b..d00d78f0b9 100644
--- a/tcg/s390/tcg-target.c.inc
+++ b/tcg/s390/tcg-target.c.inc
@@ -402,46 +402,6 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type,
     return false;
 }
 
-/* parse target specific constraints */
-static const char *target_parse_constraint(TCGArgConstraint *ct,
-                                           const char *ct_str, TCGType type)
-{
-    switch (*ct_str++) {
-    case 'r':                  /* all registers */
-        ct->regs = 0xffff;
-        break;
-    case 'L':                  /* qemu_ld/st constraint */
-        ct->regs = 0xffff;
-        tcg_regset_reset_reg(ct->regs, TCG_REG_R2);
-        tcg_regset_reset_reg(ct->regs, TCG_REG_R3);
-        tcg_regset_reset_reg(ct->regs, TCG_REG_R4);
-        break;
-    case 'a':                  /* force R2 for division */
-        ct->regs = 0;
-        tcg_regset_set_reg(ct->regs, TCG_REG_R2);
-        break;
-    case 'b':                  /* force R3 for division */
-        ct->regs = 0;
-        tcg_regset_set_reg(ct->regs, TCG_REG_R3);
-        break;
-    case 'A':
-        ct->ct |= TCG_CT_CONST_S33;
-        break;
-    case 'I':
-        ct->ct |= TCG_CT_CONST_S16;
-        break;
-    case 'J':
-        ct->ct |= TCG_CT_CONST_S32;
-        break;
-    case 'Z':
-        ct->ct |= TCG_CT_CONST_ZERO;
-        break;
-    default:
-        return NULL;
-    }
-    return ct_str;
-}
-
 /* Test if a constant matches the constraint. */
 static int tcg_target_const_match(tcg_target_long val, TCGType type,
                                   const TCGArgConstraint *arg_ct)
-- 
2.25.1



  parent reply	other threads:[~2020-12-23  6:14 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  6:01 [PATCH 00/22] tcg: backend constraints cleanup Richard Henderson
2020-12-23  6:01 ` [PATCH 01/22] tcg/tci: Drop L and S constraints Richard Henderson
2020-12-23  6:01 ` [PATCH 02/22] tcg/i386: Move constraint type check to tcg_target_const_match Richard Henderson
2020-12-23  6:01 ` [PATCH 03/22] tcg: Split out target constraints to tcg-target-constr.h Richard Henderson
2021-01-12 11:57   ` Peter Maydell
2020-12-23  6:01 ` [PATCH 04/22] tcg/arm: Convert " Richard Henderson
2020-12-23  6:01 ` [PATCH 05/22] tcg/aarch64: " Richard Henderson
2020-12-23  6:01 ` [PATCH 06/22] tcg/ppc: " Richard Henderson
2020-12-23  6:01 ` [PATCH 07/22] tcg/tci: " Richard Henderson
2020-12-23  6:01 ` [PATCH 08/22] tcg/mips: " Richard Henderson
2020-12-23  6:01 ` [PATCH 09/22] tcg/riscv: " Richard Henderson
2021-01-07 17:26   ` Alistair Francis
2020-12-23  6:01 ` Richard Henderson [this message]
2020-12-23  6:01 ` [PATCH 11/22] tcg/sparc: " Richard Henderson
2020-12-23  6:01 ` [PATCH 12/22] tcg: Remove TCG_TARGET_CONSTR_H Richard Henderson
2021-01-07 17:27   ` Alistair Francis
2020-12-23  6:01 ` [PATCH 13/22] tcg: Split out constraint sets to tcg-target-conset.h Richard Henderson
2021-01-12 11:55   ` Peter Maydell
2020-12-23  6:01 ` [PATCH 14/22] tcg/aarch64: Convert " Richard Henderson
2020-12-23  6:01 ` [PATCH 15/22] tcg/arm: " Richard Henderson
2020-12-23  6:01 ` [PATCH 16/22] tcg/mips: " Richard Henderson
2020-12-23  6:01 ` [PATCH 17/22] tcg/ppc: " Richard Henderson
2020-12-23  6:02 ` [PATCH 18/22] tcg/riscv: " Richard Henderson
2021-01-07 17:30   ` Alistair Francis
2021-01-07 18:08   ` Peter Maydell
2021-01-07 19:01     ` Philippe Mathieu-Daudé
2021-01-07 19:15     ` Richard Henderson
2021-01-07 19:50       ` Peter Maydell
2020-12-23  6:02 ` [PATCH 19/22] tcg/s390: " Richard Henderson
2020-12-23  6:02 ` [PATCH 20/22] tcg/sparc: " Richard Henderson
2020-12-23  6:02 ` [PATCH 21/22] tcg/tci: " Richard Henderson
2020-12-23  6:02 ` [PATCH 22/22] tcg: Remove TCG_TARGET_CONSET_H Richard Henderson
2021-01-07 17:31   ` Alistair Francis
2020-12-23  6:33 ` [PATCH 00/22] tcg: backend constraints cleanup no-reply

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=20201223060204.576856-11-richard.henderson@linaro.org \
    --to=richard.henderson@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.