[Bug target/122176] New: -mno-mmx does not behave as documented
mkretz at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 6 13:13:50 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122176
Bug ID: 122176
Summary: -mno-mmx does not behave as documented
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: mkretz at gcc dot gnu.org
Target Milestone: ---
Target: x86_64-*-*, i?86-*-*
-mno-sse3 overrides -mavx512f (only __MMX__, __SSE__, and __SSE2__ are defined)
whereas -mno-mmx only undefs __MMX__ from the target ISA extensions.
This is in contradiction to config/i386/i386.opt which says that mavx512f (and
basically every other SSE/AVX/AVX512 flag) includes MMX.
Either the documentation or the logic what -mno-mmx does should be adjusted.
Example:
g++ -x c++ -dM -E -o- /dev/null -mavx512f -mno-mmx|grep 'MMX\|SSE\|AVX'
g++ -x c++ -dM -E -o- /dev/null -mavx512f -mno-sse3|grep 'MMX\|SSE\|AVX'
My point is that, according to the documentation, code that sees __SSE__
defined can assume __MMX__ to be defined. But that is not the behavior of GCC.
(And, FWIW, Clang behaves the same as GCC.)
I guess the correct fix is to strike MMX from the documentation in i386.opt?
Because it seems like the goal is to support codegen that ensures SIMD without
any MMX instructions?
More information about the Gcc-bugs
mailing list