diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/c.h | 18 | ||||
| -rw-r--r-- | src/include/port/aix.h | 14 | ||||
| -rw-r--r-- | src/include/port/atomics.h | 6 | ||||
| -rw-r--r-- | src/include/storage/s_lock.h | 31 |
4 files changed, 16 insertions, 53 deletions
diff --git a/src/include/c.h b/src/include/c.h index 2e3ea206e1c..cf37e02fe1f 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -105,8 +105,6 @@ * GCC: https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html * Clang: https://clang.llvm.org/docs/AttributeReference.html * Sunpro: https://docs.oracle.com/cd/E18659_01/html/821-1384/gjzke.html - * XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/function_attributes.html - * XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/type_attrib.html */ /* @@ -171,8 +169,8 @@ #define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused() #endif -/* GCC and XLC support format attributes */ -#if defined(__GNUC__) || defined(__IBMC__) +/* GCC supports format attributes */ +#if defined(__GNUC__) #define pg_attribute_format_arg(a) __attribute__((format_arg(a))) #define pg_attribute_printf(f,a) __attribute__((format(PG_PRINTF_ATTRIBUTE, f, a))) #else @@ -180,8 +178,8 @@ #define pg_attribute_printf(f,a) #endif -/* GCC, Sunpro and XLC support aligned, packed and noreturn */ -#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) +/* GCC and Sunpro support aligned, packed and noreturn */ +#if defined(__GNUC__) || defined(__SUNPRO_C) #define pg_attribute_aligned(a) __attribute__((aligned(a))) #define pg_attribute_noreturn() __attribute__((noreturn)) #define pg_attribute_packed() __attribute__((packed)) @@ -212,8 +210,8 @@ * choose not to. But, if possible, don't force inlining in unoptimized * debug builds. */ -#if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) || defined(__IBMC__) -/* GCC > 3, Sunpro and XLC support always_inline via __attribute__ */ +#if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) +/* GCC > 3 and Sunpro support always_inline via __attribute__ */ #define pg_attribute_always_inline __attribute__((always_inline)) inline #elif defined(_MSC_VER) /* MSVC has a special keyword for this */ @@ -229,8 +227,8 @@ * for proper cost attribution. Note that unlike the pg_attribute_XXX macros * above, this should be placed before the function's return type and name. */ -/* GCC, Sunpro and XLC support noinline via __attribute__ */ -#if (defined(__GNUC__) && __GNUC__ > 2) || defined(__SUNPRO_C) || defined(__IBMC__) +/* GCC and Sunpro support noinline via __attribute__ */ +#if (defined(__GNUC__) && __GNUC__ > 2) || defined(__SUNPRO_C) #define pg_noinline __attribute__((noinline)) /* msvc via declspec */ #elif defined(_MSC_VER) diff --git a/src/include/port/aix.h b/src/include/port/aix.h deleted file mode 100644 index 5b1159c5785..00000000000 --- a/src/include/port/aix.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * src/include/port/aix.h - */ -#define CLASS_CONFLICT -#define DISABLE_XOPEN_NLS - -/* - * "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline - * expansions of ginCompareItemPointers() "long long" arithmetic. To take - * advantage of inlining, build a 64-bit PostgreSQL. - */ -#if defined(__ILP32__) && defined(__IBMC__) -#define PG_FORCE_DISABLE_INLINE -#endif diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h index bf151037f72..504349080d4 100644 --- a/src/include/port/atomics.h +++ b/src/include/port/atomics.h @@ -84,11 +84,9 @@ * using compiler intrinsics are a good idea. */ /* - * gcc or compatible, including clang and icc. Exclude xlc. The ppc64le "IBM - * XL C/C++ for Linux, V13.1.2" emulates gcc, but __sync_lock_test_and_set() - * of one-byte types elicits SIGSEGV. That bug was gone by V13.1.5 (2016-12). + * gcc or compatible, including clang and icc. */ -#if (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__IBMC__) || defined(__IBMCPP__)) +#if defined(__GNUC__) || defined(__INTEL_COMPILER) #include "port/atomics/generic-gcc.h" #elif defined(_MSC_VER) #include "port/atomics/generic-msvc.h" diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 69582f4ae71..29ac6cdcd92 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -414,12 +414,6 @@ typedef unsigned int slock_t; * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. * But if the spinlock is in ordinary memory, we can use lwsync instead for * better performance. - * - * Ordinarily, we'd code the branches here using GNU-style local symbols, that - * is "1f" referencing "1:" and so on. But some people run gcc on AIX with - * IBM's assembler as backend, and IBM's assembler doesn't do local symbols. - * So hand-code the branch offsets; fortunately, all PPC instructions are - * exactly 4 bytes each, so it's not too hard to count. */ static __inline__ int tas(volatile slock_t *lock) @@ -430,15 +424,17 @@ tas(volatile slock_t *lock) __asm__ __volatile__( " lwarx %0,0,%3,1 \n" " cmpwi %0,0 \n" -" bne $+16 \n" /* branch to li %1,1 */ +" bne 1f \n" " addi %0,%0,1 \n" " stwcx. %0,0,%3 \n" -" beq $+12 \n" /* branch to lwsync */ +" beq 2f \n" +"1: \n" " li %1,1 \n" -" b $+12 \n" /* branch to end of asm sequence */ +" b 3f \n" +"2: \n" " lwsync \n" " li %1,0 \n" - +"3: \n" : "=&b"(_t), "=r"(_res), "+m"(*lock) : "r"(lock) : "memory", "cc"); @@ -666,21 +662,6 @@ tas(volatile slock_t *lock) #if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */ -#if defined(_AIX) /* AIX */ -/* - * AIX (POWER) - */ -#define HAS_TEST_AND_SET - -#include <sys/atomic_op.h> - -typedef int slock_t; - -#define TAS(lock) _check_lock((slock_t *) (lock), 0, 1) -#define S_UNLOCK(lock) _clear_lock((slock_t *) (lock), 0) -#endif /* _AIX */ - - /* These are in sunstudio_(sparc|x86).s */ #if defined(__SUNPRO_C) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc)) |
