[llvm-commits] [compiler-rt] r95132 - in /compiler-rt/trunk: lib/arm/sync_synchronize.S make/platform/darwin_bni.mk

Nick Kledzik kledzik at apple.com
Tue Feb 2 13:34:04 PST 2010


Author: kledzik
Date: Tue Feb  2 15:34:04 2010
New Revision: 95132

URL: http://llvm.org/viewvc/llvm-project?rev=95132&view=rev
Log:
add __sync_synchronize.  Needed by compiler when emitting thumb1 with -fno-builtin

Added:
    compiler-rt/trunk/lib/arm/sync_synchronize.S
Modified:
    compiler-rt/trunk/make/platform/darwin_bni.mk

Added: compiler-rt/trunk/lib/arm/sync_synchronize.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/sync_synchronize.S?rev=95132&view=auto

==============================================================================
--- compiler-rt/trunk/lib/arm/sync_synchronize.S (added)
+++ compiler-rt/trunk/lib/arm/sync_synchronize.S Tue Feb  2 15:34:04 2010
@@ -0,0 +1,33 @@
+//===-- sync_synchronize - Implement memory barrier * ----------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "../assembly.h"
+
+//
+// When compiling a use of the gcc built-in __sync_synchronize() in thumb1 mode
+// the compiler may emit a call to __sync_synchronize.  
+// On Darwin the implementation jumps to an OS supplied function named 
+// OSMemoryBarrier
+//
+
+	.text
+	.syntax unified
+
+#if __APPLE__
+
+DEFINE_COMPILERRT_PRIVATE_FUNCTION(__sync_synchronize)
+	stmfd	sp!, {r7, lr}
+	add		r7, sp, #0
+	bl		_OSMemoryBarrier
+	ldmfd	sp!, {r7, pc}
+
+	// tell linker it can break up file at label boundaries
+	.subsections_via_symbols
+		
+#endif

Modified: compiler-rt/trunk/make/platform/darwin_bni.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/darwin_bni.mk?rev=95132&r1=95131&r2=95132&view=diff

==============================================================================
--- compiler-rt/trunk/make/platform/darwin_bni.mk (original)
+++ compiler-rt/trunk/make/platform/darwin_bni.mk Tue Feb  2 15:34:04 2010
@@ -54,6 +54,7 @@
                 subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
                 modsi3 umodsi3 udivsi3 divsi3 \
 				switch8 switchu8 switch16 switch32 \
-				restore_vfp_d8_d15_regs save_vfp_d8_d15_regs
+				restore_vfp_d8_d15_regs save_vfp_d8_d15_regs \
+				sync_synchronize 
 
 VISIBILITY_HIDDEN := 0





More information about the llvm-commits mailing list