]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/ppc: Fix vsum2sws
authorAnton Blanchard <anton@ozlabs.org>
Tue, 7 May 2019 00:48:11 +0000 (10:48 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 29 May 2019 01:39:44 +0000 (11:39 +1000)
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>
target/ppc/int_helper.c

index 2bad2d56202434ba8b28b88e55ea1592724b185d..093ef74b595dab54fdbf7c3002af662643ac2be3 100644 (file)
@@ -2053,7 +2053,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);
         }