Skip to contentSkip to conversation

tcg patch queue

GIT PULL Richard Henderson 1 participant 6 messages Aug 27

lore
Share & tools
lore
#0 lore raw

The following changes since commit 562bae590f194fb590beb5c65da44fc35ab9f64a:

Merge tag 's390x-20260826' of https://gitlab.com/efarman/qemu into staging (2026-08-26 13:40:41 -0700)

are available in the Git repository at:

https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20260826

for you to fetch changes up to 01e1455139196cc8d6bcde7d2f918348a90f7f26:

util/cpuinfo-aarch64: Fix build with older glibc headers (2026-08-26 21:25:04 -0700)

----------------------------------------------------------------
disas: Replace straggling CS_ARCH_SYSZ
tcg: Fix typo in tcg_gen_hswap_i64
tcg/aarch64: Use tgen_brcondi in tcg_out_qemu_ldst_i128 util/cpuinfo-aarch64: Fix build with older glibc headers

----------------------------------------------------------------
Eric Farman (1):
disas: Replace straggling CS_ARCH_SYSZ

Richard Henderson (2):
tcg: Fix typo in tcg_gen_hswap_i64 tcg/aarch64: Use tgen_brcondi in tcg_out_qemu_ldst_i128

Tao Tang (1):
util/cpuinfo-aarch64: Fix build with older glibc headers

 disas/disas-host.c           |  2 +-
 tcg/tcg-op.c                 |  2 +-
 util/cpuinfo-aarch64.c       |  3 +++
 tcg/aarch64/tcg-target.c.inc | 25 ++++++++++---------------
 4 files changed, 15 insertions(+), 17 deletions(-)
#1 lore raw

[PULL 3/4] tcg/aarch64: Use tgen_brcondi in tcg_out_qemu_ldst_i128

Allow tgen_brcondi to choose between TBNZ and TST+B.cond for implementing a particular mask.

---
 tcg/aarch64/tcg-target.c.inc | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)
tcg/aarch64/tcg-target.c.inc +10 -15
index 1e64c5994e0..4ebdef7e077 100644
@@ -1916,23 +1916,18 @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCGReg datalo, TCGReg datahi,
     use_pair = h.aa.atom < MO_128 || have_lse2;
 
     if (!use_pair) {
-        tcg_insn_unit *branch = NULL;
+        TCGLabel *label = NULL;
         TCGReg ll, lh, sl, sh;
-
         /*
-         * If we have already checked for 16-byte alignment, that's all
-         * we need. Otherwise we have determined that misaligned atomicity
-         * may be handled with two 8-byte loads.
+         * Check for 16-byte alignment, taking into consideration the
+         * alignment that has already been checked.
          */
-        if (h.aa.align < MO_128) {
-            /*
-             * TODO: align should be MO_64, so we only need test bit 3,
-             * which means we could use TBNZ instead of ANDS+B_C.
-             */
-            tcg_out_logicali(s, Ilogic_imm_ANDSI, 0, TCG_REG_XZR, addr_reg,
-                             15);
-            branch = s->code_ptr;
-            tcg_out_insn(s, bcond_imm, B_C, TCG_COND_NE, 0);
+        int a_mask = 16 - (1 << h.aa.align);
+
+        if (a_mask > 0) {
+            label = gen_new_label();
+            tgen_brcondi(s, TCG_TYPE_I32, TCG_COND_TSTNE,
+                         addr_reg, a_mask, label);
             use_pair = true;
         }
 
@@ -1971,7 +1966,7 @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCGReg datalo, TCGReg datahi,
         if (use_pair) {
             /* "b .+8", branching across the one insn of use_pair. */
             tcg_out_insn(s, branch, B, 2);
-            reloc_pc19(branch, tcg_splitwx_to_rx(s->code_ptr));
+            tcg_out_label(s, label);
         }
     }
 
Signature · 1 line
2.53.0
#2 lore raw

[PULL 2/4] disas: Replace straggling CS_ARCH_SYSZ

In reply to Richard Henderson

From: Eric Farman <[email protected]>

When updating to capstone v6, the define CS_ARCH_SYSZ was replaced with CS_ARCH_SYSTEMZ, except here. On systems without capstone-devel installed, this causes a compile error:

../disas/disas-host.c: In function ‘initialize_debug_host’:
../disas/disas-host.c:78:24: error: ‘CS_ARCH_SYSZ’ undeclared (first use in this function); did you mean ‘CS_ARCH_SH’?

     78 |     s->info.cap_arch = CS_ARCH_SYSZ;
        |                        ^~~~~~~~~~~~
        |                        CS_ARCH_SH

../disas/disas-host.c:78:24: note: each undeclared identifier is reported only once for each function it appears in

Rather than making capstone required, replace the constant with the same one used elsewhere after that change.

Fixes c8220a096f ("target/s390x: Update capstone disassembly to v6")

Message-ID: <[email protected]>

---
 disas/disas-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
disas/disas-host.c +1 -1
index d41235250a0..799f5e86c40 100644
@@ -75,7 +75,7 @@ static void initialize_debug_host(CPUDebug *s)
 #elif defined(__m68k__)
     s->info.print_insn = print_insn_m68k;
 #elif defined(__s390x__)
-    s->info.cap_arch = CS_ARCH_SYSZ;
+    s->info.cap_arch = CS_ARCH_SYSTEMZ;
     s->info.cap_insn_unit = 2;
     s->info.cap_insn_split = 6;
 #elif defined(__hppa__)
Signature · 1 line
2.53.0
#3 lore raw

[PULL 1/4] tcg: Fix typo in tcg_gen_hswap_i64

In reply to Richard Henderson
Fixes 288d39e26d ("tcg: Simplify bswap/hswap expansion using bitswap")

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4229

---
 tcg/tcg-op.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-op.c +1 -1
index 28d3b2a847c..2c88f4f7ca9 100644
@@ -1887,7 +1887,7 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg)
  */
 void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg)
 {
-    gen_bitswap_i64(ret, ret, 0x0000ffff0000ffffull);
+    gen_bitswap_i64(ret, arg, 0x0000ffff0000ffffull);
     tcg_gen_wswap_i64(ret, ret);
 }
 
