[llvm-commits] [compiler-rt] r164903 - in /compiler-rt/trunk: lib/arm/Makefile.mk lib/arm/divsi3.S lib/arm/udivsi3.S make/platform/clang_darwin.mk make/platform/darwin_bni.mk
Bob Wilson
bob.wilson at apple.com
Sat Sep 29 16:37:01 PDT 2012
Author: bwilson
Date: Sat Sep 29 18:37:01 2012
New Revision: 164903
URL: http://llvm.org/viewvc/llvm-project?rev=164903&view=rev
Log:
Add compiler-rt support for Swift.
Modified:
compiler-rt/trunk/lib/arm/Makefile.mk
compiler-rt/trunk/lib/arm/divsi3.S
compiler-rt/trunk/lib/arm/udivsi3.S
compiler-rt/trunk/make/platform/clang_darwin.mk
compiler-rt/trunk/make/platform/darwin_bni.mk
Modified: compiler-rt/trunk/lib/arm/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/Makefile.mk?rev=164903&r1=164902&r2=164903&view=diff
==============================================================================
--- compiler-rt/trunk/lib/arm/Makefile.mk (original)
+++ compiler-rt/trunk/lib/arm/Makefile.mk Sat Sep 29 18:37:01 2012
@@ -9,7 +9,7 @@
ModuleName := builtins
SubDirs :=
-OnlyArchs := armv5 armv6 armv7
+OnlyArchs := armv5 armv6 armv7 armv7f armv7k armv7s
AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
Modified: compiler-rt/trunk/lib/arm/divsi3.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/divsi3.S?rev=164903&r1=164902&r2=164903&view=diff
==============================================================================
--- compiler-rt/trunk/lib/arm/divsi3.S (original)
+++ compiler-rt/trunk/lib/arm/divsi3.S Sat Sep 29 18:37:01 2012
@@ -25,7 +25,16 @@
// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3)
DEFINE_COMPILERRT_FUNCTION(__divsi3)
- ESTABLISH_FRAME
+#if __ARM_ARCH_7S__
+ tst r1,r1
+ beq LOCAL_LABEL(divzero)
+ sdiv r0, r0, r1
+ bx lr
+LOCAL_LABEL(divzero):
+ mov r0,#0
+ bx lr
+#else
+ESTABLISH_FRAME
// Set aside the sign of the quotient.
eor r4, r0, r1
// Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31).
@@ -39,3 +48,4 @@
eor r0, r0, r4, asr #31
sub r0, r0, r4, asr #31
CLEAR_FRAME_AND_RETURN
+#endif
Modified: compiler-rt/trunk/lib/arm/udivsi3.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/udivsi3.S?rev=164903&r1=164902&r2=164903&view=diff
==============================================================================
--- compiler-rt/trunk/lib/arm/udivsi3.S (original)
+++ compiler-rt/trunk/lib/arm/udivsi3.S Sat Sep 29 18:37:01 2012
@@ -33,6 +33,15 @@
// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3)
DEFINE_COMPILERRT_FUNCTION(__udivsi3)
+#if __ARM_ARCH_7S__
+ tst r1,r1
+ beq LOCAL_LABEL(divzero)
+ udiv r0, r0, r1
+ bx lr
+ LOCAL_LABEL(divzero):
+ mov r0,#0
+ bx lr
+#else
// We use a simple digit by digit algorithm; before we get into the actual
// divide loop, we must calculate the left-shift amount necessary to align
// the MSB of the divisor with that of the dividend (If this shift is
@@ -78,3 +87,4 @@
// Move the quotient to r0 and return.
mov r0, q
CLEAR_FRAME_AND_RETURN
+#endif
Modified: compiler-rt/trunk/make/platform/clang_darwin.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=164903&r1=164902&r2=164903&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_darwin.mk (original)
+++ compiler-rt/trunk/make/platform/clang_darwin.mk Sat Sep 29 18:37:01 2012
@@ -76,6 +76,11 @@
Configs += asan_osx_dynamic
UniversalArchs.asan_osx_dynamic := $(call CheckArches,i386 x86_64,asan_osx_dynamic)
+UniversalArchs.ios += $(call CheckArches,armv7f armv7k armv7s,ios)
+UniversalArchs.cc_kext += $(call CheckArches,armv7f armv7k armv7s,cc_kext)
+UniversalArchs.cc_kext_ios5 += $(call CheckArches,armv7f armv7k armv7s,cc_kext_ios5)
+UniversalArchs.profile_ios += $(call CheckArches,armv7f armv7k armv7s,profile_ios)
+
# If RC_SUPPORTED_ARCHS is defined, treat it as a list of the architectures we
# are intended to support and limit what we try to build to that.
#
@@ -123,17 +128,29 @@
CFLAGS.ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.ios.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.armv7 := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext.armv7f := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext.armv7k := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext.armv7s := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
CFLAGS.cc_kext_ios5.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext_ios5.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext_ios5.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext_ios5.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.profile_osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.profile_osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.profile_ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.profile_ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
CFLAGS.profile_ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.profile_ios.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.profile_ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.profile_ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
# Configure the asan_osx_dynamic library to be built shared.
SHARED_LIBRARY.asan_osx_dynamic := 1
@@ -306,7 +323,13 @@
unordsf2vfp
FUNCTIONS.cc_kext.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext.armv7f := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext.armv7k := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext.armv7s := $(CCKEXT_ARMVFP_FUNCTIONS)
FUNCTIONS.cc_kext_ios5.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext_ios5.armv7f := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext_ios5.armv7k := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext_ios5.armv7s := $(CCKEXT_ARMVFP_FUNCTIONS)
CCKEXT_X86_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \
divxc3 \
@@ -383,8 +406,20 @@
FUNCTIONS.cc_kext.armv7 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7))
+FUNCTIONS.cc_kext.armv7f := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7f))
+FUNCTIONS.cc_kext.armv7k := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7k))
+FUNCTIONS.cc_kext.armv7s := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7s))
FUNCTIONS.cc_kext_ios5.armv7 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios5.armv7))
+FUNCTIONS.cc_kext_ios5.armv7f := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios5.armv7f))
+FUNCTIONS.cc_kext_ios5.armv7k := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios5.armv7k))
+FUNCTIONS.cc_kext_ios5.armv7s := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios5.armv7s))
FUNCTIONS.cc_kext.i386 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.i386))
FUNCTIONS.cc_kext.x86_64 := \
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=164903&r1=164902&r2=164903&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/darwin_bni.mk (original)
+++ compiler-rt/trunk/make/platform/darwin_bni.mk Sat Sep 29 18:37:01 2012
@@ -111,3 +111,6 @@
nedf2vfp nesf2vfp \
subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4
+
+FUNCTIONS.armv7s := $(FUNCTIONS.armv7)
+
More information about the llvm-commits
mailing list