Bug 7592 – Conversion from ireal to ifloat broken when using xmm

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-26T08:13:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
pull, wrong-code
Assigned to
yebblies
Creator
yebblies

Comments

Comment #0 by yebblies — 2012-02-26T08:13:55Z
CastExp::toElem contains a typo making it emit (OPd_f (OPf_d v)) instead of (OPd_f (OPlld_d v)) when converting from ireal to ifloat. This does not cause problem when v is in a floating point register, but generates wrong code when using xmm registers. ifloat conv(ireal v) { return cast(ifloat)v; } void main() { assert(conv(1.0Li) == 1.0fi); }
Comment #1 by yebblies — 2012-02-26T08:38:16Z
Comment #2 by github-bugzilla — 2012-03-10T12:05:40Z
Comment #3 by github-bugzilla — 2012-03-10T12:05:47Z