From: Carl Love Date: Wed, 8 Sep 2021 22:01:05 +0000 (+0000) Subject: Fix dfp tests. X-Git-Tag: VALGRIND_3_18_0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=518a2d59ac49fd4cd206912d95da76c1631d439c;p=thirdparty%2Fvalgrind.git Fix dfp tests. Due to changes between the compiler and linker, we need to add .machine arguments to configure file to properly detect the availability of the dfp instructions. Add print statement if HAS_DFP is not enabled to make it easier to determine when HAS_DFP is not enabled. --- diff --git a/configure.ac b/configure.ac index 463e05f172..27400ad1e5 100755 --- a/configure.ac +++ b/configure.ac @@ -1563,14 +1563,17 @@ AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \ -a x$HWCAP_HAS_VSX = xyes ]) # DFP (Decimal Float) +# The initial DFP support was added in Power 6. The dcffix instruction +# support was added in Power 7. AC_MSG_CHECKING([that assembler knows DFP]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ #ifdef __s390__ __asm__ __volatile__("adtr 1, 2, 3") #else - __asm__ __volatile__("dadd 1, 2, 3"); - __asm__ __volatile__("dcffix 1, 2"); +__asm__ __volatile__(".machine power7;\n" \ + "dadd 1, 2, 3;\n" \ + "dcffix 1, 2"); #endif ]])], [ ac_asm_have_dfp=yes @@ -1582,13 +1585,16 @@ AC_MSG_RESULT([no]) AC_MSG_CHECKING([that compiler knows -mhard-dfp switch]) safe_CFLAGS=$CFLAGS CFLAGS="-mhard-dfp -Werror" + +# The dcffix instruction is Power 7 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ #ifdef __s390__ __asm__ __volatile__("adtr 1, 2, 3") #else - __asm__ __volatile__("dadd 1, 2, 3"); - __asm__ __volatile__("dcffix 1, 2"); + __asm__ __volatile__(".machine power7;\n" \ + "dadd 1, 2, 3;\n" \ + "dcffix 1, 2"); #endif ]])], [ ac_compiler_have_dfp=yes diff --git a/none/tests/ppc32/test_dfp1.c b/none/tests/ppc32/test_dfp1.c index baf18419c7..a08f5dff8c 100644 --- a/none/tests/ppc32/test_dfp1.c +++ b/none/tests/ppc32/test_dfp1.c @@ -497,6 +497,8 @@ int main() { i++; } +#else + printf("HAS_DFP not detected.\n"); #endif // HAS_DFP return 0; } diff --git a/none/tests/ppc32/test_dfp2.c b/none/tests/ppc32/test_dfp2.c index 1563fb32b8..9ec325d6df 100644 --- a/none/tests/ppc32/test_dfp2.c +++ b/none/tests/ppc32/test_dfp2.c @@ -668,6 +668,8 @@ int main(int argc, char ** argv, char ** envp) { i++; } +#else + printf("HAS_DFP not detected.\n"); #endif // HAS_DFP return 0; } diff --git a/none/tests/ppc32/test_dfp3.c b/none/tests/ppc32/test_dfp3.c index f8596de38f..cb99538cd0 100644 --- a/none/tests/ppc32/test_dfp3.c +++ b/none/tests/ppc32/test_dfp3.c @@ -1256,6 +1256,8 @@ int main() { i++; } +#else + printf("HAS_DFP not detected.\n"); #endif // HAS_DFP return 0; } diff --git a/none/tests/ppc32/test_dfp4.c b/none/tests/ppc32/test_dfp4.c index bce9130f70..0aa3a5adb2 100644 --- a/none/tests/ppc32/test_dfp4.c +++ b/none/tests/ppc32/test_dfp4.c @@ -636,6 +636,8 @@ int main() { i++; } +#else + printf("HAS_DFP not detected.\n"); #endif // HAS_DFP return 0; } diff --git a/none/tests/ppc32/test_dfp5.c b/none/tests/ppc32/test_dfp5.c index 9af94b81f9..4c6e1fc8f5 100644 --- a/none/tests/ppc32/test_dfp5.c +++ b/none/tests/ppc32/test_dfp5.c @@ -605,6 +605,8 @@ int main() { i++; } +#else + printf("HAS_DFP not detected.\n"); #endif // HAS_DFP return 0; } diff --git a/none/tests/ppc64/test_dfp1.vgtest b/none/tests/ppc64/test_dfp1.vgtest index 71af5fa640..1939c55ec4 100644 --- a/none/tests/ppc64/test_dfp1.vgtest +++ b/none/tests/ppc64/test_dfp1.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap dfp +prereq: ../../../tests/check_ppc64_auxv_cap dfp && ../../../tests/check_ppc64_auxv_cap arch_2_06 prog: test_dfp1 diff --git a/none/tests/ppc64/test_dfp2.vgtest b/none/tests/ppc64/test_dfp2.vgtest index 23a1f00ede..7c3ce6fa6a 100644 --- a/none/tests/ppc64/test_dfp2.vgtest +++ b/none/tests/ppc64/test_dfp2.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap dfp +prereq: ../../../tests/check_ppc64_auxv_cap dfp && ../../../tests/check_ppc64_auxv_cap arch_2_06 prog: test_dfp2 diff --git a/none/tests/ppc64/test_dfp3.vgtest b/none/tests/ppc64/test_dfp3.vgtest index e806e85e21..cd5ac995b6 100644 --- a/none/tests/ppc64/test_dfp3.vgtest +++ b/none/tests/ppc64/test_dfp3.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap dfp +prereq: ../../../tests/check_ppc64_auxv_cap dfp && ../../../tests/check_ppc64_auxv_cap arch_2_06 prog: test_dfp3 diff --git a/none/tests/ppc64/test_dfp4.vgtest b/none/tests/ppc64/test_dfp4.vgtest index 7688eb8ac9..24e639d38b 100644 --- a/none/tests/ppc64/test_dfp4.vgtest +++ b/none/tests/ppc64/test_dfp4.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap dfp +prereq: ../../../tests/check_ppc64_auxv_cap dfp && ../../../tests/check_ppc64_auxv_cap arch_2_06 prog: test_dfp4 diff --git a/none/tests/ppc64/test_dfp5.vgtest b/none/tests/ppc64/test_dfp5.vgtest index 0c905d8d9e..4e79f4f10a 100644 --- a/none/tests/ppc64/test_dfp5.vgtest +++ b/none/tests/ppc64/test_dfp5.vgtest @@ -1,2 +1,2 @@ -prereq: ../../../tests/check_ppc64_auxv_cap dfp +prereq: ../../../tests/check_ppc64_auxv_cap dfp && ../../../tests/check_ppc64_auxv_cap arch_2_06 prog: test_dfp5