This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "SSE instruction set disabled?"
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Robert_K_Cook at comerica dot com
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc at gcc dot gnu dot org,Jan Hubicka <jh at suse dot cz>, Scott Robert Ladd <scott at coyotegulch dot com>
- Date: Wed, 4 Dec 2002 23:07:54 +0100
- Subject: Re: "SSE instruction set disabled?"
- References: <OFD24E9125.80204307-ON85256C85.00735C0B-85256C85.0077E324@INT.COMERICA.COM>
>
> >> This makes absolute complete sense.
> >>
> >> "-mmmx", "-msse", "-msse2", and "-m3dnow" (and their corresponding
> >> -mno-xxx) should just go away.
>
> >So what do you do if you want your binaries or libraries run on any
> >CPU supporting SSE, ie. ATM pIII, p4, athlon-{4,xp,mp}?
> >-march=i686 -msse -mfpmath=sse is what you use now, using -march=pentium3
> >is not a good idea for the athlons and likewise -march=athlon-xp is
> >not a good idea for pentiums.
>
> See this is why it is so confusing. To GCC, what you wrote is the same
> thing since
>
> "-march=pentium3" == "-march=i686 -msse"
>
> To be even more anal, looking through specs
>
> this implies
> -march=i386 -mcpu=i386
> -march=i486 -mcpu=i486
> -march=i586 -mcpu=i586
> -march=pentium -mcpu=i586
> -march=pentium-mmx -mcpu=i586 -mmmx
> -march=i686 -mcpu=i686
> -march=pentiumpro -mcpu=i686
> -march=pentium2 -mcpu=i686 -mmmx
> -march=pentium3 -mcpu=i686 -msse
> -march=pentium4 -mcpu=pentium4 -msse2
> -march=athlon -mcpu=athlon -m3dnow
> -march=athlon-tbird -mcpu=athlon -m3dnow
> -march=athlon-xp -mcpu=athlon -m3dnow -msse
> -march=athlon-mp -mcpu=athlon -m3dnow -msse
> -march=athlon-4 -mcpu=athlon -m3dnow -msse
> -march=k6 -mcpu=k6
> -march=k6-2 -mcpu=k6 -m3dnow
> -march=k6-2 -mcpu=k6 -m3dnow
>
> ....
>
> I agree with others "-msse" or "-msse2" should generally imply "
> -mfpmath=sse". Its kind of silly to have to specify that twice.
It is not the same, unfortuantely.
-msse2 simply enables the instruction set extension. The compiled
programs will have same behaviour as before just can be faster.
-mfpmath=sse changes behaviour of floating point execution by not using
80bit temporaries like x87 code does. This breaks some things (glibc)
and makes other happy (those who want numberic stability).
I am inclined to argue to make -mfpmath=sse default when SSE is
available however last time I lost the battle.
Honza
>
> ...
>
> And depreciate "-mcpu" for "-mtune"; it is much more intuitive (at least
> for english speakers).
>
> Choose the minimum ARCHitecture (capabilities) that you wish to run the
> binary on. Then, if you wish, choose a more recent model to TUNE (optimize)
> the binary for.
>
> Kelley Cook
>