diff options
| author | Russ Cox <rsc@golang.org> | 2010-11-04 14:00:19 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-11-04 14:00:19 -0400 |
| commit | 68b4255a9644a838898bfc6567bae97585c2e871 (patch) | |
| tree | 6ba0f08e7aa2c5e8c3f883aeab0b79ae8efd4859 /src/pkg/runtime/float.c | |
| parent | 3b6ddd9bceb1e3c56f6cbfc28d51481a3036c653 (diff) | |
| download | go-68b4255a9644a838898bfc6567bae97585c2e871.tar.xz | |
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
Diffstat (limited to 'src/pkg/runtime/float.c')
| -rw-r--r-- | src/pkg/runtime/float.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/pkg/runtime/float.c b/src/pkg/runtime/float.c index 5122f359a7..f481519f65 100644 --- a/src/pkg/runtime/float.c +++ b/src/pkg/runtime/float.c @@ -9,7 +9,7 @@ static uint64 uvinf = 0x7FF0000000000000ULL; static uint64 uvneginf = 0xFFF0000000000000ULL; uint32 -float32tobits(float32 f) +runtime·float32tobits(float32 f) { // The obvious cast-and-pointer code is technically // not valid, and gcc miscompiles it. Use a union instead. @@ -22,7 +22,7 @@ float32tobits(float32 f) } uint64 -float64tobits(float64 f) +runtime·float64tobits(float64 f) { // The obvious cast-and-pointer code is technically // not valid, and gcc miscompiles it. Use a union instead. @@ -35,7 +35,7 @@ float64tobits(float64 f) } float64 -float64frombits(uint64 i) +runtime·float64frombits(uint64 i) { // The obvious cast-and-pointer code is technically // not valid, and gcc miscompiles it. Use a union instead. @@ -48,7 +48,7 @@ float64frombits(uint64 i) } float32 -float32frombits(uint32 i) +runtime·float32frombits(uint32 i) { // The obvious cast-and-pointer code is technically // not valid, and gcc miscompiles it. Use a union instead. @@ -61,11 +61,11 @@ float32frombits(uint32 i) } bool -isInf(float64 f, int32 sign) +runtime·isInf(float64 f, int32 sign) { uint64 x; - x = float64tobits(f); + x = runtime·float64tobits(f); if(sign == 0) return x == uvinf || x == uvneginf; if(sign > 0) @@ -74,27 +74,27 @@ isInf(float64 f, int32 sign) } float64 -NaN(void) +runtime·NaN(void) { - return float64frombits(uvnan); + return runtime·float64frombits(uvnan); } bool -isNaN(float64 f) +runtime·isNaN(float64 f) { uint64 x; - x = float64tobits(f); - return ((uint32)(x>>52) & 0x7FF) == 0x7FF && !isInf(f, 0); + x = runtime·float64tobits(f); + return ((uint32)(x>>52) & 0x7FF) == 0x7FF && !runtime·isInf(f, 0); } float64 -Inf(int32 sign) +runtime·Inf(int32 sign) { if(sign >= 0) - return float64frombits(uvinf); + return runtime·float64frombits(uvinf); else - return float64frombits(uvneginf); + return runtime·float64frombits(uvneginf); } enum @@ -105,7 +105,7 @@ enum }; float64 -frexp(float64 d, int32 *ep) +runtime·frexp(float64 d, int32 *ep) { uint64 x; @@ -113,36 +113,36 @@ frexp(float64 d, int32 *ep) *ep = 0; return 0; } - x = float64tobits(d); + x = runtime·float64tobits(d); *ep = (int32)((x >> SHIFT) & MASK) - BIAS; x &= ~((uint64)MASK << SHIFT); x |= (uint64)BIAS << SHIFT; - return float64frombits(x); + return runtime·float64frombits(x); } float64 -ldexp(float64 d, int32 e) +runtime·ldexp(float64 d, int32 e) { uint64 x; if(d == 0) return 0; - x = float64tobits(d); + x = runtime·float64tobits(d); e += (int32)(x >> SHIFT) & MASK; if(e <= 0) return 0; /* underflow */ if(e >= MASK){ /* overflow */ if(d < 0) - return Inf(-1); - return Inf(1); + return runtime·Inf(-1); + return runtime·Inf(1); } x &= ~((uint64)MASK << SHIFT); x |= (uint64)e << SHIFT; - return float64frombits(x); + return runtime·float64frombits(x); } float64 -modf(float64 d, float64 *ip) +runtime·modf(float64 d, float64 *ip) { float64 dd; uint64 x; @@ -150,7 +150,7 @@ modf(float64 d, float64 *ip) if(d < 1) { if(d < 0) { - d = modf(-d, ip); + d = runtime·modf(-d, ip); *ip = -*ip; return -d; } @@ -158,7 +158,7 @@ modf(float64 d, float64 *ip) return d; } - x = float64tobits(d); + x = runtime·float64tobits(d); e = (int32)((x >> SHIFT) & MASK) - BIAS; /* @@ -166,7 +166,7 @@ modf(float64 d, float64 *ip) */ if(e <= 64-11) x &= ~(((uint64)1 << (64LL-11LL-e))-1); - dd = float64frombits(x); + dd = runtime·float64frombits(x); *ip = dd; return d - dd; } |
