]> git.proxmox.com Git - qemu.git/commitdiff
target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 26 Mar 2013 18:56:02 +0000 (19:56 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Mon, 1 Apr 2013 16:49:16 +0000 (18:49 +0200)
The inner loop should only change the current bit of the result, instead
of the whole result.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386/ops_sse.h

index 2fc5fdd48ab0d4befd7473dd641bda290a8ebd39..77ab410b9ea88ed9369d6e1e1a8fa2d4a28d7cd9 100644 (file)
@@ -2036,10 +2036,11 @@ static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s,
     case 3:
         for (j = valids - validd; j >= 0; j--) {
             res <<= 1;
-            res |= 1;
+            = 1;
             for (i = MIN(upper - j, validd); i >= 0; i--) {
-                res &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i));
+                v &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i));
             }
+            res |= v;
         }
         break;
     }