qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5417] Fix crc32w decoding, fix a constant width in blendvpd.
@ 2008-10-04 11:33 Andrzej Zaborowski
  0 siblings, 0 replies; only message in thread
From: Andrzej Zaborowski @ 2008-10-04 11:33 UTC (permalink / raw)
  To: qemu-devel

Revision: 5417
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5417
Author:   balrog
Date:     2008-10-04 11:33:52 +0000 (Sat, 04 Oct 2008)

Log Message:
-----------
Fix crc32w decoding, fix a constant width in blendvpd.

Forced the constant's width to long long so that it doesn't overflow,
problem spotted by C. W. Betts.

Modified Paths:
--------------
    trunk/target-i386/ops_sse.h
    trunk/target-i386/translate.c

Modified: trunk/target-i386/ops_sse.h
===================================================================
--- trunk/target-i386/ops_sse.h	2008-10-04 07:25:46 UTC (rev 5416)
+++ trunk/target-i386/ops_sse.h	2008-10-04 11:33:52 UTC (rev 5417)
@@ -1481,7 +1481,7 @@
 /* SSE4.1 op helpers */
 #define FBLENDVB(d, s, m) (m & 0x80) ? s : d
 #define FBLENDVPS(d, s, m) (m & 0x80000000) ? s : d
-#define FBLENDVPD(d, s, m) (m & 0x8000000000000000) ? s : d
+#define FBLENDVPD(d, s, m) (m & 0x8000000000000000LL) ? s : d
 SSE_HELPER_V(helper_pblendvb, B, 16, FBLENDVB)
 SSE_HELPER_V(helper_blendvps, L, 4, FBLENDVPS)
 SSE_HELPER_V(helper_blendvpd, Q, 2, FBLENDVPD)

Modified: trunk/target-i386/translate.c
===================================================================
--- trunk/target-i386/translate.c	2008-10-04 07:25:46 UTC (rev 5416)
+++ trunk/target-i386/translate.c	2008-10-04 11:33:52 UTC (rev 5417)
@@ -3568,17 +3568,16 @@
             reg = ((modrm >> 3) & 7) | rex_r;
             gen_op_mov_reg_T0(OT_LONG, reg);
             break;
-        case 0x038:
         case 0x138:
+            if (s->prefix & PREFIX_REPNZ)
+                goto crc32;
+        case 0x038:
             b = modrm;
             modrm = ldub_code(s->pc++);
             rm = modrm & 7;
             reg = ((modrm >> 3) & 7) | rex_r;
             mod = (modrm >> 6) & 3;
 
-            if (s->prefix & PREFIX_REPNZ)
-                goto crc32;
-
             sse_op2 = sse_op_table6[b].op[b1];
             if (!sse_op2)
                 goto illegal_op;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-04 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-04 11:33 [Qemu-devel] [5417] Fix crc32w decoding, fix a constant width in blendvpd Andrzej Zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).