diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2013-03-26 19:56:02 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-04-01 18:49:16 +0200 |
commit | 75c9527e190231fbc2fd8470e132f360e70206be (patch) | |
tree | 2e1982972c03782399050435b07b28a793f6072a | |
parent | b27a6cacb73ca006c6995ca5c3db7347333ba7f4 (diff) |
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 <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | target-i386/ops_sse.h | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |