[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils-bugs
Subject:    Re: Bug in AS: fdivp and fsubp
From:       Alan Modra <amodra () gmail ! com>
Date:       2010-06-15 3:55:04
Message-ID: 20100615034304.GE9748 () bubble ! grove ! modra ! org
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic