3636from mypy .util import write_junit_xml
3737from mypyc .annotate import generate_annotated_html
3838from mypyc .codegen import emitmodule
39- from mypyc .common import IS_FREE_THREADED , RUNTIME_C_FILES , shared_lib_name
39+ from mypyc .common import IS_FREE_THREADED , RUNTIME_C_FILES , X86_64 , shared_lib_name
4040from mypyc .errors import Errors
4141from mypyc .ir .pprint import format_modules
4242from mypyc .namegen import exported_name
@@ -645,7 +645,6 @@ def mypycify(
645645 cflags += [
646646 f"-O{ opt_level } " ,
647647 f"-g{ debug_level } " ,
648- "-msse4.2" , # TODO
649648 "-Werror" ,
650649 "-Wno-unused-function" ,
651650 "-Wno-unused-label" ,
@@ -659,6 +658,9 @@ def mypycify(
659658 # See https://github.com/mypyc/mypyc/issues/956
660659 "-Wno-cpp" ,
661660 ]
661+ if X86_64 :
662+ # Enable SIMD extensions. All CPUs released since ~2010 support SSE4.2.
663+ cflags .append ("-msse4.2" )
662664 if log_trace :
663665 cflags .append ("-DMYPYC_LOG_TRACE" )
664666 if experimental_features :
@@ -687,6 +689,10 @@ def mypycify(
687689 # that we actually get the compilation speed and memory
688690 # use wins that multi-file mode is intended for.
689691 cflags += ["/GL-" , "/wd9025" ] # warning about overriding /GL
692+ if X86_64 :
693+ # Enable SIMD extensions. All CPUs released since ~2010 support SSE4.2.
694+ # Also Windows 11 requires SSE4.2 since 24H2.
695+ cflags .append ("/arch:SSE4.2" )
690696 if log_trace :
691697 cflags .append ("/DMYPYC_LOG_TRACE" )
692698 if experimental_features :
0 commit comments