[llvm-commits] [compiler-rt] r129777 - in /compiler-rt/trunk/lib: abi.h divmoddi4.c

Anton Korobeynikov asl at math.spbu.ru
Tue Apr 19 11:14:19 PDT 2011


Author: asl
Date: Tue Apr 19 13:14:19 2011
New Revision: 129777

URL: http://llvm.org/viewvc/llvm-project?rev=129777&view=rev
Log:
Add missed files from my last commit.

Added:
    compiler-rt/trunk/lib/abi.h
    compiler-rt/trunk/lib/divmoddi4.c

Added: compiler-rt/trunk/lib/abi.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/abi.h?rev=129777&view=auto
==============================================================================
--- compiler-rt/trunk/lib/abi.h (added)
+++ compiler-rt/trunk/lib/abi.h Tue Apr 19 13:14:19 2011
@@ -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

Added: compiler-rt/trunk/lib/divmoddi4.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/divmoddi4.c?rev=129777&view=auto
==============================================================================
--- compiler-rt/trunk/lib/divmoddi4.c (added)
+++ compiler-rt/trunk/lib/divmoddi4.c Tue Apr 19 13:14:19 2011
@@ -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;
+}





More information about the llvm-commits mailing list