diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py index e020d96ee553..f1d024b942f9 100644 --- a/numpy/distutils/ccompiler_opt.py +++ b/numpy/distutils/ccompiler_opt.py @@ -899,7 +899,11 @@ class _CCompiler: cc_on_x64 : bool True when the target architecture is 64-bit x86 cc_on_ppc64 : bool - True when the target architecture is 64-bit big-endian PowerPC + True when the target architecture is 64-bit big-endian powerpc + cc_on_ppc64le : bool + True when the target architecture is 64-bit litle-endian powerpc + cc_on_s390x : bool + True when the target architecture is IBM/ZARCH on linux cc_on_armhf : bool True when the target architecture is 32-bit ARMv7+ cc_on_aarch64 : bool @@ -1009,7 +1013,7 @@ def __init__(self): self.cc_is_gcc = True self.cc_march = "unknown" - for arch in ("x86", "x64", "ppc64", "ppc64le", + for arch in ("x86", "x64", "ppc64", "ppc64le", "armhf", "aarch64", "s390x"): if getattr(self, "cc_on_" + arch): self.cc_march = arch @@ -1090,7 +1094,9 @@ def cc_normalize_flags(self, flags): _cc_normalize_unix_frgx = re.compile( # 2- to remove any flags starts with # -march, -mcpu, -x(INTEL) and '-m' without '=' - r"^(?!(-mcpu=|-march=|-x[A-Z0-9\-]))(?!-m[a-z0-9\-\.]*.$)" + r"^(?!(-mcpu=|-march=|-x[A-Z0-9\-]|-m[a-z0-9\-\.]*.$))|" + # exclude: + r"(?:-mzvector)" ) _cc_normalize_unix_krgx = re.compile( # 3- keep only the highest of diff --git a/numpy/distutils/tests/test_ccompiler_opt.py b/numpy/distutils/tests/test_ccompiler_opt.py index 6d42cc172ebe..6f9970c75351 100644 --- a/numpy/distutils/tests/test_ccompiler_opt.py +++ b/numpy/distutils/tests/test_ccompiler_opt.py @@ -443,7 +443,7 @@ def test_flags(self): ppc64_clang="-maltivec -mvsx -mpower8-vector", armhf_gcc="-mfpu=neon-fp16 -mfp16-format=ieee", aarch64="", - s390="-mzvector -march=arch12" + s390x="-mzvector -march=arch12" ) # testing normalize -march self.expect_flags( @@ -467,6 +467,10 @@ def test_flags(self): "asimddp asimdhp asimdfhm", aarch64_gcc=r"-march=armv8.2-a\+dotprod\+fp16\+fp16fml" ) + self.expect_flags( + "vx vxe vxe2", + s390x=r"-mzvector -march=arch13" + ) def test_targets_exceptions(self): for targets in (