From: Aurelien Jarno Date: Tue, 26 Mar 2013 18:56:02 +0000 (+0100) Subject: target-i386: SSE4.2: fix pcmpXstrX instructions with "Masked(-)" polarity X-Git-Tag: v1.5.0-rc0~367 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4eba27e29114842978234a44c92b2a945a6b46d;p=thirdparty%2Fqemu.git target-i386: SSE4.2: fix pcmpXstrX instructions with "Masked(-)" polarity valids can equals to -1 if the reg/mem string is empty. Change the expression to have an empty xor mask in that case. Reviewed-by: Richard Henderson Signed-off-by: Aurelien Jarno --- diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h index 77ab410b9ea..a0bac07ba3c 100644 --- a/target-i386/ops_sse.h +++ b/target-i386/ops_sse.h @@ -2050,7 +2050,7 @@ static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s, res ^= (2 << upper) - 1; break; case 3: - res ^= (2 << valids) - 1; + res ^= (1 << (valids + 1)) - 1; break; }