summaryrefslogtreecommitdiffstats
path: root/tcg/s390/tcg-target.c.inc
diff options
context:
space:
mode:
authorRichard Henderson2020-10-17 05:09:02 +0200
committerRichard Henderson2021-02-02 23:12:31 +0100
commitc947deb13ea1a5c7b127177a3b5cc7d2f8607ab2 (patch)
treeb5cc445be50e60d0a08359eef7869797caeff27c /tcg/s390/tcg-target.c.inc
parenttcg/riscv: Split out target constraints to tcg-target-con-str.h (diff)
downloadqemu-c947deb13ea1a5c7b127177a3b5cc7d2f8607ab2.tar.gz
qemu-c947deb13ea1a5c7b127177a3b5cc7d2f8607ab2.tar.xz
qemu-c947deb13ea1a5c7b127177a3b5cc7d2f8607ab2.zip
tcg/s390: Split out target constraints to tcg-target-con-str.h
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/s390/tcg-target.c.inc')
-rw-r--r--tcg/s390/tcg-target.c.inc53
1 files changed, 13 insertions, 40 deletions
diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc
index 8517e55232..3fec7fec5f 100644
--- a/tcg/s390/tcg-target.c.inc
+++ b/tcg/s390/tcg-target.c.inc
@@ -42,6 +42,19 @@
#define TCG_CT_CONST_S33 0x400
#define TCG_CT_CONST_ZERO 0x800
+#define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 16)
+/*
+ * For softmmu, we need to avoid conflicts with the first 3
+ * argument registers to perform the tlb lookup, and to call
+ * the helper function.
+ */
+#ifdef CONFIG_SOFTMMU
+#define SOFTMMU_RESERVE_REGS MAKE_64BIT_MASK(TCG_REG_R2, 3)
+#else
+#define SOFTMMU_RESERVE_REGS 0
+#endif
+
+
/* Several places within the instruction set 0 means "no register"
rather than TCG_REG_R0. */
#define TCG_REG_NONE 0
@@ -403,46 +416,6 @@ static bool patch_reloc(tcg_insn_unit *src_rw, 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)