]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix dfp tests.
authorCarl Love <cel@us.ibm.com>
Wed, 8 Sep 2021 22:01:05 +0000 (22:01 +0000)
committerCarl Love <cel@us.ibm.com>
Thu, 30 Sep 2021 22:30:13 +0000 (17:30 -0500)
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.

configure.ac
none/tests/ppc32/test_dfp1.c
none/tests/ppc32/test_dfp2.c
none/tests/ppc32/test_dfp3.c
none/tests/ppc32/test_dfp4.c
none/tests/ppc32/test_dfp5.c
none/tests/ppc64/test_dfp1.vgtest
none/tests/ppc64/test_dfp2.vgtest
none/tests/ppc64/test_dfp3.vgtest
none/tests/ppc64/test_dfp4.vgtest
none/tests/ppc64/test_dfp5.vgtest

index 463e05f17209559be9dd8e8710cce12f51ba04c0..27400ad1e59fd0b37fdfbe97110fd5727107fd52 100755 (executable)
@@ -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
index baf18419c75ce04bc1c9c8518cef43f2a9169202..a08f5dff8cb6c5e0b04696b01ce614c83bcfe188 100644 (file)
@@ -497,6 +497,8 @@ int main() {
       i++;
    }
 
+#else
+   printf("HAS_DFP not detected.\n");
 #endif // HAS_DFP
    return 0;
 }
index 1563fb32b860908c0cc99b05107e5aa28445423b..9ec325d6df8a56791953fe56f57b81876354914d 100644 (file)
@@ -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;
 }
index f8596de38f366bbb9b4faf5fdfb4cf9627940af5..cb99538cd0aba9778dbd353f261c0636f88c36f0 100644 (file)
@@ -1256,6 +1256,8 @@ int main() {
       i++;
    }
 
+#else
+   printf("HAS_DFP not detected.\n");
 #endif // HAS_DFP
    return 0;
 }
index bce9130f709485ea3d5f04139e914ed51864f7b2..0aa3a5adb2bff92efe74338ffaf450ad75a3181a 100644 (file)
@@ -636,6 +636,8 @@ int main() {
       i++;
    }
 
+#else
+   printf("HAS_DFP not detected.\n");
 #endif // HAS_DFP
    return 0;
 }
index 9af94b81f98113db0553588da263a4f707c3c573..4c6e1fc8f59e44c7119e7c292e30aa5dcc5caa47 100644 (file)
@@ -605,6 +605,8 @@ int main() {
       i++;
    }
 
+#else
+   printf("HAS_DFP not detected.\n");
 #endif // HAS_DFP
    return 0;
 }
index 71af5fa64055ae8c6cf306e3b40b9ae3b1c48689..1939c55ec4e9ea1e94dbbab54c14e5162e3fcc79 100644 (file)
@@ -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
index 23a1f00ede63dc7aebba4adf07cb92097d40cee0..7c3ce6fa6af8cbe0bb72f404c4b49c85cdf7a1e3 100644 (file)
@@ -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
index e806e85e21574c3b3871d24e746d662277463fd8..cd5ac995b697c2004f02d7d1c7c8bc312d88ff31 100644 (file)
@@ -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
index 7688eb8ac96bf5b2c2ff16344e3f381752903aed..24e639d38b1306869c5efac85ca1120cecb934fe 100644 (file)
@@ -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
index 0c905d8d9e62727932d5585e39fde8fccc9091e5..4e79f4f10a6b371e034acacbd3a388cde6f195f9 100644 (file)
@@ -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