This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-219-g7498d76


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7498d7676dc9ffb38fcb39635bae7c195740d6f7 (commit)
      from  697ed91ca901f8e2ce3ba2b7cf69cdb18c8b37ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7498d7676dc9ffb38fcb39635bae7c195740d6f7

commit 7498d7676dc9ffb38fcb39635bae7c195740d6f7
Author: Andrew Bennett <andrew.bennett@imgtec.com>
Date:   Mon Aug 24 22:06:29 2015 +0100

    MIPS: Only use .set mips* assembler directives when necessary
    
    There are a few .set mips* assembler directives used in the MIPS specific
    sysdep code that force an instruction to be assembled for a specific ISA.
    The reason for these is to allow an instruction to be encoded when it might
    not be supported in the current ISA (when the code is run the Linux kernel
    will trap and emulate any unsupported instructions).  Unfortunately forcing
    a specific ISA means that when assembling for a newer ISA, where the
    instruction has a different encoding, the wrong encoding will be used.
    
            * sysdeps/mips/bits/atomic.h [_MIPS_SIM == _ABIO32] (MIPS_PUSH_MIPS2):
            Only use .set mips2 if the current ISA is below mips2.
            * sysdeps/mips/sys/tas.h [_MIPS_SIM == _ABIO32] (_test_and_set):
            Likewise.
            * sysdeps/mips/nptl/tls.h (READ_THREAD_POINTER): Only use .set
            mips32r2 if the current ISA is below mips32r2.
            * sysdeps/mips/tls-macros.h (TLS_RDHWR): New define.
            (TLS_IE): Updated to use the TLD_RDHWR macro.
            (TLS_LE): Likewise.
            * sysdeps/unix/mips/sysdep.h (__mips_isa_rev): Moved out of #ifdef
            __ASSEMBLER__ condition.

diff --git a/ChangeLog b/ChangeLog
index 7316777..f36e174 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2015-09-08  Andrew Bennett  <andrew.bennett@imgtec.com>
+
+	* sysdeps/mips/bits/atomic.h [_MIPS_SIM == _ABIO32] (MIPS_PUSH_MIPS2):
+	Only use .set mips2 if the current ISA is below mips2.
+	* sysdeps/mips/sys/tas.h [_MIPS_SIM == _ABIO32] (_test_and_set):
+	Likewise.
+	* sysdeps/mips/nptl/tls.h (READ_THREAD_POINTER): Only use .set
+	mips32r2 if the current ISA is below mips32r2.
+	* sysdeps/mips/tls-macros.h (TLS_RDHWR): New define.
+	(TLS_IE): Updated to use the TLD_RDHWR macro.
+	(TLS_LE): Likewise.
+	* sysdeps/unix/mips/sysdep.h (__mips_isa_rev): Moved out of #ifdef
+	__ASSEMBLER__ condition.
+
 2015-09-08  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	Fix parallel build of before-compile targets.
diff --git a/sysdeps/mips/bits/atomic.h b/sysdeps/mips/bits/atomic.h
index a391881..3754489 100644
--- a/sysdeps/mips/bits/atomic.h
+++ b/sysdeps/mips/bits/atomic.h
@@ -38,7 +38,7 @@ typedef uintptr_t uatomicptr_t;
 typedef intmax_t atomic_max_t;
 typedef uintmax_t uatomic_max_t;
 
-#if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32 && __mips < 2
 #define MIPS_PUSH_MIPS2 ".set	mips2\n\t"
 #else
 #define MIPS_PUSH_MIPS2
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
index ef11457..e69c397 100644
--- a/sysdeps/mips/nptl/tls.h
+++ b/sysdeps/mips/nptl/tls.h
@@ -25,6 +25,8 @@
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
+/* Get system call information.  */
+# include <sysdep.h>
 
 /* Type for the dtv.  */
 typedef union dtv
@@ -42,29 +44,37 @@ typedef union dtv
 # define READ_THREAD_POINTER() (__builtin_thread_pointer ())
 #else
 /* Note: rd must be $v1 to be ABI-conformant.  */
