summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2011-04-19 18:14:19 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2011-04-19 18:14:19 +0000
commit0529d4da939c3306a2e4ae58a037b8b435dd812f (patch)
treea8c15336dcdc819d3222202e99e266d352af5564 /compiler-rt
parentd1d11c8c9f28daa7520f14cb16650557127431a0 (diff)
downloadbcm5719-llvm-0529d4da939c3306a2e4ae58a037b8b435dd812f.tar.gz
bcm5719-llvm-0529d4da939c3306a2e4ae58a037b8b435dd812f.zip
Add missed files from my last commit.
llvm-svn: 129777
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/abi.h23
-rw-r--r--compiler-rt/lib/divmoddi4.c30
2 files changed, 53 insertions, 0 deletions
diff --git a/compiler-rt/lib/abi.h b/compiler-rt/lib/abi.h
new file mode 100644
index 00000000000..2534317ac8f
--- /dev/null
+++ b/compiler-rt/lib/abi.h
@@ -0,0 +1,23 @@
+/* ===------ abi.h - configuration header for compiler-rt -----------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file is a configuration header for compiler-rt.
+ * This file is not part of the interface of this library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#if __ARM_EABI__
+# define ARM_EABI_FNALIAS(aeabi_name, name) \
+ void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
+# define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
+#else
+# define ARM_EABI_FNALIAS(aeabi_name, name)
+# define COMPILER_RT_ABI
+#endif
diff --git a/compiler-rt/lib/divmoddi4.c b/compiler-rt/lib/divmoddi4.c
new file mode 100644
index 00000000000..d3ca745ac69
--- /dev/null
+++ b/compiler-rt/lib/divmoddi4.c
@@ -0,0 +1,30 @@
+/*===-- divmoddi4.c - Implement __divmoddi4 --------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file implements __divmoddi4 for the compiler_rt library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+#include "abi.h"
+
+#include "int_lib.h"
+
+extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b);
+
+ARM_EABI_FNALIAS(ldivmod, divmoddi4);
+
+/* Returns: a / b, *rem = a % b */
+
+COMPILER_RT_ABI di_int
+__divmoddi4(di_int a, di_int b, di_int* rem)
+{
+ di_int d = __divdi3(a,b);
+ *rem = a - (d*b);
+ return d;
+}
OpenPOWER on IntegriCloud