Patchwork [05/10] target-i386: SSE4.2: fix pcmpXstrX instructions in "Ranges" mode

login
register
mail settings
Submitter Aurelien Jarno
Date March 26, 2013, 7:01 p.m.
Message ID <1364324502-9124-6-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/231516/
State New
Headers show

Comments

Aurelien Jarno - March 26, 2013, 7:01 p.m.
Fix the order of the of the comparisons to match the "Intel 64 and
IA-32 Architectures Software Developer's Manual".

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-i386/ops_sse.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Richard Henderson - March 27, 2013, 8:14 p.m.
On 03/26/2013 12:01 PM, Aurelien Jarno wrote:
> Fix the order of the of the comparisons to match the "Intel 64 and
> IA-32 Architectures Software Developer's Manual".
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target-i386/ops_sse.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

Patch

diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 4a95f41..51c5fc9 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -2019,8 +2019,8 @@  static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s,
             res <<= 1;
             v = pcmp_val(s, ctrl, j);
             for (i = ((validd - 1) | 1); i >= 0; i -= 2) {
-                res |= (pcmp_val(d, ctrl, i - 0) <= v &&
-                        pcmp_val(d, ctrl, i - 1) >= v);
+                res |= (pcmp_val(d, ctrl, i - 0) >= v &&
+                        pcmp_val(d, ctrl, i - 1) <= v);
             }
         }
         break;