qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PULL 03/27] tcg/s390x: Always set TCG_TARGET_HAS_direct_jump
Date: Fri,  6 Jan 2023 23:50:54 -0800	[thread overview]
Message-ID: <20230107075118.1814503-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230107075118.1814503-1-richard.henderson@linaro.org>

Since USE_REG_TB is removed, there is no need to load the
target TB address into a register.

Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/s390x/tcg-target.h     |  2 +-
 tcg/s390x/tcg-target.c.inc | 48 +++++++-------------------------------
 2 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h
index 22d70d431b..645f522058 100644
--- a/tcg/s390x/tcg-target.h
+++ b/tcg/s390x/tcg-target.h
@@ -103,7 +103,7 @@ extern uint64_t s390_facilities[3];
 #define TCG_TARGET_HAS_mulsh_i32      0
 #define TCG_TARGET_HAS_extrl_i64_i32  0
 #define TCG_TARGET_HAS_extrh_i64_i32  0
-#define TCG_TARGET_HAS_direct_jump    HAVE_FACILITY(GEN_INST_EXT)
+#define TCG_TARGET_HAS_direct_jump    1
 #define TCG_TARGET_HAS_qemu_st8_i32   0
 
 #define TCG_TARGET_HAS_div2_i64       1
diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index ba4bb6a629..2cdd0d7a92 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -996,28 +996,6 @@ static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val,
     return false;
 }
 
-/* load data from an absolute host address */
-static void tcg_out_ld_abs(TCGContext *s, TCGType type,
-                           TCGReg dest, const void *abs)
-{
-    intptr_t addr = (intptr_t)abs;
-
-    if (HAVE_FACILITY(GEN_INST_EXT) && !(addr & 1)) {
-        ptrdiff_t disp = tcg_pcrel_diff(s, abs) >> 1;
-        if (disp == (int32_t)disp) {
-            if (type == TCG_TYPE_I32) {
-                tcg_out_insn(s, RIL, LRL, dest, disp);
-            } else {
-                tcg_out_insn(s, RIL, LGRL, dest, disp);
-            }
-            return;
-        }
-    }
-
-    tcg_out_movi(s, TCG_TYPE_PTR, dest, addr & ~0xffff);
-    tcg_out_ld(s, type, dest, dest, addr & 0xffff);
-}
-
 static inline void tcg_out_risbg(TCGContext *s, TCGReg dest, TCGReg src,
                                  int msb, int lsb, int ofs, int z)
 {
@@ -2037,24 +2015,16 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_goto_tb:
         a0 = args[0];
-        if (s->tb_jmp_insn_offset) {
-            /*
-             * branch displacement must be aligned for atomic patching;
-             * see if we need to add extra nop before branch
-             */
-            if (!QEMU_PTR_IS_ALIGNED(s->code_ptr + 1, 4)) {
-                tcg_out16(s, NOP);
-            }
-            tcg_out16(s, RIL_BRCL | (S390_CC_ALWAYS << 4));
-            s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s);
-            s->code_ptr += 2;
-        } else {
-            /* load address stored at s->tb_jmp_target_addr + a0 */
-            tcg_out_ld_abs(s, TCG_TYPE_PTR, TCG_TMP0,
-                           tcg_splitwx_to_rx(s->tb_jmp_target_addr + a0));
-            /* and go there */
-            tcg_out_insn(s, RR, BCR, S390_CC_ALWAYS, TCG_TMP0);
+        /*
+         * branch displacement must be aligned for atomic patching;
+         * see if we need to add extra nop before branch
+         */
+        if (!QEMU_PTR_IS_ALIGNED(s->code_ptr + 1, 4)) {
+            tcg_out16(s, NOP);
         }
+        tcg_out16(s, RIL_BRCL | (S390_CC_ALWAYS << 4));
+        s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s);
+        s->code_ptr += 2;
         set_jmp_reset_offset(s, a0);
         break;
 
-- 
2.34.1



  parent reply	other threads:[~2023-01-07  7:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07  7:50 [PULL 00/27] tcg/s390x patch queue Richard Henderson
2023-01-07  7:50 ` [PULL 01/27] tcg/s390x: Use register pair allocation for div and mulu2 Richard Henderson
2023-01-07  7:50 ` [PULL 02/27] tcg/s390x: Remove TCG_REG_TB Richard Henderson
2023-01-07  7:50 ` Richard Henderson [this message]
2023-01-07  7:50 ` [PULL 04/27] tcg/s390x: Remove USE_LONG_BRANCHES Richard Henderson
2023-01-07  7:50 ` [PULL 05/27] tcg/s390x: Check for long-displacement facility at startup Richard Henderson
2023-01-07  7:50 ` [PULL 06/27] tcg/s390x: Check for extended-immediate " Richard Henderson
2023-01-07  7:50 ` [PULL 07/27] tcg/s390x: Check for general-instruction-extension " Richard Henderson
2023-01-07  7:50 ` [PULL 08/27] tcg/s390x: Check for load-on-condition " Richard Henderson
2023-01-07  7:51 ` [PULL 09/27] tcg/s390x: Remove FAST_BCR_SER facility check Richard Henderson
2023-01-07  7:51 ` [PULL 10/27] tcg/s390x: Remove DISTINCT_OPERANDS " Richard Henderson
2023-01-07  7:51 ` [PULL 11/27] tcg/s390x: Use LARL+AGHI for odd addresses Richard Henderson
2023-01-07  7:51 ` [PULL 12/27] tcg/s390x: Distinguish RRF-a and RRF-c formats Richard Henderson
2023-01-07  7:51 ` [PULL 13/27] tcg/s390x: Distinguish RIE formats Richard Henderson
2023-01-07  7:51 ` [PULL 14/27] tcg/s390x: Support MIE2 multiply single instructions Richard Henderson
2023-01-07  7:51 ` [PULL 15/27] tcg/s390x: Support MIE2 MGRK instruction Richard Henderson
2023-01-07  7:51 ` [PULL 16/27] tcg/s390x: Issue XILF directly for xor_i32 Richard Henderson
2023-01-07  7:51 ` [PULL 17/27] tcg/s390x: Tighten constraints for or_i64 and xor_i64 Richard Henderson
2023-01-07  7:51 ` [PULL 18/27] tcg/s390x: Tighten constraints for and_i64 Richard Henderson
2023-01-07  7:51 ` [PULL 19/27] tcg/s390x: Support MIE3 logical operations Richard Henderson
2023-01-07  7:51 ` [PULL 20/27] tcg/s390x: Create tgen_cmp2 to simplify movcond Richard Henderson
2023-01-07  7:51 ` [PULL 21/27] tcg/s390x: Generalize movcond implementation Richard Henderson
2023-01-07  7:51 ` [PULL 22/27] tcg/s390x: Support SELGR instruction in movcond Richard Henderson
2023-01-07  7:51 ` [PULL 23/27] tcg/s390x: Use tgen_movcond_int in tgen_clz Richard Henderson
2023-01-07  7:51 ` [PULL 24/27] tcg/s390x: Implement ctpop operation Richard Henderson
2023-01-07  7:51 ` [PULL 25/27] tcg/s390x: Tighten constraints for 64-bit compare Richard Henderson
2023-01-07  7:51 ` [PULL 26/27] tcg/s390x: Cleanup tcg_out_movi Richard Henderson
2023-01-07  7:51 ` [PULL 27/27] tcg/s390x: Avoid the constant pool in tcg_out_movi Richard Henderson
2023-01-08 14:27 ` [PULL 00/27] tcg/s390x patch queue 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=20230107075118.1814503-4-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=iii@linux.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).