This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[SPARC] Tweak libgomp's cpu_relax


As discussed with DaveM, this duplicates libitm's cpu_relax into libgomp.

Tested on SPARC64/Linux, applied on the mainline.


2012-02-29  Eric Botcazou  <ebotcazou@adacore.com>

	* config/linux/sparc/futex.h (cpu_relax): Read from CC register.


-- 
Eric Botcazou
Index: config/linux/sparc/futex.h
===================================================================
--- config/linux/sparc/futex.h	(revision 184585)
+++ config/linux/sparc/futex.h	(working copy)
@@ -90,9 +90,5 @@ futex_wake (int *addr, int count)
 static inline void
 cpu_relax (void)
 {
-#if defined __arch64__ || defined  __sparc_v9__
-  __asm volatile ("membar #LoadLoad" : : : "memory");
-#else
-  __asm volatile ("" : : : "memory");
-#endif
+  __asm volatile ("rd %%ccr, %%g0" : : : "memory");
 }

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