On Mon, Nov 12, 2007 at 08:03:23AM -0800, dancie wrote: > I have noticed when debugging with gdb that the opcode "de e9" that (in intel > syntax) gdb gives out fsubrp st1,st0. > But according to the intel docs this fsubp st1,st0. I have also noticed that > the opcode for fsubrp st1,st0 gives out > fsubp st1,st0. [snip]
This comment from include/opcode/i386.h explains the situation. You can build both binutils and gcc with -DSYSV386_COMPAT=0 if you wish. /* 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 _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils