Skip to content

Commit

Permalink
Issue 5556 - [64-bit] Wrong Implicit Conversion to Double
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Feb 11, 2011
1 parent a72eb0f commit e5b6325
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/backend/cod4.c
Original file line number Diff line number Diff line change
Expand Up @@ -2402,8 +2402,8 @@ code *longcmp(elem *e,bool jcond,unsigned fltarg,code *targ)
}

/*****************************
* Do conversions. DEPENDS on OPd_s32 and CLIBdbllng being
* in SEQUENCE.
* Do conversions.
* Depends on OPd_s32 and CLIBdbllng being in sequence.
*/

code *cdcnvt(elem *e, regm_t *pretregs)
Expand Down Expand Up @@ -2456,6 +2456,26 @@ code *cdcnvt(elem *e, regm_t *pretregs)

case OPf_d:
case OPd_f:
if (I64 && *pretregs & XMMREGS)
{
c1 = codelem(e->E1,pretregs,FALSE);
unsigned reg = findreg(*pretregs) - XMM0;
if (e->Eoper == OPf_d)
{ /* 0F 14 C0 UNPCKLPS XMM0,XMM0
* 0F 5A C0 CVTPS2PD XMM0,XMM0
*/
c1 = gen2(c1, 0x0F14, modregrm(3,reg,reg));
c1 = gen2(c1, 0x0F5A, modregrm(3,reg,reg));
}
else // OPd_f
{ /* 66 0F 14 C0 UPPCKLPD XMM0,XMM0
* 66 0F 5A C0 CVTPD2PS XMM0,XMM0
*/
c1 = gen2(c1, 0x660F14, modregrm(3,reg,reg));
c1 = gen2(c1, 0x660F5A, modregrm(3,reg,reg));
}
return c1;
}
/* if won't do us much good to transfer back and */
/* forth between 8088 registers and 8087 registers */
if (OTcall(e->E1->Eoper) && !(*pretregs & allregs))
Expand Down

0 comments on commit e5b6325

Please sign in to comment.