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.
This commit is contained in:
Carl Love 2021-09-08 22:01:05 +00:00
parent 475916cbd3
commit 518a2d59ac
11 changed files with 25 additions and 9 deletions

View File

@ -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

View File

@ -497,6 +497,8 @@ int main() {
i++;
}
#else
printf("HAS_DFP not detected.\n");
#endif // HAS_DFP
return 0;
}

View 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;
}

View File

@ -1256,6 +1256,8 @@ int main() {
i++;
}
#else
printf("HAS_DFP not detected.\n");
#endif // HAS_DFP
return 0;
}

View File

@ -636,6 +636,8 @@ int main() {
i++;
}
#else
printf("HAS_DFP not detected.\n");
#endif // HAS_DFP
return 0;
}

View File

@ -605,6 +605,8 @@ int main() {
i++;
}
#else
printf("HAS_DFP not detected.\n");
#endif // HAS_DFP
return 0;
}

View 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

View 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

View 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

View 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

View 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