[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r15612 - in /libdfp/trunk: ./ base-math/ sysdeps/soft-dfp/ tests/
- To: commits@xxxxxxxxxx
- Subject: [Commits] r15612 - in /libdfp/trunk: ./ base-math/ sysdeps/soft-dfp/ tests/
- From: ryanarn@xxxxxxxxxx
- Date: Fri, 28 Oct 2011 02:36:47 -0000
Author: ryanarn
Date: Fri Oct 28 02:36:47 2011
New Revision: 15612
Log:
2011-10-27 Ryan S. Arnold <rsa@xxxxxxxxxxxxxxxxxx>
* base-math/Makefile: Moved 'classify' from sysdeps/soft-dfp/Makefile.
* base-math/classify.c: Moved from sysdeps/soft-dfp/ because it's
required for the power6 build as well.
* base-math/extendsftd.c: Likewise.
* base-math/extendsdtf.c: Likewise.
* base-math/extenddfdd.c: Likewise.
* base-math/trunctdsf.c: Likewise.
* base-math/trunctfsd.c: Likewise.
* base-math/extendddtf.c: Likewise.
* base-math/extenddftd.c: Likewise.
* base-math/extendsfsd.c: Likewise.
* base-math/extendtftd.c: Likewise.
* base-math/truncdddf.c: Likewise.
* base-math/trunctfdd.c: Likewise.
* base-math/trunctddf.c: Likewise.
* base-math/truncsdsf.c: Likewise.
* base-math/trunctdtf.c: Likewise.
* base-math/extendsddf.c: Likewise.
* base-math/extendsfdd.c: Likewise.
* base-math/truncddsf.c: Likewise.
* base-math/truncdfsd.c: Likewise.
* tests/scaffold.c (_VC_P): Updated spacing in "Expected" and "Result"
output.
* tests/test-bfp-conversions.c: Added float -> _Decimal128 tests.
* sysdeps/soft-dfp/Makefile: Moved 'classify' to base-math/Makefile.
* sysdeps/soft-dfp/classify.c: Moved to base-math/ because it's
required for the power6 build as well.
* sysdeps/soft-dfp/extendsftd.c: Likewise.
* sysdeps/soft-dfp/extendsdtf.c: Likewise.
* sysdeps/soft-dfp/extenddfdd.c: Likewise.
* sysdeps/soft-dfp/trunctfsd.c: Likewise.
* sysdeps/soft-dfp/trunctdsf.c: Likewise.
* sysdeps/soft-dfp/extenddftd.c: Likewise.
* sysdeps/soft-dfp/extendddtf.c: Likewise.
* sysdeps/soft-dfp/extendsfsd.c: Likewise.
* sysdeps/soft-dfp/extendtftd.c: Likewise.
* sysdeps/soft-dfp/truncdddf.c: Likewise.
* sysdeps/soft-dfp/trunctfdd.c: Likewise.
* sysdeps/soft-dfp/trunctddf.c: Likewise.
* sysdeps/soft-dfp/truncsdsf.c: Likewise.
* sysdeps/soft-dfp/trunctdtf.c: Likewise.
* sysdeps/soft-dfp/extendsfdd.c: Likewise.
* sysdeps/soft-dfp/extendsddf.c: Likewise.
* sysdeps/soft-dfp/truncddsf.c: Likewise.
* sysdeps/soft-dfp/truncdfsd.c: Likewise.
Added:
libdfp/trunk/base-math/classify.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/classify.c
libdfp/trunk/base-math/extendddtf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendddtf.c
libdfp/trunk/base-math/extenddfdd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extenddfdd.c
libdfp/trunk/base-math/extenddftd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extenddftd.c
libdfp/trunk/base-math/extendsddf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendsddf.c
libdfp/trunk/base-math/extendsdtf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendsdtf.c
libdfp/trunk/base-math/extendsfdd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendsfdd.c
libdfp/trunk/base-math/extendsfsd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendsfsd.c
libdfp/trunk/base-math/extendsftd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendsftd.c
libdfp/trunk/base-math/extendtftd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/extendtftd.c
libdfp/trunk/base-math/truncdddf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/truncdddf.c
libdfp/trunk/base-math/truncddsf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/truncddsf.c
libdfp/trunk/base-math/truncdfsd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/truncdfsd.c
libdfp/trunk/base-math/truncsdsf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/truncsdsf.c
libdfp/trunk/base-math/trunctddf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/trunctddf.c
libdfp/trunk/base-math/trunctdsf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/trunctdsf.c
libdfp/trunk/base-math/trunctdtf.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/trunctdtf.c
libdfp/trunk/base-math/trunctfdd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/trunctfdd.c
libdfp/trunk/base-math/trunctfsd.c
- copied unchanged from r15611, libdfp/trunk/sysdeps/soft-dfp/trunctfsd.c
Removed:
libdfp/trunk/sysdeps/soft-dfp/classify.c
libdfp/trunk/sysdeps/soft-dfp/extendddtf.c
libdfp/trunk/sysdeps/soft-dfp/extenddfdd.c
libdfp/trunk/sysdeps/soft-dfp/extenddftd.c
libdfp/trunk/sysdeps/soft-dfp/extendsddf.c
libdfp/trunk/sysdeps/soft-dfp/extendsdtf.c
libdfp/trunk/sysdeps/soft-dfp/extendsfdd.c
libdfp/trunk/sysdeps/soft-dfp/extendsfsd.c
libdfp/trunk/sysdeps/soft-dfp/extendsftd.c
libdfp/trunk/sysdeps/soft-dfp/extendtftd.c
libdfp/trunk/sysdeps/soft-dfp/truncdddf.c
libdfp/trunk/sysdeps/soft-dfp/truncddsf.c
libdfp/trunk/sysdeps/soft-dfp/truncdfsd.c
libdfp/trunk/sysdeps/soft-dfp/truncsdsf.c
libdfp/trunk/sysdeps/soft-dfp/trunctddf.c
libdfp/trunk/sysdeps/soft-dfp/trunctdsf.c
libdfp/trunk/sysdeps/soft-dfp/trunctdtf.c
libdfp/trunk/sysdeps/soft-dfp/trunctfdd.c
libdfp/trunk/sysdeps/soft-dfp/trunctfsd.c
Modified:
libdfp/trunk/ChangeLog
libdfp/trunk/base-math/Makefile
libdfp/trunk/sysdeps/soft-dfp/Makefile
libdfp/trunk/tests/scaffold.c
libdfp/trunk/tests/test-bfp-conversions.c
Modified: libdfp/trunk/ChangeLog
==============================================================================
--- libdfp/trunk/ChangeLog (original)
+++ libdfp/trunk/ChangeLog Fri Oct 28 02:36:47 2011
@@ -1,3 +1,74 @@
+2011-10-27 Ryan S. Arnold <rsa@xxxxxxxxxxxxxxxxxx>
+
+ * base-math/Makefile: Moved 'classify' from sysdeps/soft-dfp/Makefile.
+ * base-math/classify.c: Moved from sysdeps/soft-dfp/ because it's
+ required for the power6 build as well.
+ * base-math/extendsftd.c: Likewise.
+ * base-math/extendsdtf.c: Likewise.
+ * base-math/extenddfdd.c: Likewise.
+ * base-math/trunctdsf.c: Likewise.
+ * base-math/trunctfsd.c: Likewise.
+ * base-math/extendddtf.c: Likewise.
+ * base-math/extenddftd.c: Likewise.
+ * base-math/extendsfsd.c: Likewise.
+ * base-math/extendtftd.c: Likewise.
+ * base-math/truncdddf.c: Likewise.
+ * base-math/trunctfdd.c: Likewise.
+ * base-math/trunctddf.c: Likewise.
+ * base-math/truncsdsf.c: Likewise.
+ * base-math/trunctdtf.c: Likewise.
+ * base-math/extendsddf.c: Likewise.
+ * base-math/extendsfdd.c: Likewise.
+ * base-math/truncddsf.c: Likewise.
+ * base-math/truncdfsd.c: Likewise.
+ * tests/scaffold.c (_VC_P): Updated spacing in "Expected" and "Result"
+ output.
+ * tests/test-bfp-conversions.c: Added float -> _Decimal128 tests.
+ * sysdeps/soft-dfp/Makefile: Moved 'classify' to base-math/Makefile.
+ * sysdeps/soft-dfp/classify.c: Moved to base-math/ because it's
+ required for the power6 build as well.
+ * sysdeps/soft-dfp/extendsftd.c: Likewise.
+ * sysdeps/soft-dfp/extendsdtf.c: Likewise.
+ * sysdeps/soft-dfp/extenddfdd.c: Likewise.
+ * sysdeps/soft-dfp/trunctfsd.c: Likewise.
+ * sysdeps/soft-dfp/trunctdsf.c: Likewise.
+ * sysdeps/soft-dfp/extenddftd.c: Likewise.
+ * sysdeps/soft-dfp/extendddtf.c: Likewise.
+ * sysdeps/soft-dfp/extendsfsd.c: Likewise.
+ * sysdeps/soft-dfp/extendtftd.c: Likewise.
+ * sysdeps/soft-dfp/truncdddf.c: Likewise.
+ * sysdeps/soft-dfp/trunctfdd.c: Likewise.
+ * sysdeps/soft-dfp/trunctddf.c: Likewise.
+ * sysdeps/soft-dfp/truncsdsf.c: Likewise.
+ * sysdeps/soft-dfp/trunctdtf.c: Likewise.
+ * sysdeps/soft-dfp/extendsfdd.c: Likewise.
+ * sysdeps/soft-dfp/extendsddf.c: Likewise.
+ * sysdeps/soft-dfp/truncddsf.c: Likewise.
+ * sysdeps/soft-dfp/truncdfsd.c: Likewise.
+
+2011-10-27 Ryan S. Arnold <rsa@xxxxxxxxxxxxxxxxxx>
+
+ * Makefile.in (libdfp_tests): Added test-bfp-conversions.
+ * base-math/Makefile (libdfp_files): Moved extendsfsd extendsddf
+ extendsdtf extendsfdd extenddfdd extendddtf extendsftd extenddftd
+ extendtftd truncsdsf truncdfsd trunctfsd truncddsf truncdddf
+ trunctfdd trunctdsf trunctddf trunctdtf from sysdeps/soft-dfp/Makefile
+ since they're required in all builds.
+ * tests/test-bfp-conversions.c: New file to test bfp -> dfp and dfp ->
+ bfp conversions.
+ * include/convert.h: Moved from sysdeps/soft-dfp/ in preparation for
+ moving extend and trunc bfp->dfp and dfp->bfp conversion functions.
+ * sysdeps/soft-dfp/Makefile (libdfp_files): Removed extendsfsd
+ extendsddf extendsdtf extendsfdd extenddfdd extendddtf extendsftd
+ extenddftd extendtftd truncsdsf truncdfsd trunctfsd truncddsf
+ truncdddf trunctfdd trunctdsf trunctddf trunctdtf and moved to
+ base-math/Makefile since they're required in all builds.
+ * sysdeps/soft-dfp/extendsfsd.c: Replaced magic number '24' with
+ __FLT_MANT_DIG__.
+ * sysdeps/soft-dfp/convert.h: Moved to include/convert.h.
+ * sysdeps/soft-dfp/truncdfsd.c: Replaced magic number '53' with
+ __DBL_MANT_DIG__.
+
2011-04-28 Ryan S. Arnold <rsa@xxxxxxxxxx>
* tests/gdb_start_address.py: New file which provides the
Modified: libdfp/trunk/base-math/Makefile
==============================================================================
--- libdfp/trunk/base-math/Makefile (original)
+++ libdfp/trunk/base-math/Makefile Fri Oct 28 02:36:47 2011
@@ -25,3 +25,4 @@
truncddsf truncdddf trunctfdd \
trunctdsf trunctddf trunctdtf \
unordsd2 unorddd2 unordtd2 \
+ classify
Modified: libdfp/trunk/sysdeps/soft-dfp/Makefile
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/Makefile (original)
+++ libdfp/trunk/sysdeps/soft-dfp/Makefile Fri Oct 28 02:36:47 2011
@@ -1,13 +1,3 @@
-# base-math/Makefile defines all of the arithmetic and comparison functions
-# and SOME of the conversion functions.
-libdfp_files += decroundtls classify
-
-# We provide the conversion functions
-# which are decimal->binary and binary->decimal here that aren't provided by
-# base-math/Makefile.
-#extendsfsd extendsddf extendsdtf \
-#extendsfdd extenddfdd extendddtf \
-#extendsftd extenddftd extendtftd \
-#truncsdsf truncdfsd trunctfsd \
-#truncddsf truncdddf trunctfdd \
-#trunctdsf trunctddf trunctdtf
+# base-math/Makefile defines all of the arithmetic, conversion, and comparison
+# functions.
+libdfp_files += decroundtls
Removed: libdfp/trunk/sysdeps/soft-dfp/classify.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/classify.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/classify.c (removed)
@@ -1,80 +1,0 @@
-/* Classification functions for binary floating point types
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#include <math.h>
-#include "convert.h"
-
-extern int __dfp_classify_sf (float a);
-
-int __dfp_classify_sf (float a)
-{
- union {
- float x;
- struct {
- unsigned int sign:1;
- unsigned int exp:8;
- unsigned int sig:23;
- } e;
- } u;
- u.x = a;
- if (__builtin_expect (a == 0.0f, 0))
- return FP_ZERO;
-
- if (__builtin_expect (u.e.exp == 0xff, 0))
- {
- if (u.e.sig == 0)
- return FP_INFINITE;
- else
- return FP_NAN;
- }
- return FP_NORMAL;
-}
-
-extern int __dfp_classify_df (double a);
-
-int __dfp_classify_df (double a)
-{
- union {
- double x;
- struct {
- unsigned int sign:1;
- unsigned int exp:11;
- unsigned int sig0:20;
- unsigned int sig1:32;
- } e;
- } u;
- u.x = a;
- if (__builtin_expect (a == 0.0, 0))
- return FP_ZERO;
-
- if (__builtin_expect (u.e.exp == 0x7ff, 0))
- {
- if (u.e.sig0 == 0 && u.e.sig1 == 0)
- return FP_INFINITE;
- else
- return FP_NAN;
- }
- return FP_NORMAL;
-}
Removed: libdfp/trunk/sysdeps/soft-dfp/extendddtf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendddtf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendddtf.c (removed)
@@ -1,55 +1,0 @@
-/* Handle conversion from Decimal64 to binary long double (128)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef DECIMAL_TO_BINARY
-#define DECIMAL_TO_BINARY
-#define SRC 64
-#define DEST 128
-#define NAME extend
-
-extern double __truncdddf (_Decimal64);
-extern _Decimal64 __extenddfdd (double);
-
-#endif
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// extendddtf, trunctdtf
- double df_part1, df_part2;
- SRC_TYPE dd_part1, dd_part2;
-
- df_part1 = a; /* TD -> DF */
- dd_part1 = df_part1; /* DF -> DD./TD. */
- dd_part2 = a - dd_part1; /* DD./TD. */
- df_part2 = dd_part2; /* DD/TD -> DF. */
- result = df_part1;
- result += df_part2;
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/extenddfdd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extenddfdd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extenddfdd.c (removed)
@@ -1,31 +1,0 @@
-/* Handle conversion from binary double (64) to Decimal64
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 64
-#define DEST 64
-#define NAME extend
-
-#include "truncdfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/extenddftd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extenddftd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extenddftd.c (removed)
@@ -1,31 +1,0 @@
-/* Handle conversion from binary double (64) to Decimal128
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 64
-#define DEST 128
-#define NAME extend
-
-#include "truncdfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/extendsddf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendsddf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendsddf.c (removed)
@@ -1,31 +1,0 @@
-/* Handle conversion from Decimal32 to binary double (64)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 32
-#define DEST 64
-#define NAME extend
-
-#include "truncsdsf.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/extendsdtf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendsdtf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendsdtf.c (removed)
@@ -1,50 +1,0 @@
-/* Handle conversion from Decimal32 to binary long double (128)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef DECIMAL_TO_BINARY
-#define DECIMAL_TO_BINARY
-#define SRC 32
-#define DEST 128
-#define NAME extend
-
-extern double __extendsddf (_Decimal32);
-extern _Decimal32 __truncdfsd (double);
-
-#endif
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
- double df_part1, df_part2;
- _Decimal32 sd_part1, sd_part2;
-
- df_part1 = a; /* TD -> DF */
- sd_part1 = df_part1; /* DF -> SD (not exact) */
- sd_part2 = a - sd_part1; /* SD */
- df_part2 = sd_part2; /* SD -> DF (trunc) */
- result = df_part1;
- result += df_part2;
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/extendsfdd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendsfdd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendsfdd.c (removed)
@@ -1,31 +1,0 @@
-/* Handle conversion from binary float (32) to Decimal64
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 32
-#define DEST 64
-#define NAME extend
-
-#include "extendsfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/extendsfsd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendsfsd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendsfsd.c (removed)
@@ -1,65 +1,0 @@
-/* Handle conversion from binary float (32) to Decimal32
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef BINARY_TO_DECIMAL
-#define BINARY_TO_DECIMAL
-#define SRC 32
-#define DEST 32
-#define NAME extend
-#endif
-
-#include "fenv_libdfp.h"
-#include "dfpacc.h"
-#include "convert.h"
-#include <float.h> /* To pick up __FLT_MANT_DIG__ */
-
-#if DEST==32
-#define TEMP_TYPE _Decimal64
-#else
-#define TEMP_TYPE _Decimal128
-#endif
-
-CONVERT_WRAPPER(
-// extendsfsd, extendsfdd, extendsftd
- TEMP_TYPE temp;
- float a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPSF (a, &exp);
- mant = a_norm * 16777216.0; /* 24 bits of mantissa. */
- //sexp = exp - 24; /* Exponent adjusted for mantissa. */
- sexp = exp - __FLT_MANT_DIG__; /* Exponent adjusted for mantissa. */
- temp = mant;
- if (sexp > 0)
- temp *= DECPOWOF2[sexp];
- else if (sexp < 0)
- temp /= DECPOWOF2[-sexp];
- result = temp;
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/extendsftd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendsftd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendsftd.c (removed)
@@ -1,31 +1,0 @@
-/* Handle conversion from binary float (32) to Decimal128
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 32
-#define DEST 128
-#define NAME extend
-
-#include "extendsfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/extendtftd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/extendtftd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/extendtftd.c (removed)
@@ -1,33 +1,0 @@
-/* Handle conversion from binary long double (dual 64bit) to Decimal128
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 128
-#define DEST 128
-#define NAME extend
-
-extern _Decimal128 __extenddftd(double);
-
-#include "trunctfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/truncdddf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/truncdddf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/truncdddf.c (removed)
@@ -1,80 +1,0 @@
-/* Handle conversion from Decimal64 to binary double (64)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 64
-#define DEST 64
-#define NAME trunc
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// truncdddf
- long double temp;
- SRC_TYPE a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPD64 (a, &exp);
-
- /* Avoid going beyond the bounds of the table, which would also
- mean an overflow or underflow. */
- if (exp > BINPOWOF10_LIMIT) /* Obvious overflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_OVERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -INFINITY : INFINITY;
- }
- else if (exp < -BINPOWOF10_LIMIT) /* Obvious underflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_UNDERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -0.0 : 0.0;
- }
-
- mant = a_norm * 1.E+16DD; /* 16 digits of mantissa. */
- sexp = exp - 16; /* Exponent adjusted for mantissa. */
- temp = mant; /* mantissa as TF */
- if (sexp > 0)
- result = temp * BINPOWOF10[sexp];
- else if (sexp < 0)
- {
- /* Avoid going beyond the bounds of the exponent table for
- negative exponents. */
- if (sexp < -BINPOWOF10_LIMIT)
- {
- temp /= BINPOWOF10[BINPOWOF10_LIMIT];
- sexp += BINPOWOF10_LIMIT;
- }
- result = temp / BINPOWOF10[-sexp];
- }
- else
- result = temp;
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/truncddsf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/truncddsf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/truncddsf.c (removed)
@@ -1,66 +1,0 @@
-/* Handle conversion from Decimal64 to binary float (32)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 64
-#define DEST 32
-#define NAME trunc
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// truncddsf
- double temp;
- _Decimal64 a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPD64 (a, &exp);
-
- /* Check for values that would overflow the exponent table, which
- would be obvious overflow and underflow. */
- if (exp > 39) /* Obvious overflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_OVERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -INFINITY : INFINITY;
- }
- else if (exp < -39) /* Obvious underflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_UNDERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -0.0 : 0.0;
- }
-
- mant = a_norm * 1.E+16DD; /* 16 digits of mantissa. */
- sexp = exp - 16; /* Exponent adjusted for mantissa. */
- temp = mant;
- if (sexp > 0)
- temp *= BINPOWOF10[sexp];
- else if (sexp < 0)
- temp /= BINPOWOF10[-sexp];
- result = temp;
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/truncdfsd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/truncdfsd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/truncdfsd.c (removed)
@@ -1,58 +1,0 @@
-/* Handle conversion from binary double (64) to Decimal32
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef BINARY_TO_DECIMAL
-#define BINARY_TO_DECIMAL
-#define SRC 64
-#define DEST 32
-#define NAME trunc
-#endif
-
-#include "dfpacc.h"
-#include "convert.h"
-#include <float.h> /* To pick up __DBL_MANT_DIG__ */
-
-CONVERT_WRAPPER(
-// truncdfsd, extenddfdd, extenddftd
- _Decimal128 temp; /* Needs to be big enough so that temp = mant doesn't round. */
- double a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPDF (a, &exp);
- mant = a_norm * 9007199254740992.0; /* 53 bits of mantissa. */
- //sexp = exp - 53; /* Exponent adjusted for mantissa. */
- sexp = exp - __DBL_MANT_DIG__; /* Exponent adjusted for mantissa. */
- temp = mant; /* DI -> TD. */
- if (sexp > 0)
- temp *= DECPOWOF2[sexp];
- else if (sexp < 0)
- temp /= DECPOWOF2[-sexp];
- result = (DEST_TYPE)temp; /* Cast to the resultant type. */
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/truncsdsf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/truncsdsf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/truncsdsf.c (removed)
@@ -1,52 +1,0 @@
-/* Handle conversion from Decimal32 to binary float (32)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef DECIMAL_TO_BINARY
-#define DECIMAL_TO_BINARY
-#define SRC 32
-#define DEST 32
-#define NAME trunc
-#endif
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// truncsdsf, extendsddf
- double temp;
- SRC_TYPE a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPD32 (a, &exp);
- mant = a_norm * 1E+7DF; /* 7 digits of mantissa. */
- sexp = exp - 7; /* Exponent adjusted for mantissa. */
- temp = mant;
- if (sexp > 0)
- temp *= BINPOWOF10[sexp];
- else if (sexp < 0)
- temp /= BINPOWOF10[-sexp];
- result = temp;
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/trunctddf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/trunctddf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/trunctddf.c (removed)
@@ -1,77 +1,0 @@
-/* Handle conversion from Decimal128 to binary double (64)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 128
-#define DEST 64
-#define NAME trunc
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// trunctddf
- long double temp; /* Need at least 16 decimal digits of accuracy. */
- SRC_TYPE a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPD128 (a, &exp);
- /* Avoid going beyond the bounds of the exponent table. */
- if (exp > BINPOWOF10_LIMIT) /* Obvious overflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_OVERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -INFINITY : INFINITY;
- }
- else if (exp < -BINPOWOF10_LIMIT) /* Obvious underflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_UNDERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -0.0 : 0.0;
- }
-
- mant = a_norm * 1.E+17DL; /* 17 digits of mantissa. */
- sexp = exp - 17; /* Exponent adjusted for mantissa. */
- temp = mant;
- if (sexp > 0)
- temp *= BINPOWOF10[sexp];
- else if (sexp < 0)
- {
- /* Avoid going beyond the bounds of the exponent table for
- negative exponents. */
- if (sexp < -BINPOWOF10_LIMIT)
- {
- temp /= BINPOWOF10[BINPOWOF10_LIMIT];
- sexp += BINPOWOF10_LIMIT;
- }
- temp /= BINPOWOF10[-sexp];
- }
- result = temp;
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/trunctdsf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/trunctdsf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/trunctdsf.c (removed)
@@ -1,65 +1,0 @@
-/* Handle conversion from Decimal128 to binary float (32)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 128
-#define DEST 32
-#define NAME trunc
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// trunctdsf
- double temp;
- SRC_TYPE a_norm;
- long long mant;
- int exp, sexp;
-
- a_norm = FREXPD128 (a, &exp);
- /* Handle obvious overflow and underflow to avoid going beyond the
- bounds of the exponent table. */
- if (exp > 39) /* Obvious overflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_OVERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -INFINITY : INFINITY;
- }
- else if (exp < -39) /* Obvious underflow. */
- {
- if (DFP_EXCEPTIONS_ENABLED)
- DFP_HANDLE_EXCEPTIONS (FE_UNDERFLOW|FE_INEXACT);
- return SIGNBIT(a) ? -0.0 : 0.0;
- }
-
- mant = a_norm * 1E+15DL; /* 15 digits of mantissa. */
- sexp = exp - 15; /* Exponent adjusted for mantissa. */
- temp = mant;
- if (sexp > 0)
- temp *= BINPOWOF10[sexp];
- else if (sexp < 0)
- temp /= BINPOWOF10[-sexp];
- result = temp;
-)
Removed: libdfp/trunk/sysdeps/soft-dfp/trunctdtf.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/trunctdtf.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/trunctdtf.c (removed)
@@ -1,34 +1,0 @@
-/* Handle conversion from Decimal128 to binary long double (dual 64bit)
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define DECIMAL_TO_BINARY
-#define SRC 128
-#define DEST 128
-#define NAME trunc
-
-extern double __trunctddf(_Decimal128);
-extern _Decimal128 __extenddftd(double);
-
-#include "extendddtf.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/trunctfdd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/trunctfdd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/trunctfdd.c (removed)
@@ -1,33 +1,0 @@
-/* Handle conversion from binary long double (128) to Decimal64
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#define BINARY_TO_DECIMAL
-#define SRC 128
-#define DEST 64
-#define NAME trunc
-
-extern _Decimal64 __extenddfdd(double);
-
-#include "trunctfsd.c"
Removed: libdfp/trunk/sysdeps/soft-dfp/trunctfsd.c
==============================================================================
--- libdfp/trunk/sysdeps/soft-dfp/trunctfsd.c (original)
+++ libdfp/trunk/sysdeps/soft-dfp/trunctfsd.c (removed)
@@ -1,56 +1,0 @@
-/* Handle conversion from binary long double (128) to Decimal32
-
- Copyright (C) 2007, 2008 IBM Corporation.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This file is part of the Decimal Floating Point C Library.
-
- Author(s): Pete Eberlein <eberlein@xxxxxxxxxx>
-
- The Decimal Floating Point C Library is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License version 2.1.
-
- The Decimal Floating Point C Library is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU Lesser General Public License version 2.1 for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License version 2.1 along with the Decimal Floating Point C Library;
- if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- Suite 330, Boston, MA 02111-1307 USA.
-
- Please see libdfp/COPYING.txt for more information. */
-
-#ifndef BINARY_TO_DECIMAL
-#define BINARY_TO_DECIMAL
-#define SRC 128
-#define DEST 32
-#define NAME trunc
-
-extern _Decimal32 __truncdfsd(double);
-
-#endif
-
-#include "dfpacc.h"
-#include "convert.h"
-
-CONVERT_WRAPPER(
-// truncdfsd, extenddfdd, extenddftd
- DEST_TYPE temp;
- union {
- SRC_TYPE ld;
- double d[2];
- } ldd;
-
- ldd.ld = a;
- temp = ldd.d[0];
- result = temp;
- temp = ldd.d[1];
- result += temp;
- /* Clear inexact exception raised by DFP arithmetic. */
- if (DFP_EXCEPTIONS_ENABLED
- && DFP_TEST_EXCEPTIONS (FE_OVERFLOW|FE_UNDERFLOW) == 0)
- DFP_CLEAR_EXCEPTIONS (FE_INEXACT);
-)
Modified: libdfp/trunk/tests/scaffold.c
==============================================================================
--- libdfp/trunk/tests/scaffold.c (original)
+++ libdfp/trunk/tests/scaffold.c Fri Oct 28 02:36:47 2011
@@ -1,6 +1,6 @@
/* Test facility scaffolding.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
This file is part of the Decimal Floating Point C Library.
@@ -96,10 +96,10 @@
sprintf(bufx, fmt, x); \
sprintf(bufy, fmt, y); \
if(x!=y) { \
- fprintf(stderr, "%-3d Error: Expected: \"%s\"\n Result: \"%s\"\n in: %s:%d.\n\n", testnum,bufx,bufy,f,l); \
+ fprintf(stderr, "%-3d Error: Expected: \"%s\"\n Result: \"%s\"\n in: %s:%d.\n\n", testnum,bufx,bufy,f,l); \
++fail; \
} else { \
- fprintf(stdout, "%-3d Success: Expected: \"%s\"\n Result: \"%s\"\n in: %s:%d.\n\n", testnum,bufx,bufy,f,l); \
+ fprintf(stdout, "%-3d Success: Expected: \"%s\"\n Result: \"%s\"\n in: %s:%d.\n\n", testnum,bufx,bufy,f,l); \
} \
} while (0)
Modified: libdfp/trunk/tests/test-bfp-conversions.c
==============================================================================
--- libdfp/trunk/tests/test-bfp-conversions.c (original)
+++ libdfp/trunk/tests/test-bfp-conversions.c Fri Oct 28 02:36:47 2011
@@ -88,7 +88,7 @@
sftd_type *sftdp;
#include "decode.h"
- char buf[256];
+ char decodebuf[256];
for (sfsdp = sfsd_tests; sfsdp->line; sfsdp++)
{
@@ -99,8 +99,8 @@
* same printf statement. */
fprintf(stdout, "%He = (_Decimal32) ", retval);
fprintf(stdout, "%f; /* float */ in: %s: %d\n", (double) sfsdp->x,__FILE__,__LINE__-4);
- fprintf(stdout, "expected: %s\n", decoded32(sfsdp->e,buf));
- fprintf(stdout, "retval: %s\n", decoded32(retval,buf));
+ fprintf(stdout, "expected: %s\n", decoded32(sfsdp->e,decodebuf));
+ fprintf(stdout, "retval: %s\n", decoded32(retval,decodebuf));
_VC_P(__FILE__,sfsdp->line, sfsdp->e, retval, sfsdp->format);
}
@@ -109,14 +109,27 @@
/* This will force the conversion and result in the hidden call to
* __dpd_extendsfdd (). */
_Decimal64 retval = sfddp->x;
- float f = retval;
/* Broken into two because printf has a bug when you do %Hf and %f in the
* same printf statement. */
- fprintf(stdout, "%De = (_Decimal64)", retval);
+ fprintf(stdout, "%De = (_Decimal64) ", retval);
fprintf(stdout, "%f; /* float */ in: %s: %d\n", (double) sfddp->x,__FILE__,__LINE__-4);
- fprintf(stdout, "expected: %s\n", decoded64(sfddp->e,buf));
- fprintf(stdout, "retval: %s\n", decoded64(retval,buf));
+ fprintf(stdout, "expected: %s\n", decoded64(sfddp->e,decodebuf));
+ fprintf(stdout, "retval: %s\n", decoded64(retval,decodebuf));
_VC_P(__FILE__,sfddp->line, sfddp->e, retval, sfddp->format);
+ }
+
+ for (sftdp = sftd_tests; sftdp->line; sftdp++)
+ {
+ /* This will force the conversion and result in the hidden call to
+ * __dpd_extendsftd (). */
+ _Decimal128 retval = sftdp->x;
+ /* Broken into two because printf has a bug when you do %Hf and %f in the
+ * same printf statement. */
+ fprintf(stdout, "%DDe = (_Decimal128) ", retval);
+ fprintf(stdout, "%f; /* float */ in: %s: %d\n", (double) sftdp->x,__FILE__,__LINE__-4);
+ fprintf(stdout, "expected: %s\n", decoded128(sftdp->e,decodebuf));
+ fprintf(stdout, "retval: %s\n", decoded128(retval,decodebuf));
+ _VC_P(__FILE__,sftdp->line, sftdp->e, retval, sftdp->format);
}
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits