From: Aurelien Jarno Date: Tue, 26 Mar 2013 18:56:02 +0000 (+0100) Subject: target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=75c9527e190231fbc2fd8470e132f360e70206be;p=qemu.git target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode The inner loop should only change the current bit of the result, instead of the whole result. Reviewed-by: Richard Henderson Signed-off-by: Aurelien Jarno --- diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h index 2fc5fdd48a..77ab410b9e 100644 --- a/target-i386/ops_sse.h +++ b/target-i386/ops_sse.h @@ -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; + v = 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; }