summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/trunctfsf2.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
commit5038cb2963975d6b6279ff5656473d98a3129f67 (patch)
tree22bd588ad2d44c4a8174f22e57428827673f15c7 /compiler-rt/lib/builtins/trunctfsf2.c
parent7610e8c82288980001dd56994157596ff1c04beb (diff)
downloadbcm5719-llvm-5038cb2963975d6b6279ff5656473d98a3129f67.tar.gz
bcm5719-llvm-5038cb2963975d6b6279ff5656473d98a3129f67.zip
Implement __trunctfdf2 and __trunctfsf2 for IEEE quad precision.
Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D2803 llvm-svn: 209782
Diffstat (limited to 'compiler-rt/lib/builtins/trunctfsf2.c')
-rw-r--r--compiler-rt/lib/builtins/trunctfsf2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/lib/builtins/trunctfsf2.c b/compiler-rt/lib/builtins/trunctfsf2.c
new file mode 100644
index 00000000000..de96c1decf6
--- /dev/null
+++ b/compiler-rt/lib/builtins/trunctfsf2.c
@@ -0,0 +1,22 @@
+//===-- lib/trunctfsf2.c - quad -> single 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_SINGLE
+#include "fp_trunc_impl.inc"
+
+COMPILER_RT_ABI float __trunctfsf2(long double a) {
+ return __truncXfYf2__(a);
+}
+
+#endif
OpenPOWER on IntegriCloud