summaryrefslogtreecommitdiffstats
path: root/contrib/compiler-rt/lib/builtins/truncsfhf2.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-09-10 20:35:47 +0000
committerdim <dim@FreeBSD.org>2015-09-10 20:35:47 +0000
commit27c642b88ff253dca67f6dc0ca8ef4da0e9b7eb4 (patch)
treef8f8e6ce180ca5204b650ff6315e6e0893f9a679 /contrib/compiler-rt/lib/builtins/truncsfhf2.c
parent0c1fa3e6ad5b7fd602181bc094d752a27ea34568 (diff)
parent3da1400d07e473463df86668e1e50da8b02618fa (diff)
downloadFreeBSD-src-27c642b88ff253dca67f6dc0ca8ef4da0e9b7eb4.zip
FreeBSD-src-27c642b88ff253dca67f6dc0ca8ef4da0e9b7eb4.tar.gz
Update compiler-rt to 3.7.0 release. This also includes the sanitizer
and profile libraries.
Diffstat (limited to 'contrib/compiler-rt/lib/builtins/truncsfhf2.c')
-rw-r--r--contrib/compiler-rt/lib/builtins/truncsfhf2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/compiler-rt/lib/builtins/truncsfhf2.c b/contrib/compiler-rt/lib/builtins/truncsfhf2.c
new file mode 100644
index 0000000..381e590
--- /dev/null
+++ b/contrib/compiler-rt/lib/builtins/truncsfhf2.c
@@ -0,0 +1,22 @@
+//===-- lib/truncsfhf2.c - single -> half 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 SRC_SINGLE
+#define DST_HALF
+#include "fp_trunc_impl.inc"
+
+// Use a forwarding definition and noinline to implement a poor man's alias,
+// as there isn't a good cross-platform way of defining one.
+COMPILER_RT_ABI __attribute__((noinline)) uint16_t __truncsfhf2(float a) {
+ return __truncXfYf2__(a);
+}
+
+COMPILER_RT_ABI uint16_t __gnu_f2h_ieee(float a) {
+ return __truncsfhf2(a);
+}
OpenPOWER on IntegriCloud