-# define READ_THREAD_POINTER() \
-    ({ void *__result;							      \
-       asm volatile (".set\tpush\n\t.set\tmips32r2\n\t"			      \
-		     "rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result));	      \
-       __result; })
+# if __mips_isa_rev >= 2
+#  define READ_THREAD_POINTER() \
+     ({ void *__result;							      \
+        asm volatile ("rdhwr\t%0, $29" : "=v" (__result));	      	      \
+        __result; })
+# else
+#  define READ_THREAD_POINTER() \
+     ({ void *__result;							      \
+        asm volatile (".set\tpush\n\t.set\tmips32r2\n\t"			      \
+		      "rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result));	      \
+        __result; })
+# endif
 #endif
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
 
-# define READ_THREAD_POINTER(rd) \
-	.set	push;							      \
-	.set	mips32r2;						      \
-	rdhwr	rd, $29;						      \
-	.set	pop
+# if __mips_isa_rev >= 2
+#  define READ_THREAD_POINTER(rd) rdhwr	rd, $29
+# else
+#  define READ_THREAD_POINTER(rd) \
+	 .set	push;							      \
+	 .set	mips32r2;						      \
+	 rdhwr	rd, $29;						      \
+	 .set	pop
+# endif
 #endif /* __ASSEMBLER__ */
 
 
 #ifndef __ASSEMBLER__
 
-/* Get system call information.  */
-# include <sysdep.h>
-
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP	1
 # define TLS_TCB_AT_TP	0
diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h
index e14b5f0..2820ff6 100644
--- a/sysdeps/mips/sys/tas.h
+++ b/sysdeps/mips/sys/tas.h
@@ -41,7 +41,7 @@ __NTH (_test_and_set (int *__p, int __v))
   __asm__ __volatile__
     ("/* Inline test and set */\n"
      ".set	push\n\t"
-#if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32 && __mips < 2
      ".set	mips2\n\t"
 #endif
      "sync\n\t"
diff --git a/sysdeps/mips/tls-macros.h b/sysdeps/mips/tls-macros.h
index 3e87e42..a6fdfbc 100644
--- a/sysdeps/mips/tls-macros.h
+++ b/sysdeps/mips/tls-macros.h
@@ -2,6 +2,7 @@
 
 #include <sys/cdefs.h>
 #include <sys/asm.h>
+#include <sysdep.h>
 
 #define __STRING2(X) __STRING(X)
 #define ADDU __STRING2(PTR_ADDU)
@@ -38,6 +39,14 @@
 # define UNLOAD_GP
 #endif
 
+# if __mips_isa_rev >= 2
+#  define TLS_RDHWR "rdhwr\t%0,$29"
+# else
+#  define TLS_RDHWR 					\
+	  ".set push\n\t.set mips32r2\n\t"		\
+	  "rdhwr\t%0,$29\n\t.set pop"
+#endif
+
 #ifndef __mips16
 # define TLS_GD(x)					\
   ({ void *__result, *__tmp;				\
@@ -60,8 +69,7 @@
      __result; })
 # define TLS_IE(x)					\
   ({ void *__result, *__tmp;				\
-     asm (".set push\n\t.set mips32r2\n\t"		\
-	  "rdhwr\t%0,$29\n\t.set pop"			\
+     asm (TLS_RDHWR					\
 	  : "=v" (__result));				\
      asm (LOAD_GP LW " $3,%%gottprel(" #x ")($28)\n\t"	\
 	  ADDU " %0,%0,$3"				\
@@ -71,8 +79,7 @@
      __result; })
 # define TLS_LE(x)					\
   ({ void *__result;					\
-     asm (".set push\n\t.set mips32r2\n\t"		\
-	  "rdhwr\t%0,$29\n\t.set pop"			\
+     asm (TLS_RDHWR					\
 	  : "=v" (__result));				\
      asm ("lui $3,%%tprel_hi(" #x ")\n\t"		\
 	  "addiu $3,$3,%%tprel_lo(" #x ")\n\t"		\
diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h
index 4fd58f7..08595cc 100644
--- a/sysdeps/unix/mips/sysdep.h
+++ b/sysdeps/unix/mips/sysdep.h
@@ -19,6 +19,10 @@
 #include <sgidefs.h>
 #include <sysdeps/unix/sysdep.h>
 
+#ifndef __mips_isa_rev
+# define __mips_isa_rev 0
+#endif
+
 #ifdef __ASSEMBLER__
 
 #include <regdef.h>
@@ -78,8 +82,4 @@
 # define L(label) .L ## label
 #endif
 
-#ifndef __mips_isa_rev
-# define __mips_isa_rev 0
-#endif
-
 #endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   14 ++++++++++++++
 sysdeps/mips/bits/atomic.h |    2 +-
 sysdeps/mips/nptl/tls.h    |   36 +++++++++++++++++++++++-------------
 sysdeps/mips/sys/tas.h     |    2 +-
 sysdeps/mips/tls-macros.h  |   15 +++++++++++----
 sysdeps/unix/mips/sysdep.h |    8 ++++----
 6 files changed, 54 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]