aboutsummaryrefslogtreecommitdiff
path: root/lib/modsi3.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/modsi3.c')
-rw-r--r--lib/modsi3.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/modsi3.c b/lib/modsi3.c
new file mode 100644
index 000000000000..c9214a24f39b
--- /dev/null
+++ b/lib/modsi3.c
@@ -0,0 +1,23 @@
+/* ===-- modsi3.c - Implement __modsi3 -------------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file implements __modsi3 for the compiler_rt library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#include "int_lib.h"
+
+/* Returns: a % b */
+
+si_int
+__modsi3(si_int a, si_int b)
+{
+ return a - (a / b) * b;
+}