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:
34
configure
vendored
34
configure
vendored
@ -15349,39 +15349,7 @@ $as_echo "#define HAVE_X86_64_POPCNTQ 1" >>confdefs.h
|
||||
fi
|
||||
;;
|
||||
ppc*|powerpc*)
|
||||
# On PPC, check if assembler supports LWARX instruction's mutex hint bit
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
|
||||
$as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
|
||||
if ${pgac_cv_have_ppc_mutex_hint+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int a = 0; int *p = &a; int r;
|
||||
__asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
pgac_cv_have_ppc_mutex_hint=yes
|
||||
else
|
||||
pgac_cv_have_ppc_mutex_hint=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
|
||||
$as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
|
||||
if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
|
||||
|
||||
$as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
|
||||
|
||||
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).
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __builtin_constant_p(x) implies \"i\"(x) acceptance" >&5
|
||||
$as_echo_n "checking whether __builtin_constant_p(x) implies \"i\"(x) acceptance... " >&6; }
|
||||
if ${pgac_cv_have_i_constraint__builtin_constant_p+:} false; then :
|
||||
|
Reference in New Issue
Block a user