In general, it seems that the -m{,no-}{mmx,sse,sse2,sse3,ssse3} (etc.) options
also turn on any options that the option being turned on "depends on", or turn
off any options that "depend on" the option being turned off.  (I'm not sure
what the definition of "depend on" is exactly, but I'd note that, e.g.,
emmintrin.h (SSE2) #includes xmmintrin.h (SSE) which includes mmintrin.h
(MMX).)

However, this general rule doesn't seem to apply to -mno-mmx turning off any of
the other SSE* options (even though turning on those options turns on MMX). 
That is, the following behaviors all seem sensible:

$ /usr/local/gcc-4.4.1/bin/gcc -m32 -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"$ /usr/local/gcc-4.4.1/bin/gcc -m32 -msse -E -dM -x c /dev/null |
grep "\(MMX\|SSE\)"
#define __MMX__ 1
#define __SSE__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -m32 -msse2 -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"
#define __MMX__ 1
#define __SSE2__ 1
#define __SSE__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -m32 -march=core2 -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"
#define __MMX__ 1
#define __SSE2__ 1
#define __SSSE3__ 1
#define __SSE__ 1
#define __SSE3__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -m32 -march=core2 -mno-sse2 -E -dM -x c
/dev/null | grep "\(MMX\|SSE\)"
#define __MMX__ 1
#define __SSE__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -m32 -march=core2 -mno-sse -E -dM -x c /dev/null
| grep "\(MMX\|SSE\)"
#define __MMX__ 1

But this last one doesn't seem sensible:

$ /usr/local/gcc-4.4.1/bin/gcc -m32 -march=core2 -mno-mmx -E -dM -x c /dev/null
| grep "\(MMX\|SSE\)"
#define __SSE2__ 1
#define __SSSE3__ 1
#define __SSE__ 1
#define __SSE3__ 1

I can repeat these last few tests using the default 64-bit configuration:

$ /usr/local/gcc-4.4.1/bin/gcc -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"#define __MMX__ 1
#define __SSE2_MATH__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSE__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -mno-sse2 -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"
#define __MMX__ 1
#define __SSE_MATH__ 1
#define __SSE__ 1
$ /usr/local/gcc-4.4.1/bin/gcc -mno-sse -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"
#define __MMX__ 1

And again the last one seems odd, given that turning on SSE or SSE2 turns on
MMX:

$ /usr/local/gcc-4.4.1/bin/gcc -mno-mmx -E -dM -x c /dev/null | grep
"\(MMX\|SSE\)"
#define __SSE2_MATH__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSE__ 1


-- 
           Summary: -mno-mmx doesn't turn off sse*
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dbaron at dbaron dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41202

Reply via email to