aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/runtime.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-05-24 20:44:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-05-24 20:44:34 +0000
commit86ba147f547e44230075efab78252c08bc8d8c2e (patch)
tree6376f98a68555af3b62356fcc2d0f7b310afa452 /libgo/runtime/runtime.c
parent6fac31b418c9bbceaaab53ef8e4be166609bda4a (diff)
downloadgcc-86ba147f547e44230075efab78252c08bc8d8c2e.zip
gcc-86ba147f547e44230075efab78252c08bc8d8c2e.tar.gz
gcc-86ba147f547e44230075efab78252c08bc8d8c2e.tar.bz2
runtime: Copy runtime_printf from other Go library.
From-SVN: r187848
Diffstat (limited to 'libgo/runtime/runtime.c')
-rw-r--r--libgo/runtime/runtime.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c
index 3c8d762..72875fd 100644
--- a/libgo/runtime/runtime.c
+++ b/libgo/runtime/runtime.c
@@ -236,3 +236,15 @@ runtime_showframe(const unsigned char *s)
traceback = runtime_gotraceback();
return traceback > 1 || (__builtin_strchr((const char*)s, '.') != nil && __builtin_memcmp(s, "runtime.", 7) != 0);
}
+
+bool
+runtime_isInf(float64 f, int32 sign)
+{
+ if(!__builtin_isinf(f))
+ return false;
+ if(sign == 0)
+ return true;
+ if(sign > 0)
+ return f > 0;
+ return f < 0;
+}