This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Linuxthreads PPC64 sysdep-cancel.h
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 11 Dec 2003 16:01:10 -0600
- Subject: [PATCH] Linuxthreads PPC64 sysdep-cancel.h
- Organization: IBM LTC
- Reply-to: sjmunroe at vnet dot ibm dot com
The SINGLE_THREAD_P test is still defined using the static field
__local_multiple_threads which is less efficient then the thread local
reference to the p_multiple_threads field. Also as Jimi Xenidis points
out, the current code is incorrectly loading a int flag as a doubleword.
The attached patch replaces the two definitions of SINGLE_THREAD_P with
thread local test.
2003-12-04 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
(SINGLE_THREAD_P): Test using thread local p_multiple_threads field.
diff -urN libc23-cvstip-20031209/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h libc23/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
--- libc23-cvstip-20031209/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2003-06-17 17:22:57.000000000 -0500
+++ libc23/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h 2003-12-09 16:50:52.000000000 -0600
@@ -89,22 +89,12 @@
# endif
# ifndef __ASSEMBLER__
-extern int __local_multiple_threads
-# if !defined NOT_IN_libc || defined IS_IN_libpthread
- attribute_hidden;
-# else
- ;
-# endif
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
# else
-# define SINGLE_THREAD_P \
- .section ".toc","aw"; \
-.LC__local_multiple_threads:; \
- .tc __local_multiple_threads[TC],__local_multiple_threads; \
- .previous; \
- ld 10,.LC__local_multiple_threads@toc(2); \
- ld 10,0(10); \
- cmpdi 10,0
+# define SINGLE_THREAD_P \
+ lwz 10,MULTIPLE_THREADS_OFFSET(13); \
+ cmpwi 10,0
# endif
#elif !defined __ASSEMBLER__