mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove configurability of PPC spinlock assembly code.
Assume that we can use LWARX hint flags and the LWSYNC instruction on any PPC machine. The check on the assembler's behavior was only needed for Apple's old assembler, which is no longer of interest now that we've de-supported all PPC-era versions of macOS (thanks to them not having clock_gettime()). Also, given an up-to-date assembler these instructions work even on Apple's old hardware. It seems quite unlikely that anyone would be interested in running current Postgres on PPC hardware that's so old as to not have these instructions. Hence, rip out associated configure test and manual configuration options, and just use the modernized instructions all the time. Also, update atomics/arch-ppc.h to use these instructions as well. (It was already using LWSYNC unconditionally in another place, providing further proof that nobody is using PG on hardware old enough to have a problem with that.) Discussion: https://postgr.es/m/166622.1660323391@sss.pgh.pa.us
This commit is contained in:
13
configure.ac
13
configure.ac
@ -1678,18 +1678,7 @@ case $host_cpu in
|
||||
fi
|
||||
;;
|
||||
ppc*|powerpc*)
|
||||
# On PPC, check if assembler supports LWARX instruction's mutex hint bit
|
||||
AC_CACHE_CHECK([whether assembler supports lwarx hint bit],
|
||||
[pgac_cv_have_ppc_mutex_hint],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
|
||||
[int a = 0; int *p = &a; int r;
|
||||
__asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));])],
|
||||
[pgac_cv_have_ppc_mutex_hint=yes],
|
||||
[pgac_cv_have_ppc_mutex_hint=no])])
|
||||
if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
|
||||
AC_DEFINE(HAVE_PPC_LWARX_MUTEX_HINT, 1, [Define to 1 if the assembler supports PPC's LWARX mutex hint bit.])
|
||||
fi
|
||||
# Check if compiler accepts "i"(x) when __builtin_constant_p(x).
|
||||
# On PPC, check if compiler accepts "i"(x) when __builtin_constant_p(x).
|
||||
AC_CACHE_CHECK([whether __builtin_constant_p(x) implies "i"(x) acceptance],
|
||||
[pgac_cv_have_i_constraint__builtin_constant_p],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||
|
Reference in New Issue
Block a user