This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 3.3.5: -march=i586 does not use all pentium FPU instructions


I think Intel's confusing numbering system has confused 
you.  All ix86 processors, if the expression 
x in first ix86 < x in second ix86
holds true, then second ix86 is compatible.  The i586 is 
NOT the Pentium.  Nor is the i686.  But the i686 was one of 
the first Intel processors with built-in FPU.  If you are 
asking for Pentium, try the following switches:
-march=pentium
-march=pentium -mmmx # Pentium MMX
-march=pentium2
-march=pentium3
-march=celron
-march=pentium4
-march=prescott # this will probably get you in trouble

If you use any of these switches, it will add FP 
instruction calls.  -march=prescott has caused more than 
one problem elsewhere.  

Samuel Lauber

> I was wondering why the above gcc parameter does not enable the use of the
> fst/fld opcodes for pentium processors, while -march=i686 does. The Intel
> manuals specifically say that they can be used across all pentium processors.
> 
> Example :
> $ gcc -g -c -mcpu=i586 mdouble.cpp -o mdouble.o
> $ objdump -dS -M intel mdouble.o
> <...>
> void foo()
> {
>     0:   55                      push   ebp
>     1:   89 e5                   mov    ebp,esp
>     3:   83 ec 10                sub    esp,0x10
>      double d;
>      double a;
>      d = 3.0;
>     6:   b8 00 00 00 00          mov    eax,0x0
>     b:   ba 00 00 08 40          mov    edx,0x40080000
>    10:   89 45 f8                mov    DWORD PTR [ebp-8],eax
>    13:   89 55 fc                mov    DWORD PTR [ebp-4],edx
>      a = d;
>    16:   8b 45 f8                mov    eax,DWORD PTR [ebp-8]
>    19:   8b 55 fc                mov    edx,DWORD PTR [ebp-4]
>    1c:   89 45 f0                mov    DWORD PTR [ebp-16],eax
>    1f:   89 55 f4                mov    DWORD PTR [ebp-12],edx
> }
>    22:   c9                      leave
>    23:   c3                      ret
> 
> While :
> $ gcc -g -c -mcpu=i686 mdouble.cpp -o mdouble.o
> $ objdump -dS -M intel mdouble.o
> <...>
> void foo()
> {
>     0:   55                      push   ebp
>     1:   89 e5                   mov    ebp,esp
>     3:   83 ec 10                sub    esp,0x10
>      double d;
>      double a;
>      d = 3.0;
>     6:   dd 05 00 00 00 00       fld    ds:0x0
>     c:   dd 5d f8                fstp   QWORD PTR [ebp-8]
>      a = d;
>     f:   dd 45 f8                fld    QWORD PTR [ebp-8]
>    12:   dd 5d f0                fstp   QWORD PTR [ebp-16]
> }
>    15:   c9                      leave
>    16:   c3                      ret
> 
> FLD and FSTP are available on all pentium processors.
> Is there a chance, for other reasons, that my code will not run on a pentium
> if I use -march=i686 ?
-- 
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
From your mailbox to local or overseas cell phones.

Powered by Outblaze


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]