summaryrefslogtreecommitdiff
path: root/lib/builtins/trunctfdf2.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2014-05-29 00:58:27 +0000
committerJoerg Sonnenberger <joerg@bec.de>2014-05-29 00:58:27 +0000
commitd891c7d7b7ccb5469ad3b71f5942fa52d1d9c526 (patch)
treea1716073b6f1e538b7b6bb5cbd8814ce30288172 /lib/builtins/trunctfdf2.c
parent9883e32ad6650a978c7602ba32ed39cac03d3270 (diff)
downloadcompiler-rt-d891c7d7b7ccb5469ad3b71f5942fa52d1d9c526.tar.gz
Implement __trunctfdf2 and __trunctfsf2 for IEEE quad precision.
Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D2803 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/trunctfdf2.c')
-rw-r--r--lib/builtins/trunctfdf2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/builtins/trunctfdf2.c b/lib/builtins/trunctfdf2.c
new file mode 100644
index 000000000..741a71b33
--- /dev/null
+++ b/lib/builtins/trunctfdf2.c
@@ -0,0 +1,22 @@
+//===-- lib/truncdfsf2.c - quad -> double conversion --------------*- C -*-===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
+#define SRC_QUAD
+#define DST_DOUBLE
+#include "fp_trunc_impl.inc"
+
+COMPILER_RT_ABI double __trunctfdf2(long double a) {
+ return __truncXfYf2__(a);
+}
+
+#endif