From: Julian Seward Date: Wed, 19 Oct 2016 16:01:01 +0000 (+0000) Subject: CVTPI2PS: Only switch to MMX mode if the source is a MMX register. X-Git-Tag: svn/VALGRIND_3_12_0^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae8a86c2187c392c7171489c5047a3c6b1cf288b;p=thirdparty%2Fvalgrind.git CVTPI2PS: Only switch to MMX mode if the source is a MMX register. (for both x86 and amd64 front ends) Fixes #357059. git-svn-id: svn://svn.valgrind.org/vex/trunk@3275 --- diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 2a2a85cf6b..2080dc0c6b 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -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)), diff --git a/VEX/priv/guest_x86_toIR.c b/VEX/priv/guest_x86_toIR.c index c24d9a4bfe..24f9848f0a 100644 --- a/VEX/priv/guest_x86_toIR.c +++ b/VEX/priv/guest_x86_toIR.c @@ -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)),