Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libm/src Deal with _LP64 properly.
details: https://anonhg.NetBSD.org/src/rev/f1a852a6538a
branches: trunk
changeset: 784420:f1a852a6538a
user: matt <matt%NetBSD.org@localhost>
date: Mon Jan 28 06:34:09 2013 +0000
description:
Deal with _LP64 properly.
diffstat:
lib/libm/src/s_scalbn.c | 21 ++++++++++++++++++---
lib/libm/src/s_scalbnf.c | 20 +++++++++++++++-----
lib/libm/src/s_scalbnl.c | 19 +++++++++++++++----
3 files changed, 48 insertions(+), 12 deletions(-)
diffs (150 lines):
diff -r b0a9994c9686 -r f1a852a6538a lib/libm/src/s_scalbn.c
--- a/lib/libm/src/s_scalbn.c Mon Jan 28 06:26:20 2013 +0000
+++ b/lib/libm/src/s_scalbn.c Mon Jan 28 06:34:09 2013 +0000
@@ -12,7 +12,7 @@
#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_scalbn.c,v 1.15 2011/07/26 16:10:16 joerg Exp $");
+__RCSID("$NetBSD: s_scalbn.c,v 1.16 2013/01/28 06:34:09 matt Exp $");
#endif
/*
@@ -26,24 +26,39 @@
#include "math.h"
#include "math_private.h"
+#ifndef _LP64
+__strong_alias(_scalbn, _scalbln)
+#endif
+
#ifndef __HAVE_LONG_DOUBLE
__strong_alias(_scalbnl, _scalbn)
+__strong_alias(_scalblnl, _scalbln)
__weak_alias(scalbnl, _scalbnl)
+__weak_alias(scalblnl, _scalblnl)
#endif
#ifdef __weak_alias
__weak_alias(scalbn, _scalbn)
+__weak_alias(scalbln, _scalbln)
#endif
static const double
-two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
+two54 = 0x1.0p54, /* 0x43500000, 0x00000000 */
+twom54 = 0x1.0p-54, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
+#ifdef _LP64
double
scalbn(double x, int n)
{
+ return scalbln(x, n);
+}
+#endif
+
+double
+scalbln(double x, long n)
+{
int32_t k,hx,lx;
EXTRACT_WORDS(hx,lx,x);
k = ((uint32_t)hx&0x7ff00000)>>20; /* extract exponent */
diff -r b0a9994c9686 -r f1a852a6538a lib/libm/src/s_scalbnf.c
--- a/lib/libm/src/s_scalbnf.c Mon Jan 28 06:26:20 2013 +0000
+++ b/lib/libm/src/s_scalbnf.c Mon Jan 28 06:34:09 2013 +0000
@@ -15,26 +15,36 @@
#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_scalbnf.c,v 1.9 2010/04/23 19:17:07 drochner Exp $");
+__RCSID("$NetBSD: s_scalbnf.c,v 1.10 2013/01/28 06:34:09 matt Exp $");
#endif
#include "namespace.h"
#include "math.h"
#include "math_private.h"
-#ifdef __weak_alias
+#ifndef _LP64
+__strong_alias(_scalbnf, _scalblnf)
+#endif
__weak_alias(scalbnf, _scalbnf)
-#endif
+__weak_alias(scalblnf, _scalblnf)
static const float
-two25 = 3.355443200e+07, /* 0x4c000000 */
-twom25 = 2.9802322388e-08, /* 0x33000000 */
+two25 = 0x1.0p25, /* 0x4c000000 */
+twom25 = 0x1.0p-25, /* 0x33000000 */
huge = 1.0e+30,
tiny = 1.0e-30;
+#ifdef _LP64
float
scalbnf(float x, int n)
{
+ return scalblnf(x, n);
+}
+#endif
+
+float
+scalblnf(float x, long n)
+{
int32_t k,ix;
GET_FLOAT_WORD(ix,x);
k = (ix&0x7f800000)>>23; /* extract exponent */
diff -r b0a9994c9686 -r f1a852a6538a lib/libm/src/s_scalbnl.c
--- a/lib/libm/src/s_scalbnl.c Mon Jan 28 06:26:20 2013 +0000
+++ b/lib/libm/src/s_scalbnl.c Mon Jan 28 06:34:09 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: s_scalbnl.c,v 1.1 2011/07/26 16:10:16 joerg Exp $ */
+/* $NetBSD: s_scalbnl.c,v 1.2 2013/01/28 06:34:09 matt Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: s_scalbnl.c,v 1.1 2011/07/26 16:10:16 joerg Exp $");
+__RCSID("$NetBSD: s_scalbnl.c,v 1.2 2013/01/28 06:34:09 matt Exp $");
#include "namespace.h"
@@ -40,9 +40,12 @@
#ifdef __HAVE_LONG_DOUBLE
-#ifdef __weak_alias
+#ifndef _LP64
+__strong_alias(_scalbnl, _scalblnl)
+#endif
+
__weak_alias(scalbnl, _scalbnl)
-#endif
+__weak_alias(scalblnl, _scalblnl)
#if LDBL_MANT_DIG == 64
#define FROM_UNDERFLOW 0x1p65L
@@ -54,9 +57,17 @@
#error Unsupported long double format
#endif
+#ifdef _LP64
long double
scalbnl(long double x, int n)
{
+ return scalblnl(x, n)
+}
+#endif
+
+long double
+scalblnl(long double x, long n)
+{
union ieee_ext_u u;
/* Trivial cases first */
Home |
Main Index |
Thread Index |
Old Index