[Issue 840] incorrect code generation for asm{fidv ST(1), ST;}
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 8 03:05:19 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=840
clugdbug at yahoo.com.au changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #2 from clugdbug at yahoo.com.au 2009-04-08 05:05 -------
Actually, DMD is correct. Here's the output from the old DOS DEBUG.
-u 0100 0102
13A9:0100 DCF9 FDIV ST(1),ST
13A9:0102 DCF1 FDIVR ST(1),ST
The bug is in majority of *nix assemblers. Here's a link.
===========
http://gcc.gnu.org/ml/gcc-bugs/2003-04/msg01454.html
-----
The SystemV/386 SVR3.2 assembler, and probably all AT&T derived
ix86 Unix assemblers, generate floating point instructions with
reversed source and destination registers in certain cases.
Unfortunately, gcc and possibly many other programs use this
reversed syntax, so we're stuck with it.
eg. `fsub %st(3),%st' results in st = st - st(3) as expected, but
`fsub %st,%st(3)' results in st(3) = st - st(3), rather than
the expected st(3) = st(3) - st
This happens with all the non-commutative arithmetic floating point
operations with two register operands, where the source register is
%st, and destination register is %st(i). See FloatDR below.
----------
--
More information about the Digitalmars-d-bugs
mailing list