[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in AS: fdivp and fsubp
From: |
Alan Modra |
Subject: |
Re: Bug in AS: fdivp and fsubp |
Date: |
Tue, 15 Jun 2010 13:13:04 +0930 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Jun 14, 2010 at 11:07:16PM +0200, Marius Tennøe wrote:
> There is a bug in AS, where AS translates fdivp and fsubp incorrectly, by
> translating fdivp (DE F9) to fdivrp (DE F1), and fsubp (DE E9) to fsubrp
> (DE E1).
This is deliberate. See this include/opcode/i386.h comment:
/* 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).
The affected opcode map is dceX, dcfX, deeX, defX. */
--
Alan Modra
Australia Development Lab, IBM