Signature · 1 line
2.53.0
#4 lore raw

[PULL 4/4] util/cpuinfo-aarch64: Fix build with older glibc headers

In reply to Richard Henderson

From: Tao Tang <[email protected]>

Commit 761bfe07b2c9 ("util/cpuinfo-aarch64: Detect FEAT_CSSC") started using HWCAP2_CSSC unconditionally. This macro was added to glibc's AArch64 bits/hwcap.h during the glibc 2.38 development cycle, so AArch64 hosts with older headers fail to build.

Follow the existing HWCAP2_BTI handling and define HWCAP2_CSSC to zero when it is not provided by system headers. Such environments simply do not use FEAT_CSSC host optimizations.

This has been tested on an Ubuntu 22.04 aarch64 host with glibc 2.35.

Fixes 761bfe07b2c9 ("util/cpuinfo-aarch64: Detect FEAT_CSSC")

Message-ID: <[email protected]>

---
 util/cpuinfo-aarch64.c | 3 +++
 1 file changed, 3 insertions(+)
util/cpuinfo-aarch64.c +3 -0
index 4ce6deb7c82..e3446762149 100644
@@ -16,6 +16,9 @@
 # ifndef HWCAP2_BTI
 #  define HWCAP2_BTI 0  /* added in glibc 2.32 */
 # endif
+# ifndef HWCAP2_CSSC
+#  define HWCAP2_CSSC 0  /* added in glibc 2.38 */
+# endif
 #endif
 #ifdef CONFIG_ELF_AUX_INFO
 #include <sys/auxv.h>
Signature · 1 line
2.53.0
author Reviewed-by
#5 lore raw
In reply to Richard Henderson
Quoted 10 lines · Richard Henderson

The following changes since commit 562bae590f194fb590beb5c65da44fc35ab9f64a:

   Merge tag 's390x-20260826' ofhttps://gitlab.com/efarman/qemu into staging (2026-08-26 13:40:41 -0700)

are available in the Git repository at:

   https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20260826

for you to fetch changes up to 01e1455139196cc8d6bcde7d2f918348a90f7f26:

Quoted 7 lines

util/cpuinfo-aarch64: Fix build with older glibc headers (2026-08-26 21:25:04 -0700)

----------------------------------------------------------------
disas: Replace straggling CS_ARCH_SYSZ
tcg: Fix typo in tcg_gen_hswap_i64
tcg/aarch64: Use tgen_brcondi in tcg_out_qemu_ldst_i128 util/cpuinfo-aarch64: Fix build with older glibc headers

r~