summaryrefslogtreecommitdiff
path: root/lib/libcompiler_rt/fixdfti.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcompiler_rt/fixdfti.c')
-rw-r--r--lib/libcompiler_rt/fixdfti.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/libcompiler_rt/fixdfti.c b/lib/libcompiler_rt/fixdfti.c
new file mode 100644
index 00000000000..aaf225e74f8
--- /dev/null
+++ b/lib/libcompiler_rt/fixdfti.c
@@ -0,0 +1,26 @@
+/* ===-- fixdfti.c - Implement __fixdfti -----------------------------------===
+ *
+ * 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.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#include "int_lib.h"
+
+#ifdef CRT_HAS_128BIT
+#define DOUBLE_PRECISION
+#include "fp_lib.h"
+
+typedef ti_int fixint_t;
+typedef tu_int fixuint_t;
+#include "fp_fixint_impl.inc"
+
+COMPILER_RT_ABI ti_int
+__fixdfti(fp_t a) {
+ return __fixint(a);
+}
+
+#endif /* CRT_HAS_128BIT */