glibc/sysdeps
Adhemerval Zanella 85c828a462 x86_64: Remove wrong THREAD_ATOMIC_* macros
The x86 defines optimized THREAD_ATOMIC_* macros where reference always
the current thread instead of the one indicated by input 'descr' argument.
It work as long the input is the self thread pointer, however it generates
wrong code if the semantic is to set a bit atomicialy from another thread.

This is not an issue for current GLIBC usage, however the new cancellation
code expects that some synchronization code to atomically set bits from
different threads.

The generic code generates an additional load to reference to TLS segment,
for instance the code:

  THREAD_ATOMIC_BIT_SET (THREAD_SELF, cancelhandling, CANCELED_BIT);

Compiles to:

  lock;orl $4, %fs:776

Where with patch changes it now compiles to:

  mov %fs:16,%rax
  lock;orl $4, 776(%rax)

If some usage indeed proves to be a hotspot we can add an extra macro
with a more descriptive name (THREAD_ATOMIC_BIT_SET_SELF for instance)
where x86_64 might optimize it.

Checked on x86_64-linux-gnu.

	* sysdeps/x86_64/nptl/tls.h (THREAD_ATOMIC_CMPXCHG_VAL,
	THREAD_ATOMIC_AND, THREAD_ATOMIC_BIT_SET): Remove macros.
2019-01-03 18:38:14 -02:00
..
aarch64 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
alpha Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
arm Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
csky Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
generic nptl: Remove tst-cancel-wrappers test and related macros 2019-01-03 18:38:08 -02:00
gnu Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
hppa Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
htl hurd: advertise *_setpshared as not supported 2019-01-02 22:21:34 +01:00
hurd Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
i386 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ia64 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ieee754 Use C99-compliant scanf under _GNU_SOURCE with modern compilers. 2019-01-03 11:12:39 -05:00
init_array Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
m68k Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mach nptl: Remove tst-cancel-wrappers test and related macros 2019-01-03 18:38:08 -02:00
microblaze Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mips Update MIPS libm-test-ulps. 2019-01-02 17:25:33 +00:00
nios2 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
nptl Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
posix nptl: Remove tst-cancel-wrappers test and related macros 2019-01-03 18:38:08 -02:00
powerpc Update powerpc-nofpu libm-test-ulps. 2019-01-02 22:38:47 +00:00
pthread Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
riscv Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
s390 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sh Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sparc Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
unix nptl: Remove tst-cancel-wrappers test and related macros 2019-01-03 18:38:08 -02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
x86 Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
x86_64 x86_64: Remove wrong THREAD_ATOMIC_* macros 2019-01-03 18:38:14 -02:00