Cleanup PowerPC and XLC feature tests

pull/748/head
Jeffrey Walton 2018-11-14 08:19:39 -05:00
parent 225ab6cb7b
commit 7c9858f89c
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 162 additions and 141 deletions

View File

@ -195,7 +195,7 @@ endif # _WIN32_WINNT
endif # IS_MINGW
# For feature tests
BAD_RESULT="fatal|error|unknown|unrecognized|illegal|ignored|incorrect|not found|not exist|cannot find|not supported|no such instruction|invalid mnemonic"
BAD_RESULT="fatal|error|unknown|unrecognized|illegal|ignored|incorrect|not found|not exist|cannot find|not supported|not compatible|no such instruction|invalid mnemonic"
###########################################################
##### X86/X32/X64 Options #####
@ -593,19 +593,9 @@ endif
ifneq ($(IS_PPC32)$(IS_PPC64),00)
ifeq ($(DETECT_FEATURES),1)
# LLVM front-ends only provide POWER8 and need special options to
# get XLC defines. The POWER8 really jambs us up for ppc_simd.cpp
# which needs ALTIVEC/POWER4. We have similar problems with POWER7.
ifeq ($(XLC_COMPILER)$(findstring -qxlcompatmacros,$(CXXFLAGS)),1)
TPROG = TestPrograms/test_ppc_altivec.cxx
TOPT = -qxlcompatmacros
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
ifeq ($(HAVE_OPT),0)
CXXFLAGS += -qxlcompatmacros
endif
endif
# GCC and some compatibles
ifneq ($(GCC_COMPILER)$(CLANG_COMPILER),00)
TPROG = TestPrograms/test_ppc_power8.cxx
TOPT = -mcpu=power8 -maltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -624,7 +614,6 @@ ifeq ($(DETECT_FEATURES),1)
SPECK128_FLAG = $(POWER8_FLAG)
endif
# GCC and some compatibles
TPROG = TestPrograms/test_ppc_power7.cxx
TOPT = -mcpu=power7 -maltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -632,6 +621,7 @@ ifeq ($(DETECT_FEATURES),1)
POWER7_FLAG = -mcpu=power7 -maltivec
ARIA_FLAG = $(POWER7_FLAG)
BLAKE2S_FLAG = $(POWER7_FLAG)
CHACHA_FLAG = $(POWER7_FLAG)
CHAM_FLAG = $(POWER7_FLAG)
LEA_FLAG = $(POWER7_FLAG)
SIMECK_FLAG = $(POWER7_FLAG)
@ -639,7 +629,6 @@ ifeq ($(DETECT_FEATURES),1)
SPECK64_FLAG = $(POWER7_FLAG)
endif
# GCC and some compatibles
TPROG = TestPrograms/test_ppc_altivec.cxx
TOPT = -mcpu=power4 -maltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -665,7 +654,29 @@ ifeq ($(DETECT_FEATURES),1)
SPECK64_FLAG = $(ALTIVEC_FLAG)
endif
# Drop ChaCha to Power4 if Power7 and Power8 not available
ifeq ($(CHACHA_FLAG),)
CHACHA_FLAG = $(ALTIVEC_FLAG)
endif
# GCC and some compatibles
endif
# IBM XL C/C++
ifeq ($(XLC_COMPILER),1)
# LLVM front-ends only provide POWER8 and need special options to
# get XLC defines. The POWER8 really jambs us up for ppc_simd.cpp
# which needs ALTIVEC/POWER4. We have similar problems with POWER7.
ifeq ($(findstring -qxlcompatmacros,$(CXXFLAGS)),)
TPROG = TestPrograms/test_ppc_altivec.cxx
TOPT = -qxlcompatmacros
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
ifeq ($(HAVE_OPT),0)
CXXFLAGS += -qxlcompatmacros
endif
endif
TPROG = TestPrograms/test_ppc_power8.cxx
TOPT = -qarch=pwr8 -qaltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -684,7 +695,6 @@ ifeq ($(DETECT_FEATURES),1)
SPECK128_FLAG = $(POWER8_FLAG)
endif
# IBM XL C/C++
TPROG = TestPrograms/test_ppc_power7.cxx
TOPT = -qarch=pwr7 -qaltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -692,6 +702,7 @@ ifeq ($(DETECT_FEATURES),1)
POWER7_FLAG = -qarch=pwr7 -qaltivec
ARIA_FLAG = $(POWER7_FLAG)
BLAKE2S_FLAG = $(POWER7_FLAG)
CHACHA_FLAG = $(POWER7_FLAG)
CHAM_FLAG = $(POWER7_FLAG)
LEA_FLAG = $(POWER7_FLAG)
SIMECK_FLAG = $(POWER7_FLAG)
@ -699,7 +710,6 @@ ifeq ($(DETECT_FEATURES),1)
SPECK64_FLAG = $(POWER7_FLAG)
endif
# IBM XL C/C++
TPROG = TestPrograms/test_ppc_altivec.cxx
TOPT = -qarch=pwr4 -qaltivec
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | $(GREP) -i -c -E $(BAD_RESULT))
@ -748,6 +758,14 @@ ifeq ($(DETECT_FEATURES),1)
SPECK64_FLAG = $(ALTIVEC_FLAG)
endif
# Drop ChaCha to Power4 if Power7 and Power8 not available
ifeq ($(CHACHA_FLAG),)
CHACHA_FLAG = $(ALTIVEC_FLAG)
endif
# IBM XL C/C++
endif
ifeq ($(ALTIVEC_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_ALTIVEC
else ifeq ($(POWER7_FLAG),)
@ -761,6 +779,9 @@ endif
# IBM XL C/C++ compiler
ifeq ($(XLC_COMPILER),1)
ifeq ($(findstring -qmaxmem,$(CXXFLAGS)),)
CXXFLAGS += -qmaxmem=-1
endif
# http://www-01.ibm.com/support/docview.wss?uid=swg21007500
ifeq ($(findstring -qrtti,$(CXXFLAGS)),)
CXXFLAGS += -qrtti