From 7498d7676dc9ffb38fcb39635bae7c195740d6f7 Mon Sep 17 00:00:00 2001 From: Andrew Bennett Date: Mon, 24 Aug 2015 22:06:29 +0100 Subject: 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. --- sysdeps/mips/sys/tas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/mips/sys/tas.h') diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h index e14b5f04c1..2820ff6f05 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" -- cgit 1.4.1