]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/ppc: Fix vsum2sws
authorAnton Blanchard <anton@ozlabs.org>
Tue, 4 Jun 2019 19:01:14 +0000 (20:01 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 17 Sep 2019 20:16:58 +0000 (15:16 -0500)
A recent cleanup changed the pre zeroing of the result from 64 bit
to 32 bit operations:

-        result.u64[i] = 0;
+        result.VsrW(i) = 0;

This corrupts the result.

Fixes: 60594fea298d ("target/ppc: remove various HOST_WORDS_BIGENDIAN hacks in int_helper.c")
Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Message-Id: <20190507004811.29968-9-anton@ozlabs.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(upstream commit 7fa0ddc1d63806769d1b6246a62708d3bde39037)
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/ppc/int_helper.c

index 162add561eb33f34551c221cec5cbcc8461869cc..6bd1d32b1d264e65a9ee2f300d4f12229fdd6afe 100644 (file)
@@ -2030,7 +2030,7 @@ void helper_vsum2sws(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
     for (i = 0; i < ARRAY_SIZE(r->u64); i++) {
         int64_t t = (int64_t)b->VsrSW(upper + i * 2);
 
-        result.VsrW(i) = 0;
+        result.VsrD(i) = 0;
         for (j = 0; j < ARRAY_SIZE(r->u64); j++) {
             t += a->VsrSW(2 * i + j);
         }