summaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2013-03-26 19:56:01 +0100
committerAurelien Jarno <aurelien@aurel32.net>2013-04-01 18:49:16 +0200
commitb27a6cacb73ca006c6995ca5c3db7347333ba7f4 (patch)
treec860bfb7e8a041103ff4ec616ea728bf37026cb0 /target-i386
parent649ad05ed4133d3a48d43881aa9351c024d9cdc1 (diff)
downloadqemu-b27a6cacb73ca006c6995ca5c3db7347333ba7f4.zip
target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal each" mode
pcmpXstrX instructions in "Equal each" mode force both invalid element pair to true. It means (upper - MAX(valids, validd)) bits should be set to 1, not (upper - MAX(valids, validd) + 1). Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/ops_sse.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 51c5fc9313..2fc5fdd48a 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -2025,7 +2025,7 @@ static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s,
}
break;
case 2:
- res = (2 << (upper - MAX(valids, validd))) - 1;
+ res = (1 << (upper - MAX(valids, validd))) - 1;
res <<= MAX(valids, validd) - MIN(valids, validd);
for (i = MIN(valids, validd); i >= 0; i--) {
res <<= 1;