From c45ae57a040313527dc55bf789218b6eef44c3f4 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Mon, 10 Oct 2016 18:09:01 +0000 Subject: [PATCH] Power configure fixes. This patch makes the following updates: - Update the configure scripts to fix a configure/build issue seen on Power 7 - Update the ISA 3.0 hwcaps string. - Update the ISA 3.0 ifdef value to be consistent with the hwcaps string The patch was submitted by Will Schmidt. Patch reviewed and tested by Carl Love on Power 7, Power 8 LE and BE, ISA 3.0 simulator for LE and BE. Bugzilla 369175 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16034 --- configure.ac | 10 ++++++---- none/tests/ppc64/Makefile.am | 15 ++++++++------- none/tests/ppc64/test_isa_3_0.c | 8 ++++---- none/tests/ppc64/test_isa_3_0_altivec.vgtest | 2 +- none/tests/ppc64/test_isa_3_0_other.vgtest | 2 +- tests/check_ppc64_auxv_cap | 2 +- tests/min_power_isa.c | 10 +++++----- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index 6134539200..4e8d7271ae 100644 --- a/configure.ac +++ b/configure.ac @@ -1353,6 +1353,7 @@ AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP]) AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05]) AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06]) AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07]) +AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00]) AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM]) # ISA Levels @@ -1523,20 +1524,21 @@ AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \ -a x$HWCAP_HAS_HTM = xyes ) # isa 3.0 checking -AC_MSG_CHECKING([that assembler knows ISA 3.0 ]) +AC_MSG_CHECKING([that assembler knows ISA 3.00 ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ __asm__ __volatile__("cnttzw 1,2 "); ]])], [ -ac_asm_have_isa_3_0=yes +ac_asm_have_isa_3_00=yes AC_MSG_RESULT([yes]) ], [ -ac_asm_have_isa_3_0=no +ac_asm_have_isa_3_00=no AC_MSG_RESULT([no]) ]) -AM_CONDITIONAL(HAS_ISA_3_0, test x$ac_asm_have_isa_3_0 = xyes) +AM_CONDITIONAL(HAS_ISA_3_00, test x$ac_asm_have_isa_3_00 = xyes \ + -a x$HWCAP_HAS_ISA_3_00 = xyes]) # Check for pthread_create@GLIBC2.0 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()]) diff --git a/none/tests/ppc64/Makefile.am b/none/tests/ppc64/Makefile.am index 003967e4c1..a79d35ac8f 100644 --- a/none/tests/ppc64/Makefile.am +++ b/none/tests/ppc64/Makefile.am @@ -102,12 +102,12 @@ endif jm_insns_CFLAGS = $(AM_CFLAGS) -Wl,-z,norelro -Winline -Wall -O -g -mregnames \ @FLAG_M64@ $(ALTIVEC_FLAG) $(BUILD_FLAG_ALTIVEC) -if HAS_ISA_3_0 -BUILD_FLAGS_ISA_3_0 = -mcpu=power8 -ISA_3_0_FLAG = -DHAS_ISA_3_0 +if HAS_ISA_3_00 +BUILD_FLAGS_ISA_3_00 = -mcpu=power8 +ISA_3_00_FLAG = -DHAS_ISA_3_00 else -BUILD_FLAGS_ISA_3_0 = -ISA_3_0_FLAG = +BUILD_FLAGS_ISA_3_00 = +ISA_3_00_FLAG = endif test_isa_2_06_part1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(VSX_FLAG) \ @@ -139,8 +139,9 @@ test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG) $(ISA_ @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07) test_touch_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG) $(ISA_2_07_FLAG) \ @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07) -test_isa_3_0_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG) $(ISA_3_0_FLAG) \ - @FLAG_M64@ $(BUILD_FLAGS_ISA_3_0) + +test_isa_3_0_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG) $(ISA_3_00_FLAG) \ + @FLAG_M64@ $(BUILD_FLAGS_ISA_3_00) test_isa_2_06_part3_LDADD = -lm test_dfp1_LDADD = -lm diff --git a/none/tests/ppc64/test_isa_3_0.c b/none/tests/ppc64/test_isa_3_0.c index a860eed533..5f5cd18481 100644 --- a/none/tests/ppc64/test_isa_3_0.c +++ b/none/tests/ppc64/test_isa_3_0.c @@ -94,7 +94,7 @@ #include /* This test is only valid on machines that support IBM POWER ISA 3.0. */ -#ifdef HAS_ISA_3_0 +#ifdef HAS_ISA_3_00 #include #include // isspace @@ -3957,12 +3957,12 @@ static void usage (void) ); } -#endif // HAS_ISA_3_0 +#endif // HAS_ISA_3_00 int main (int argc, char **argv) { -#ifndef HAS_ISA_3_0 - printf("NO ISA 3.0 SUPPORT\n"); +#ifndef HAS_ISA_3_00 + printf("NO ISA 3.00 SUPPORT\n"); return 0; #else diff --git a/none/tests/ppc64/test_isa_3_0_altivec.vgtest b/none/tests/ppc64/test_isa_3_0_altivec.vgtest index 748c9f41e7..9287e5a2e0 100644 --- a/none/tests/ppc64/test_isa_3_0_altivec.vgtest +++ b/none/tests/ppc64/test_isa_3_0_altivec.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap arch_3_0 +prereq: ../../../tests/check_ppc64_auxv_cap arch_3_00 prog: test_isa_3_0 -a -d -q diff --git a/none/tests/ppc64/test_isa_3_0_other.vgtest b/none/tests/ppc64/test_isa_3_0_other.vgtest index 8ebb1b5823..817f7efb8e 100644 --- a/none/tests/ppc64/test_isa_3_0_other.vgtest +++ b/none/tests/ppc64/test_isa_3_0_other.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap arch_3_0 +prereq: ../../../tests/check_ppc64_auxv_cap arch_3_00 prog: test_isa_3_0 -i -m -D -B -N -P diff --git a/tests/check_ppc64_auxv_cap b/tests/check_ppc64_auxv_cap index 49d7856d56..92a219ec84 100755 --- a/tests/check_ppc64_auxv_cap +++ b/tests/check_ppc64_auxv_cap @@ -14,7 +14,7 @@ CAPABILITY_WORD=$1 P_HWCAP_1=" vsx arch_2_06 power6x dfp pa6t arch_2_05 ic_snoop smt booke" P_HWCAP_2=" cellbe power5+ power5 power4 notb efpdouble efpsingle spe" P_HWCAP_3=" ucache 4xxmac mmu fpu altivec ppc601 ppc64 ppc32 " -P_HWCAP2_1=" tar isel ebb dscr htm arch_2_07 " +P_HWCAP2_1=" tar isel ebb dscr htm arch_2_07 arch_3_00 " CAPABILITY_FOUND="no" for POTENTIAL_CAP in $P_HWCAP_1 $P_HWCAP_2 $P_HWCAP_3 $P_HWCAP2_1 ; do if [ "x$CAPABILITY_WORD" = "x$POTENTIAL_CAP" ]; then diff --git a/tests/min_power_isa.c b/tests/min_power_isa.c index 8a37b6a09a..e4035ceb04 100644 --- a/tests/min_power_isa.c +++ b/tests/min_power_isa.c @@ -5,7 +5,7 @@ /* main() */ int main(int argc, char **argv) { - /* This program is passed in a minimum ISA that the underlying hardwre + /* This program is passed in a minimum ISA that the underlying hardware * needs to support. If the HW supports this ISA or newer, return 0 * for supported. Otherwise, return 1 for not supported. Return 2 for * usage error. @@ -45,8 +45,8 @@ int main(int argc, char **argv) isa_level = 7; #endif -#ifdef HAS_ISA_3_0 - if (debug) printf("HAS_ISA_3_0 is set\n"); +#ifdef HAS_ISA_3_00 + if (debug) printf("HAS_ISA_3_00 is set\n"); isa_level = 8; #endif @@ -60,12 +60,12 @@ int main(int argc, char **argv) } else if (strcmp (min_isa, "2.07") == 0) { return !(isa_level >= 7); - } else if (strcmp (min_isa, "3.0") == 0) { + } else if (strcmp (min_isa, "3.00") == 0) { return !(isa_level >= 8); } else { fprintf(stderr, "ERROR: invalid ISA version. Valid versions numbers are:\n" ); - fprintf(stderr, " 2.05, 2.06, 2.07\n" ); + fprintf(stderr, " 2.05, 2.06, 2.07, 3.00\n" ); exit(2); } -- 2.47.2