bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in AS: fdivp and fsubp


From: Marius Tennøe
Subject: Bug in AS: fdivp and fsubp
Date: Mon, 14 Jun 2010 23:07:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

Hi.

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).

Correct translation is found at
http://download.intel.com/design/processor/manuals/253666.pdf
Pages:
    fdivp:    3-373
    fdivrp:   3-377
    fsubp:   3-455
    fsubrp:  3-459

System and AS-information:

$ uname -a
Linux Onyx 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 22:02:19 UTC 2010
i686 GNU/Linux

$ as -v
GNU assembler version 2.20.1 (i486-linux-gnu) using BFD version (GNU
Binutils for Ubuntu) 2.20.1-system.20100303

An assembly program that demonstrates the bug is the following:

    .globl  fdiv
fdiv:
    flds    4(%esp)
    flds    8(%esp)
    fdivp
    ret 

    .globl  fsub
fsub:
    flds    4(%esp)
    flds    8(%esp)
    fsubp
    ret

The generated code is:

$ as -a --32 prog.s
GAS LISTING prog.s                         page 1


   1                                 .globl  fdiv
   2                            fdiv:
   3 0000 D9442404            flds    4(%esp)
   4 0004 D9442408            flds    8(%esp)
   5 0008 DEF1                  fdivp
   6 000a C3                     ret
   7
   8                                .globl  fsub
   9                           fsub:
  10 000b D9442404           flds    4(%esp)
  11 000f D9442408           flds    8(%esp)
  12 0013 DEE1                 fsubp
  13 0015 C3                    ret
  14
  15

GAS LISTING prog.s                         page 2


DEFINED SYMBOLS
              prog.s:2      .text:0000000000000000 fdiv
              prog.s:9      .text:000000000000000b fsub

NO UNDEFINED SYMBOLS

Cheers,
Marius Tennøe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]