Bug 1027 – "fadd real ptr [EAX];" does not compile
Status
RESOLVED
Resolution
INVALID
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-03-06T05:01:00Z
Last change time
2014-02-16T15:23:13Z
Assigned to
bugzilla
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2007-03-06T05:01:10Z
Works OK with fld and fst, but fails for any two-operand instruction -- fadd, fsub, fdiv, fmul, fcomp, etc.
They all work correctly with 'double ptr' and 'float ptr'.
(I suspect this is a side-effect of the ancient change from 'extended' to 'real').
This is a show-stopper for 80-bit vector operations :-(.
Also the ambiguous " fadd [EAX];"
compiles, but I'm not sure that it should -- which size does it use?
----------
bug.d(7): bad type/size of operands 'fadd'
----------
void main()
{
real a = 3.0;
asm {
lea EAX, a;
fld real ptr [EAX]; // ok
fadd real ptr [EAX]; // bug
fsub real ptr [EAX]; // bug
fmul real ptr [EAX]; // bug
fdiv real ptr [EAX]; // bug
fcom real ptr [EAX]; // bug
fucom real ptr [EAX]; // bug
fstp st(0), st;
fldz;
fstp real ptr [EAX]; // ok
}
assert(a==0);
}
Comment #1 by bugzilla — 2007-03-06T05:14:48Z
It shouldn't compile, as there is no such instruction! Adding (etc.) for 80 bit operands can only be done with ST registers.
Comment #2 by aldacron — 2007-03-06T05:55:28Z
[email protected] wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1027
>
>
> [email protected] changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|NEW |RESOLVED
> Resolution| |INVALID
>
>
>
>
> ------- Comment #1 from [email protected] 2007-03-06 05:14 -------
> It shouldn't compile, as there is no such instruction! Adding (etc.) for 80 bit
> operands can only be done with ST registers.
>
>
Aargh! You're right. I'm a goose!
But on the other, minor point -- what operand size does
fadd [EAX];
use?