Debian Bug report logs - #372528
as/i386: reverses fdivp and fdivrp

version graph

Package: binutils; Maintainer for binutils is Matthias Klose <doko@debian.org>; Source for binutils is src:binutils.

Reported by: Pierre Pronchery <khorben@defora.org>

Date: Fri, 9 Jun 2006 21:49:06 UTC

Severity: normal

Found in versions binutils/2.15-6, binutils/2.17-3

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, khorben@defora.org, James Troup <james@nocrew.org>:
Bug#372528; Package binutils. Full text and rfc822 format available.

Acknowledgement sent to Pierre Pronchery <khorben@defora.org>:
New Bug report received and forwarded. Copy sent to khorben@defora.org, James Troup <james@nocrew.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Pierre Pronchery <khorben@defora.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: as/i386: reverses fdivp and fdivrp
Date: Fri, 09 Jun 2006 23:46:43 +0200
Package: binutils
Version: 2.15-6
Severity: normal


Subject: binutils: as/i386: reverses fdivp and fdivrp
Package: binutils
Version: 2.15-6
Severity: normal

	Hello all,

while reading through the Intel Instruction Set Reference (P4), I
noticed a difference between the documentation and the output for the
following file:

-- BEGIN PASTE --
..text
	fdivp
	fdivrp
-- END PASTE --

for which objdump says:

-- BEGIN PASTE --

fdiv.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   de f1                   fdivp  %st,%st(1)
   2:   de f9                   fdivrp %st,%st(1)
-- END PASTE --

However, the documentation says fdivp is opcode 0xdef9, and fdivrp is
opcode 0xdef1 (pages 356 and 360).


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.31
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=)

Versions of packages binutils depends on:
ii  libc6                 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an

-- no debconf information


Hope this helps,
-- 
khorben

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.31
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=)

Versions of packages binutils depends on:
ii  libc6                 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, James Troup <james@nocrew.org>:
Bug#372528; Package binutils. Full text and rfc822 format available.

Acknowledgement sent to Peter Cordes <peter@cordes.ca>:
Extra info received and forwarded to list. Copy sent to James Troup <james@nocrew.org>. Full text and rfc822 format available.

Message #10 received at 372528@bugs.debian.org (full text, mbox):

From: Peter Cordes <peter@cordes.ca>
To: Debian Bug Tracking System <372528@bugs.debian.org>
Subject: binutils: Reversed FPU opcodes is documented behaviour for gas
Date: Wed, 08 Nov 2006 01:30:18 -0400
Package: binutils
Version: 2.17-3
Followup-For: Bug #372528

 gas is intentionally bug-compatible with early 386 Unix
compilers/assemblers, which got fsub and fsubr and others switched.
gcc generates code using these buggy opcodes, and inline asm uses it,
so we're stuck with it now, and even amd64 too, unfortunately.  Damn,
you can never get rid of cruft once it starts to accumulate :(

 Unfortunately binutils frobs the opcodes when disassembling with
objdump -M intel -d foo.o, so you can't get binutils to show you
assembly source that corresponds to Intel manuals.  I've reported this
as Debian bug #397545.  ndisasm and ht both work, but don't do a great
job with ELF sections, and seem to diassemble the ELF headers.

here's all the good stuff I've turned up on this subject:
 (as.info.gz)i386-Bugs.
 the comment which begins with "The SystemV/386 SVR3.2 assembler", at
  the top of opcode/i386.h (e.g. http://opengrok.creo.hu/dragonfly/xref/src/contrib/binutils-2.15/include/opcode/i386.h#opcode)
This thread:
 http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00864.html
and another example of this cruft causing headaches:
 http://sources.redhat.com/ml/binutils/1999-10/msg00109.html
 Debian bug #397545
 http://en.wikipedia.org/wiki/X86_assembly_language
 http://www.sesp.cse.clrc.ac.uk/html/SoftwareTools/vtune/users_guide/
(don't eat their bandwidth;  I just found that page with google...)
The instruction VTune instruction reference in vtune proved very
useful, because it has a good menu on the left, and the page for each
opcode makes it clear what the machine codes are in hex, so you can
compare with what your disassembler is showing.  e.g.
http://www.sesp.cse.clrc.ac.uk/html/SoftwareTools/vtune/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc123.htm
There seem to be several places to find the VTune docs online on
public web servers, so find a mirror if you're going to bookmark it.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 17:17:39 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.