Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/quad Don't return 0x1.0p31 for every input value 2^N.
details: https://anonhg.NetBSD.org/src/rev/7579e5ef48c2
branches: trunk
changeset: 790272:7579e5ef48c2
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Mon Sep 30 19:32:14 2013 +0000
description:
Don't return 0x1.0p31 for every input value 2^N.
There is also no need to special case the value 1.
diffstat:
lib/libc/quad/floatundidf_ieee754.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diffs (32 lines):
diff -r c39ffc9282d4 -r 7579e5ef48c2 lib/libc/quad/floatundidf_ieee754.c
--- a/lib/libc/quad/floatundidf_ieee754.c Mon Sep 30 18:57:59 2013 +0000
+++ b/lib/libc/quad/floatundidf_ieee754.c Mon Sep 30 19:32:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: floatundidf_ieee754.c,v 1.1 2013/08/24 00:51:48 matt Exp $ */
+/* $NetBSD: floatundidf_ieee754.c,v 1.2 2013/09/30 19:32:14 mlelstv Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: floatundidf_ieee754.c,v 1.1 2013/08/24 00:51:48 matt Exp $");
+__RCSID("$NetBSD: floatundidf_ieee754.c,v 1.2 2013/09/30 19:32:14 mlelstv Exp $");
#endif /* LIBC_SCCS and not lint */
#if defined(SOFTFLOAT) || defined(__ARM_EABI__)
@@ -52,13 +52,9 @@
if (x == 0)
return 0.0;
- if (x == 1)
- return 1.0;
u_int l = __builtin_clzll(x);
x <<= (l + 1); /* clear implicit bit */
- if (x == 0)
- return 0x1.0p31;
x >>= 64 - (DBL_FRACHBITS + DBL_FRACLBITS);
union uu u = { .uq = x };
ux.dblu_frach = u.ul[H];
Home |
Main Index |
Thread Index |
Old Index