Commit d4cba13b authored by Richard Henderson's avatar Richard Henderson Committed by Peter Maydell
Browse files

tcg/ppc: Fix failure in tcg_out_mem_long



With rt != r0 on loads, we use rt for scratch.  If we need an index
register different from base, we can't use rt, but r0 is usable.

Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
Message-id: 1403843160-30332-1-git-send-email-rth@twiddle.net
Tested-by: default avatarCédric Le Goater <clg@fr.ibm.com>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent ff4873cb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -805,7 +805,10 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,

    /* For unaligned, or very large offsets, use the indexed form.  */
    if (offset & align || offset != (int32_t)offset) {
        tcg_debug_assert(rs != base && (!is_store || rs != rt));
        if (rs == base) {
            rs = TCG_REG_R0;
        }
        tcg_debug_assert(!is_store || rs != rt);
        tcg_out_movi(s, TCG_TYPE_PTR, rs, orig);
        tcg_out32(s, opx | TAB(rt, base, rs));
        return;