From e6c76d9fd44a5e7c42f10a4833a03cbb44edeb5d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Sep 2011 23:13:49 -0400 Subject: [PATCH] Clean up atomic cruft Nothing is using these defines anymore, and the messages are misleading. Based on a patch by Kean Johnston. https://bugzilla.gnome.org/show_bug.cgi?id=660013 --- config.h.win32.in | 32 ----------------- configure.ac | 90 ++--------------------------------------------- 2 files changed, 2 insertions(+), 120 deletions(-) diff --git a/config.h.win32.in b/config.h.win32.in index c90ebef52..ec43d2804 100644 --- a/config.h.win32.in +++ b/config.h.win32.in @@ -61,38 +61,6 @@ /* The size of system_thread, as computed by sizeof. */ #define GLIB_SIZEOF_SYSTEM_THREAD 4 -/* alpha atomic implementation */ -/* #undef G_ATOMIC_ALPHA */ - -/* arm atomic implementation */ -/* #undef G_ATOMIC_ARM */ - -/* cris atomic implementation */ -/* #undef G_ATOMIC_CRIS */ - -/* crisv32 atomic implementation */ -/* #undef G_ATOMIC_CRISV32 */ - -/* i486 atomic implementation */ -#ifndef _MSC_VER -#define G_ATOMIC_I486 1 -#endif /* _MSC_VER */ - -/* ia64 atomic implementation */ -/* #undef G_ATOMIC_IA64 */ - -/* powerpc atomic implementation */ -/* #undef G_ATOMIC_POWERPC */ - -/* s390 atomic implementation */ -/* #undef G_ATOMIC_S390 */ - -/* sparcv9 atomic implementation */ -/* #undef G_ATOMIC_SPARCV9 */ - -/* x86_64 atomic implementation */ -/* #undef G_ATOMIC_X86_64 */ - /* whether GCC supports built-in atomic intrinsics */ /* #undef HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS */ diff --git a/configure.ac b/configure.ac index 3515cb5e3..ed6cb2eb5 100644 --- a/configure.ac +++ b/configure.ac @@ -2455,100 +2455,14 @@ dnl ************************ dnl *** g_atomic_* tests *** dnl ************************ -AC_MSG_CHECKING([whether to use assembler code for atomic operations]) case $host_cpu in - i386) - AC_MSG_RESULT([none]) + i?86|x86_64|s390|s390x|arm*|crisv32*|etrax*) glib_memory_barrier_needed=no ;; - i?86) - AC_MSG_RESULT([i486]) - AC_DEFINE_UNQUOTED(G_ATOMIC_I486, 1, - [i486 atomic implementation]) - glib_memory_barrier_needed=no - ;; - sparc*) - SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9', - when you are using a sparc with v9 instruction set (most - sparcs nowadays). This will make the code for atomic - operations much faster. The resulting code will not run - on very old sparcs though." - - AC_LINK_IFELSE([AC_LANG_SOURCE([[ - main () - { - int tmp1, tmp2, tmp3; - __asm__ __volatile__("casx [%2], %0, %1" - : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3)); - }]])], - AC_MSG_RESULT([sparcv9]) - AC_DEFINE_UNQUOTED(G_ATOMIC_SPARCV9, 1, - [sparcv9 atomic implementation]), - AC_MSG_RESULT([no]) - AC_MSG_WARN([[$SPARCV9_WARNING]])) + sparc*|alpha*|powerpc*|ia64) glib_memory_barrier_needed=yes ;; - alpha*) - AC_MSG_RESULT([alpha]) - AC_DEFINE_UNQUOTED(G_ATOMIC_ALPHA, 1, - [alpha atomic implementation]) - glib_memory_barrier_needed=yes - ;; - x86_64) - AC_MSG_RESULT([x86_64]) - AC_DEFINE_UNQUOTED(G_ATOMIC_X86_64, 1, - [x86_64 atomic implementation]) - glib_memory_barrier_needed=no - ;; - powerpc*) - AC_MSG_RESULT([powerpc]) - AC_DEFINE_UNQUOTED(G_ATOMIC_POWERPC, 1, - [powerpc atomic implementation]) - glib_memory_barrier_needed=yes - AC_MSG_CHECKING([whether asm supports numbered local labels]) - AC_TRY_COMPILE( - ,[ - __asm__ __volatile__ ("1: nop\n" - " bne- 1b") - ],[ - AC_DEFINE_UNQUOTED(ASM_NUMERIC_LABELS, 1, [define if asm blocks can use numeric local labels]) - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - ]) - ;; - ia64) - AC_MSG_RESULT([ia64]) - AC_DEFINE_UNQUOTED(G_ATOMIC_IA64, 1, - [ia64 atomic implementation]) - glib_memory_barrier_needed=yes - ;; - s390|s390x) - AC_MSG_RESULT([s390]) - AC_DEFINE_UNQUOTED(G_ATOMIC_S390, 1, - [s390 atomic implementation]) - glib_memory_barrier_needed=no - ;; - arm*) - AC_MSG_RESULT([arm]) - AC_DEFINE_UNQUOTED(G_ATOMIC_ARM, 1, - [arm atomic implementation]) - glib_memory_barrier_needed=no - ;; - crisv32*|etraxfs*) - AC_MSG_RESULT([crisv32]) - AC_DEFINE_UNQUOTED(G_ATOMIC_CRISV32, 1, - [crisv32 atomic implementation]) - glib_memory_barrier_needed=no - ;; - cris*|etrax*) - AC_MSG_RESULT([cris]) - AC_DEFINE_UNQUOTED(G_ATOMIC_CRIS, 1, - [cris atomic implementation]) - glib_memory_barrier_needed=no - ;; *) - AC_MSG_RESULT([none]) glib_memory_barrier_needed=yes ;; esac