aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt/lib/builtins/fixdfti.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/builtins/fixdfti.c')
-rw-r--r--compiler-rt/lib/builtins/fixdfti.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler-rt/lib/builtins/fixdfti.c b/compiler-rt/lib/builtins/fixdfti.c
new file mode 100644
index 000000000000..90ca8959dae1
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixdfti.c
@@ -0,0 +1,21 @@
+//===-- fixdfti.c - Implement __fixdfti -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#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