This is the mail archive of the
mailing list for the GCC project.
Re: Preprocessor macro for -mfpmath=sse ?
On Saturday 04 May 2002 18:14, Sylvain Pion wrote:
> On Fri, May 03, 2002 at 08:16:03PM -0700, Tim Prince wrote:
> > On Friday 03 May 2002 11:56, Sylvain Pion wrote:
> > > I have implemented some interval arithmetic code which has to work
> > > around the well known non-compliance (IEEE 754) issues of x86's
> > > floating point unit. I would like to get rid of these costly
> > > workarounds when I compile with -mfpmath=sse.
> > > Would you consider adding a preprocessor macro that I could test for ?
> > I believe the pre-defined macros __SSE__ and __SSE2__ are intended for
> > such purposes.
> Where are they predefined ?
> I don't see these macros :
> ~> gcc -v -c -mfpmath=sse -msse foo.c
> Reading specs from [...]
> Thread model: single
> gcc version 3.2 20020502 (experimental)
> ./gcc/Linux_trunc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.2/cc1 -lang-c
> -quiet -v -iprefix
> ./gcc/Linux_trunc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.2/ -D__GNUC__=3
> -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D__gnu_linux__
> -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux
> -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386
> -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__
> -D__tune_pentiumpro__ foo.c -quiet -dumpbase foo.c -mfpmath=sse -msse
> -version -o /tmp/ccFd2R6k.s
> I would expect to see -D__SSE__ or such here.
Both appear in gcc-3.1 when -mfpmath=sse is invoked together with
-march=pentium4. __SSE__ alone appears with -march=pentium4 instead.