]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tcg/ppc: Use TCG_REG_TMP2 for scratch index in prepare_host_addr
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 5 Oct 2024 22:09:54 +0000 (22:09 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 8 Oct 2024 13:40:31 +0000 (06:40 -0700)
In tcg_out_qemu_ldst_i128, we need a non-zero index register,
which we then use as a base register in several address modes.
Since we always have TCG_REG_TMP2 available, use that.

Cc: qemu-stable@nongnu.org
Fixes: 526cd4ec01f ("tcg/ppc: Support 128-bit load/store")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2597
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-By: Michael Tokarev <mjt@tls.msk.ru>
tcg/ppc/tcg-target.c.inc

index 6be5049d02f40a31acb653c16eac35f2dccc74ce..223f0795244b66f17740103555cdb6546ce18c44 100644 (file)
@@ -2617,8 +2617,8 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h,
 
     if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) {
         /* Zero-extend the guest address for use in the host address. */
-        tcg_out_ext32u(s, TCG_REG_R0, addrlo);
-        h->index = TCG_REG_R0;
+        tcg_out_ext32u(s, TCG_REG_TMP2, addrlo);
+        h->index = TCG_REG_TMP2;
     } else {
         h->index = addrlo;
     }