]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
CVTPI2PS: Only switch to MMX mode if the source is a MMX register.
authorJulian Seward <jseward@acm.org>
Wed, 19 Oct 2016 16:01:01 +0000 (16:01 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 19 Oct 2016 16:01:01 +0000 (16:01 +0000)
(for both x86 and amd64 front ends)
Fixes #357059.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3275

VEX/priv/guest_amd64_toIR.c
VEX/priv/guest_x86_toIR.c

index 2a2a85cf6b3f249645f72685a02ee474ed75c110..2080dc0c6bcd906d1ec65362babf4537db9f390d 100644 (file)
@@ -12848,8 +12848,10 @@ Long dis_ESC_0F__SSE2 ( Bool* decode_OK,
          IRTemp rmode = newTemp(Ity_I32);
 
          modrm = getUChar(delta);
-         do_MMX_preamble();
          if (epartIsReg(modrm)) {
+            /* Only switch to MMX mode if the source is a MMX register.
+               See comments on CVTPI2PD for details.  Fixes #357059. */
+            do_MMX_preamble();
             assign( arg64, getMMXReg(eregLO3ofRM(modrm)) );
             delta += 1;
             DIP("cvtpi2ps %s,%s\n", nameMMXReg(eregLO3ofRM(modrm)),
index c24d9a4bfea479ab99fba60327f1c55255267122..24f9848f0a653b17689de9d3a2db02c0860ca77d 100644 (file)
@@ -8565,8 +8565,10 @@ DisResult disInstr_X86_WRK (
       vassert(sz == 4);
 
       modrm = getIByte(delta+2);
-      do_MMX_preamble();
       if (epartIsReg(modrm)) {
+         /* Only switch to MMX mode if the source is a MMX register.
+            See comments on CVTPI2PD for details.  Fixes #357059. */
+         do_MMX_preamble();
          assign( arg64, getMMXReg(eregOfRM(modrm)) );
          delta += 2+1;
          DIP("cvtpi2ps %s,%s\n", nameMMXReg(eregOfRM(modrm)),