[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 22/27] tcg/s390x: Support SELGR instruction in movcond
From: |
Richard Henderson |
Subject: |
[PATCH v4 22/27] tcg/s390x: Support SELGR instruction in movcond |
Date: |
Thu, 8 Dec 2022 20:05:25 -0600 |
The new select instruction provides two separate register inputs,
whereas the old load-on-condition instruction overlaps one of the
register inputs with the destination.
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/s390x/tcg-target.c.inc | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 30c12052f0..ab1fb45cc2 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -202,6 +202,8 @@ typedef enum S390Opcode {
RRFa_XRK = 0xb9f7,
RRFa_XGRK = 0xb9e7,
+ RRFam_SELGR = 0xb9e3,
+
RRFc_LOCR = 0xb9f2,
RRFc_LOCGR = 0xb9e2,
@@ -626,12 +628,20 @@ static void tcg_out_insn_RRE(TCGContext *s, S390Opcode op,
tcg_out32(s, (op << 16) | (r1 << 4) | r2);
}
+/* RRF-a without the m4 field */
static void tcg_out_insn_RRFa(TCGContext *s, S390Opcode op,
TCGReg r1, TCGReg r2, TCGReg r3)
{
tcg_out32(s, (op << 16) | (r3 << 12) | (r1 << 4) | r2);
}
+/* RRF-a with the m4 field */
+static void tcg_out_insn_RRFam(TCGContext *s, S390Opcode op,
+ TCGReg r1, TCGReg r2, TCGReg r3, int m4)
+{
+ tcg_out32(s, (op << 16) | (r3 << 12) | (m4 << 8) | (r1 << 4) | r2);
+}
+
static void tcg_out_insn_RRFc(TCGContext *s, S390Opcode op,
TCGReg r1, TCGReg r2, int m3)
{
@@ -1376,6 +1386,11 @@ static void tgen_movcond_int(TCGContext *s, TCGType
type, TCGReg dest,
src = v4;
}
} else {
+ if (HAVE_FACILITY(MISC_INSN_EXT3)) {
+ /* Emit: dest = cc ? v3 : v4. */
+ tcg_out_insn(s, RRFam, SELGR, dest, v3, v4, cc);
+ return;
+ }
if (dest == v4) {
src = v3;
} else {
--
2.34.1
- Re: [PATCH v4 16/27] tcg/s390x: Issue XILF directly for xor_i32, (continued)
- [PATCH v4 15/27] tcg/s390x: Support MIE2 MGRK instruction, Richard Henderson, 2022/12/08
- [PATCH v4 17/27] tcg/s390x: Tighten constraints for or_i64 and xor_i64, Richard Henderson, 2022/12/08
- [PATCH v4 18/27] tcg/s390x: Tighten constraints for and_i64, Richard Henderson, 2022/12/08
- [PATCH v4 19/27] tcg/s390x: Support MIE3 logical operations, Richard Henderson, 2022/12/08
- [PATCH v4 14/27] tcg/s390x: Support MIE2 multiply single instructions, Richard Henderson, 2022/12/08
- [PATCH v4 20/27] tcg/s390x: Create tgen_cmp2 to simplify movcond, Richard Henderson, 2022/12/08
- [PATCH v4 21/27] tcg/s390x: Generalize movcond implementation, Richard Henderson, 2022/12/08
- [PATCH v4 22/27] tcg/s390x: Support SELGR instruction in movcond,
Richard Henderson <=
- [PATCH v4 23/27] tcg/s390x: Use tgen_movcond_int in tgen_clz, Richard Henderson, 2022/12/08
- [PATCH v4 24/27] tcg/s390x: Implement ctpop operation, Richard Henderson, 2022/12/08
- [PATCH v4 25/27] tcg/s390x: Tighten constraints for 64-bit compare, Richard Henderson, 2022/12/08
- [PATCH v4 27/27] tcg/s390x: Avoid the constant pool in tcg_out_movi, Richard Henderson, 2022/12/08
- [PATCH v4 26/27] tcg/s390x: Cleanup tcg_out_movi, Richard Henderson, 2022/12/08