[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r10559 - in /libdfp/trunk: ./ autom4te.cache/ ieee754r/ sysdeps/powerpc/dfpu/ tests/
- To: commits@xxxxxxxxxx
- Subject: [commits] r10559 - in /libdfp/trunk: ./ autom4te.cache/ ieee754r/ sysdeps/powerpc/dfpu/ tests/
- From: ryanarn@xxxxxxxxxx
- Date: Wed, 26 May 2010 06:18:28 -0000
Author: ryanarn
Date: Tue May 25 23:18:27 2010
New Revision: 10559
Log:
This checks in a bunch of test-suite additions and also exports the hidden
classification function symbols so that the polymorphic versions in dfp/math.h
will work correctly.
2010-05-26 Ryan S. Arnold <rsa@xxxxxxxxxx>
* configure: Updated version to 1.0.2.
* Makefile.in: Added test cases.
* ieee754r/Versions: Exported __isnand*, __isinfd*, etc.
* tests/test-printf.c: Define _WANT_PC.
* tests/test-decode.c: Define _WANT_DC.
* tests/scaffold.c: Added _VC_P and _VC as well as _WANT_PC, _WANT_DC,
and _WANT_VC.
* tests/test-fpclassify.c: New classification function test.
* tests/test-isnan.c: Likewise.
* tests/test-isinf.c: Likewise.
* tests/test-finite.c: Likewise.
* tests/test-param.c: Likewise.
* tests/test-quantize.c: Likewise.
* sysdeps/powerpc/dfpu/quantized64.c: Hard-dfp implementation.
* sysdeps/powerpc/dfpu/quantized128.c: Likewise.
* sysdeps/powerpc/dfpu/fpclassifyd64.c: Likewise.
* sysdeps/powerpc/dfpu/isnand32.c: Likewise.
* sysdeps/powerpc/dfpu/isinfd32.c: Likewise.
* sysdeps/powerpc/dfpu/isnand64.c: Likewise.
* sysdeps/powerpc/dfpu/isinfd64.c: Likewise.
* sysdeps/powerpc/dfpu/finited32.c: Likewise.
* sysdeps/powerpc/dfpu/quantized32.c: Likewise.
* sysdeps/powerpc/dfpu/finited64.c: Likewise.
* sysdeps/powerpc/dfpu/fpclassifyd32.c: Likewise.
Added:
libdfp/trunk/sysdeps/powerpc/dfpu/finited32.c
libdfp/trunk/sysdeps/powerpc/dfpu/finited64.c
libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd32.c
libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd64.c
libdfp/trunk/sysdeps/powerpc/dfpu/isinfd32.c
libdfp/trunk/sysdeps/powerpc/dfpu/isinfd64.c
libdfp/trunk/sysdeps/powerpc/dfpu/isnand32.c
libdfp/trunk/sysdeps/powerpc/dfpu/isnand64.c
libdfp/trunk/sysdeps/powerpc/dfpu/quantized128.c
libdfp/trunk/sysdeps/powerpc/dfpu/quantized32.c
libdfp/trunk/sysdeps/powerpc/dfpu/quantized64.c
libdfp/trunk/tests/test-decode.c
libdfp/trunk/tests/test-finite.c
libdfp/trunk/tests/test-fpclassify.c
libdfp/trunk/tests/test-isinf.c
libdfp/trunk/tests/test-isnan.c
libdfp/trunk/tests/test-quantize.c
Modified:
libdfp/trunk/Makefile.in
libdfp/trunk/autom4te.cache/output.0
libdfp/trunk/autom4te.cache/traces.0
libdfp/trunk/configure
libdfp/trunk/ieee754r/Versions
libdfp/trunk/tests/scaffold.c
libdfp/trunk/tests/test-param.c
libdfp/trunk/tests/test-printf.c
Modified: libdfp/trunk/Makefile.in
==============================================================================
--- libdfp/trunk/Makefile.in (original)
+++ libdfp/trunk/Makefile.in Tue May 25 23:18:27 2010
@@ -303,14 +303,16 @@
GLIBC_LIBS := $(glibc_builddir)/libc.so $(glibc_builddir)/math/libm.so $(glibc_builddir)/nptl/libpthread.so
endif
-libdfp_tests = test-printf test-param test-amort
+libdfp_tests = test-printf test-param test-amort test-decode test-quantize test-isnan test-isinf test-finite test-fpclassify
# Explicitly link against the uninstalled GLIBC and the Libdfp.so.1 we just
# built.
$(libdfp_tests): %:%.o $(top_builddir)/$(SHARED_SONAME_LIB)
- $(CC) $(CFLAGS) $(GLIBC_LIBS) $(top_builddir)/$(SHARED_SONAME_LIB) $(top_builddir)/$(addsuffix .o,$@) -o $@
- @echo
-
+ $(CC) $(CFLAGS) $(GLIBC_LIBS) -L$(top_builddir)/ -ldfp $(top_builddir)/$(addsuffix .o,$@) -o $@
+ @echo
+
+# $(CC) $(CFLAGS) $(GLIBC_LIBS) $(top_builddir)/$(SHARED_SONAME_LIB) $(top_builddir)/$(addsuffix .o,$@) -o $@
+#
LIBRARY_PATH = $(glibc_builddir)/:$(glibc_builddir)/math:$(glibc_builddir)/elf:$(glibc_builddir)/nptl
# Invoke the GLIBC loader and tell it to run the application. Also make sure
@@ -342,6 +344,7 @@
# We use debug-test.conf as an input file for some debugging utilities.
check: $(top_builddir)/debug-test.conf $(addsuffix .conf,$(libdfp_tests)) $(addsuffix .out,$(libdfp_tests)) $(addsuffix .gdb,$(libdfp_tests))
+ @echo +Completed make check
.PHONY: check
Modified: libdfp/trunk/autom4te.cache/output.0
==============================================================================
--- libdfp/trunk/autom4te.cache/output.0 (original)
+++ libdfp/trunk/autom4te.cache/output.0 Tue May 25 23:18:27 2010
@@ -1,6 +1,6 @@
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.59 for libdfp 1.0.1.
+@%:@ Generated by GNU Autoconf 2.59 for libdfp 1.0.2.
@%:@
@%:@ Report bugs to <rsa@xxxxxxxxxx>.
@%:@
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='libdfp'
PACKAGE_TARNAME='libdfp'
-PACKAGE_VERSION='1.0.1'
-PACKAGE_STRING='libdfp 1.0.1'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='libdfp 1.0.2'
PACKAGE_BUGREPORT='rsa@xxxxxxxxxx'
ac_unique_file="printf_dfp.c"
@@ -741,7 +741,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdfp 1.0.1 to adapt to many kinds of systems.
+\`configure' configures libdfp 1.0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -802,7 +802,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdfp 1.0.1:";;
+ short | recursive ) echo "Configuration of libdfp 1.0.2:";;
esac
cat <<\_ACEOF
@@ -947,7 +947,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libdfp configure 1.0.1
+libdfp configure 1.0.2
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -961,7 +961,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdfp $as_me 1.0.1, which was
+It was created by libdfp $as_me 1.0.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -3448,7 +3448,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by libdfp $as_me 1.0.1, which was
+This file was extended by libdfp $as_me 1.0.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3508,7 +3508,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libdfp config.status 1.0.1
+libdfp config.status 1.0.2
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Modified: libdfp/trunk/autom4te.cache/traces.0
==============================================================================
--- libdfp/trunk/autom4te.cache/traces.0 (original)
+++ libdfp/trunk/autom4te.cache/traces.0 Tue May 25 23:18:27 2010
@@ -1,4 +1,4 @@
-m4trace:configure.ac:8: -1- AC_INIT([libdfp], [1.0.1], [rsa@xxxxxxxxxx])
+m4trace:configure.ac:8: -1- AC_INIT([libdfp], [1.0.2], [rsa@xxxxxxxxxx])
m4trace:configure.ac:8: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:8: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:8: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
Modified: libdfp/trunk/configure
==============================================================================
--- libdfp/trunk/configure (original)
+++ libdfp/trunk/configure Tue May 25 23:18:27 2010
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libdfp 1.0.1.
+# Generated by GNU Autoconf 2.59 for libdfp 1.0.2.
#
# Report bugs to <rsa@xxxxxxxxxx>.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='libdfp'
PACKAGE_TARNAME='libdfp'
-PACKAGE_VERSION='1.0.1'
-PACKAGE_STRING='libdfp 1.0.1'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='libdfp 1.0.2'
PACKAGE_BUGREPORT='rsa@xxxxxxxxxx'
ac_unique_file="printf_dfp.c"
@@ -741,7 +741,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdfp 1.0.1 to adapt to many kinds of systems.
+\`configure' configures libdfp 1.0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -802,7 +802,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdfp 1.0.1:";;
+ short | recursive ) echo "Configuration of libdfp 1.0.2:";;
esac
cat <<\_ACEOF
@@ -947,7 +947,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libdfp configure 1.0.1
+libdfp configure 1.0.2
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -961,7 +961,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdfp $as_me 1.0.1, which was
+It was created by libdfp $as_me 1.0.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -3448,7 +3448,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by libdfp $as_me 1.0.1, which was
+This file was extended by libdfp $as_me 1.0.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3508,7 +3508,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libdfp config.status 1.0.1
+libdfp config.status 1.0.2
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Modified: libdfp/trunk/ieee754r/Versions
==============================================================================
--- libdfp/trunk/ieee754r/Versions (original)
+++ libdfp/trunk/ieee754r/Versions Tue May 25 23:18:27 2010
@@ -54,12 +54,18 @@
fabsd32;
fabsd64;
fabsd128;
+ __fabsd32;
+ __fabsd64;
+ __fabsd128;
fdimd32;
fdimd64;
fdimd128;
finited32;
finited64;
finited128;
+ __finited32;
+ __finited64;
+ __finited128;
floord32;
floord64;
floord128;
@@ -78,6 +84,9 @@
fpclassifyd32;
fpclassifyd64;
fpclassifyd128;
+ __fpclassifyd32;
+ __fpclassifyd64;
+ __fpclassifyd128;
frexpd32;
frexpd64;
frexpd128;
@@ -96,6 +105,9 @@
isinfd32;
isinfd64;
isinfd128;
+ __isinfd32;
+ __isinfd64;
+ __isinfd128;
islessd32;
islessd64;
islessd128;
@@ -108,12 +120,21 @@
isnand32;
isnand64;
isnand128;
+ __isnand32;
+ __isnand64;
+ __isnand128;
isnormald32;
isnormald64;
isnormald128;
+ __isnormald32;
+ __isnormald64;
+ __isnormald128;
isunorderedd32;
isunorderedd64;
isunorderedd128;
+ __isunorderedd32;
+ __isunorderedd64;
+ __isunorderedd128;
ldexpd32;
ldexpd64;
ldexpd128;
@@ -189,6 +210,9 @@
signbitd32;
signbitd64;
signbitd128;
+ __signbitd32;
+ __signbitd64;
+ __signbitd128;
sind32;
sind64;
sind128;
Added: libdfp/trunk/sysdeps/powerpc/dfpu/finited32.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/finited32.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/finited32.c Tue May 25 23:18:27 2010
@@ -1,0 +1,51 @@
+/* _Decimal32 finite classification function.
+
+ Copyright (C) 2006 IBM Corporation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE
+# define _DECIMAL_SIZE 32
+#endif
+
+#include <math.h>
+
+#define FUNCTION_NAME finite
+
+#include <dfpmacro.h>
+
+int
+INTERNAL_FUNCTION_NAME (DEC_TYPE x)
+{
+ int result = 0;
+ __asm__( "dtstdc cr0,%1,0x38;"
+ "li %0,0;"
+ "bne cr0,1f;"
+ "li %0,1;"
+ "1:;"
+ : "=r" (result): "f" ((_Decimal64) x): "cr0");
+
+ return result;
+}
+
+weak_alias (INTERNAL_FUNCTION_NAME, EXTERNAL_FUNCTION_NAME)
Added: libdfp/trunk/sysdeps/powerpc/dfpu/finited64.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/finited64.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/finited64.c Tue May 25 23:18:27 2010
@@ -1,0 +1,27 @@
+/* _Decimal64 finite classification function.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE 64
+#include "finited32.c"
Added: libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd32.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd32.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd32.c Tue May 25 23:18:27 2010
@@ -1,0 +1,61 @@
+/* _Decimal32 fpclassify classification function.
+
+ Copyright (C) 2006 IBM Corporation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE
+# define _DECIMAL_SIZE 32
+#endif
+
+#include <math.h>
+
+#define FUNCTION_NAME fpclassify
+
+#include <dfpmacro.h>
+
+int
+INTERNAL_FUNCTION_NAME (DEC_TYPE x)
+{
+ int result = 0;
+/* check in order, FP_NORMAL, FP_ZERO, FP_SUBNORMAL, FP_INFINITE,
+ FP_NAN. The though is the most liky case exits early. */
+ __asm__( "dtstdc cr0,%1,0x08;"
+ "li %0,4;"
+ "beq cr0,1f;"
+ "dtstdc cr0,%1,0x20;"
+ "li %0,2;"
+ "beq cr0,1f;"
+ "dtstdc cr0,%1,0x10;"
+ "li %0,3;"
+ "beq cr0,1f;"
+ "dtstdc cr0,%1,0x04;"
+ "li %0,1;"
+ "beq cr0,1f;"
+ "li %0,0;"
+ "1:;"
+ : "=r" (result): "f" ((_Decimal64) x): "cr0");
+ return result;
+}
+
+weak_alias (INTERNAL_FUNCTION_NAME, EXTERNAL_FUNCTION_NAME)
Added: libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd64.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd64.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/fpclassifyd64.c Tue May 25 23:18:27 2010
@@ -1,0 +1,26 @@
+/* _Decimal64 fpclassify classification function.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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_SIZE 64
+#include "fpclassifyd32.c"
Added: libdfp/trunk/sysdeps/powerpc/dfpu/isinfd32.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/isinfd32.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/isinfd32.c Tue May 25 23:18:27 2010
@@ -1,0 +1,53 @@
+/* _Decimal32 isinf classification function.
+
+ Copyright (C) 2006 IBM Corporation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE
+# define _DECIMAL_SIZE 32
+#endif
+
+#include <math.h>
+
+#define FUNCTION_NAME isinf
+
+#include <dfpmacro.h>
+
+int
+INTERNAL_FUNCTION_NAME (DEC_TYPE x)
+{
+ int result = 0;
+ __asm__( "dtstdc cr0,%1,0x04;"
+ "li %0,0;"
+ "bne cr0,1f;"
+ "li %0,1;"
+ "bnl cr0,1f;"
+ "neg %0,%0;"
+ "1:;"
+ : "=r" (result): "f" ((_Decimal64) x): "cr0");
+
+ return result;
+}
+
+weak_alias (INTERNAL_FUNCTION_NAME, EXTERNAL_FUNCTION_NAME)
Added: libdfp/trunk/sysdeps/powerpc/dfpu/isinfd64.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/isinfd64.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/isinfd64.c Tue May 25 23:18:27 2010
@@ -1,0 +1,27 @@
+/* _Decimal64 isinf classification function.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE 64
+#include "isinfd32.c"
Added: libdfp/trunk/sysdeps/powerpc/dfpu/isnand32.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/isnand32.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/isnand32.c Tue May 25 23:18:27 2010
@@ -1,0 +1,50 @@
+/* _Decimal32 isNaN classification function.
+
+ Copyright (C) 2006 IBM Corporation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE
+# define _DECIMAL_SIZE 32
+#endif
+
+#include <math.h>
+
+#define FUNCTION_NAME isnan
+
+#include <dfpmacro.h>
+
+int
+INTERNAL_FUNCTION_NAME (DEC_TYPE x)
+{
+ int result = 0;
+ __asm__( "dtstdc cr0,%1,3;"
+ "li %0,0;"
+ "bne cr0,1f;"
+ "li %0,1;"
+ "1:;"
+ : "=r" (result): "f" ((_Decimal64) x): "cr0");
+ return result;
+}
+
+weak_alias (INTERNAL_FUNCTION_NAME, EXTERNAL_FUNCTION_NAME)
Added: libdfp/trunk/sysdeps/powerpc/dfpu/isnand64.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/isnand64.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/isnand64.c Tue May 25 23:18:27 2010
@@ -1,0 +1,26 @@
+/* _Decimal64 isNaN classification function.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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_SIZE 64
+#include "isnand32.c"
Added: libdfp/trunk/sysdeps/powerpc/dfpu/quantized128.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/quantized128.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/quantized128.c Tue May 25 23:18:27 2010
@@ -1,0 +1,26 @@
+/* Set the exponent of x to the exp of y, trying to preserve the value of x
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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_SIZE 128
+#include "quantized32.c"
Added: libdfp/trunk/sysdeps/powerpc/dfpu/quantized32.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/quantized32.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/quantized32.c Tue May 25 23:18:27 2010
@@ -1,0 +1,56 @@
+/* Set the exponent of x to the exp of y, trying to preserve the value of x
+
+ Copyright (C) 2006 IBM Corporation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Steven Munroe <munroesj@xxxxxxxxxx>
+ Ryan S. Arnold <rsa@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_SIZE
+# define _DECIMAL_SIZE 32
+#endif
+
+#include <math.h>
+
+#define FUNCTION_NAME quantize
+
+#include <dfpmacro.h>
+
+DEC_TYPE
+INTERNAL_FUNCTION_NAME (DEC_TYPE x, DEC_TYPE y)
+{
+#if _DECIMAL_SIZE == 128
+ _Decimal128 result;
+
+ __asm__("dquaq %0,%1,%2,3;"
+ : "=f" (result): "f" ((_Decimal128) y), "f" ((_Decimal128) x));
+#else
+ /* Always use _Decimal64 asm insns for _Decimal32 since there are no
+ * _Decimal32 insns. */
+ _Decimal64 result;
+
+ __asm__("dqua %0,%1,%2,3;"
+ : "=f" (result): "f" ((_Decimal64) y), "f" ((_Decimal64) x));
+#endif
+ return (DEC_TYPE) result;
+}
+
+weak_alias (INTERNAL_FUNCTION_NAME, EXTERNAL_FUNCTION_NAME)
Added: libdfp/trunk/sysdeps/powerpc/dfpu/quantized64.c
==============================================================================
--- libdfp/trunk/sysdeps/powerpc/dfpu/quantized64.c (added)
+++ libdfp/trunk/sysdeps/powerpc/dfpu/quantized64.c Tue May 25 23:18:27 2010
@@ -1,0 +1,26 @@
+/* Set the exponent of x to the exp of y, trying to preserve the value of x
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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_SIZE 64
+#include "quantized32.c"
Modified: libdfp/trunk/tests/scaffold.c
==============================================================================
--- libdfp/trunk/tests/scaffold.c (original)
+++ libdfp/trunk/tests/scaffold.c Tue May 25 23:18:27 2010
@@ -26,17 +26,18 @@
#include <stdio.h>
#include "decode.h"
-#ifndef _C
+static int fail = 0;
+
+/* String compare macros */
+#ifndef _SC
#include <string.h>
#include <stdarg.h>
#include <limits.h> /* For CHAR_MAX. */
-static int fail = 0;
-
/* Generally don't invoke this directly unless you already have __LINE__ set in
- * a variable and want _C_P to output it. The name stands for Compare with
+ * a variable and want _SC_P to output it. The name stands for Compare with
* Position. */
-#define _C_P(f,l,x,y) do { \
+#define _SC_P(f,l,x,y) do { \
if(strcmp(x,y)) { \
fprintf(stderr, "Error: Expected: \"%s\" - Result: \"%s\" in: %s:%d.\n", x,y,f,l); \
++fail; \
@@ -45,10 +46,11 @@
} \
} while (0)
-#define _C(x,y) _C_P (__FILE__,__LINE__,x,y)
+#define _SC(x,y) _SC_P (__FILE__,__LINE__,x,y)
-#endif /* _C */
+#endif /* _SC */
+#ifdef _WANT_PC
static char buf[CHAR_MAX];
#ifndef _PC
@@ -57,7 +59,7 @@
memset(buf,'\0',CHAR_MAX); \
/* Invokes printf dfp. */ \
sprintf(buf, y, ##args); \
- _C_P(f,l,x,buf); \
+ _SC_P(f,l,x,buf); \
} while (0)
/* _PC == Printf_dfp Compare
@@ -77,28 +79,61 @@
*/
#define _PC(x,y,...) _PC_P (__FILE__,__LINE__,x,y,__VA_ARGS__)
#endif /* _PC */
+#endif /* _WANT_PC */
+#ifdef _WANT_VC
+static char bufx[CHAR_MAX];
+static char bufy[CHAR_MAX];
+#ifndef _VC
+/* _VC_P == Value Compare with Position */
+#define _VC_P(f,l,x,y,fmt) do { \
+ memset(bufx,'\0',CHAR_MAX); \
+ memset(bufy,'\0',CHAR_MAX); \
+ /* Invokes printf dfp. */ \
+ sprintf(bufx, fmt, x); \
+ sprintf(bufy, fmt, y); \
+ if(x!=y) { \
+ fprintf(stderr, "Error: Expected: \"%s\" - Result: \"%s\" in: %s:%d.\n", bufx,bufy,f,l); \
+ ++fail; \
+ } else { \
+ fprintf(stdout, "Success: Expected: \"%s\" - Result: \"%s\" in: %s:%d.\n", bufx,bufy,f,l); \
+ } \
+} while (0)
+/* _VC == Value Compare
+ *
+ * Macro used to compare the result of an operation against an expected result.
+ * X: Expected Value
+ * Y: Actual Value
+ */
+#define _VC(x,y,fmt) _VC_P (__FILE__,__LINE__,x,y,fmt)
+#endif /* _VC */
+#endif /* _WANT_VC */
+
+#ifdef _WANT_DC
+static char dbuf[CHAR_MAX];
#ifndef _DC
+/* _DC == Decoded[32|64|128] Compare
+ */
/* Pick up the decoded[32|64|128] prototypes. */
#include "decode.h"
-/* _DC == decoded[32|64|128] Compare with Position. Use this if the position is
- * pre-determined. Don't call this on Non-_Decimal values. The outcome is
+/* _DC_P == decoded[32|64|128] Compare with Position. Use this if the position
+ * is pre-determined. Don't call this on Non-_Decimal values. The outcome is
* undefined. */
#define _DC_P(f,l,x,y) do { \
- memset(buf,'\0',CHAR_MAX); \
+ memset(dbuf,'\0',CHAR_MAX); \
/* Invoke the correct decoded{32|64|128]() based on arg size. */ \
- (sizeof (y) == sizeof (_Decimal128)? decoded128(y,&buf[0]): \
- (sizeof (y) == sizeof (_Decimal64)? decoded64(y,&buf[0]): \
- decoded32(y,&buf[0]))); \
- _C_P(f,l,x,buf); \
+ (sizeof (y) == sizeof (_Decimal128)? decoded128(y,&dbuf[0]): \
+ (sizeof (y) == sizeof (_Decimal64)? decoded64(y,&dbuf[0]): \
+ decoded32(y,&dbuf[0]))); \
+ _SC_P(f,l,x,dbuf); \
} while (0)
/* _DC == decoded[32|64|128] Compare
*
- * Variadic macro used to compare a decoded[32|64|128]() invocation with an
+ * Macro used to compare a decoded[32|64|128]() invocation with an
* expected result.
*
* X: Expected decoded[32|64|128] Output String
@@ -108,11 +143,12 @@
* result' string to precede everything and you don't need to define a buffer.
*
* e.g.
- * _DC("0.000033333", (_Decimal128) 0.00033333DL);
+ * _DC("+0,000,000,000,000,000,000,000,000,000,000,100E-2", (_Decimal128) 1.00DL);
*
*/
#define _DC(x,y) _DC_P (__FILE__,__LINE__,x,y)
#endif /* _DC */
+#endif /* _WANT_DC */
#ifndef _REPORT
@@ -125,4 +161,3 @@
#endif /* _REPORT */
-
Added: libdfp/trunk/tests/test-decode.c
==============================================================================
--- libdfp/trunk/tests/test-decode.c (added)
+++ libdfp/trunk/tests/test-decode.c Tue May 25 23:18:27 2010
@@ -1,0 +1,109 @@
+/* Test decoded facility.
+
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h>
+#include <dfp.h>
+#include <stdio.h>
+#include <wchar.h> /* This should pick up the libdfp wchar in dfp/wchar.h. */
+
+#define _WANT_DC 1
+#include "scaffold.c" /* Pick up the _DC_P(x,y,...) macro. */
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 d;
+ const char *expect;
+} d128_type;
+
+typedef struct{
+ int line;
+ _Decimal64 d;
+ const char *expect;
+} d64_type;
+
+typedef union{
+ _Decimal128 d;
+ long i[4];
+} d128_u;
+
+typedef union{
+ _Decimal64 d;
+ long i[4];
+} d64_u;
+
+int main (void)
+{
+ d64_type *d64ptr = NULL;
+ d128_type *d128ptr = NULL;
+
+ d64_u d64u;
+ d64u.d = 1.00DD;
+
+ d128_u d128u;
+ d128u.d = 1.00DL;
+
+ d64_type d64types[] =
+ {
+#ifdef _DPD_BACKEND
+ {__LINE__,1.00DD, "+0,000,000,000,000,100E-2"},
+#else
+ {__LINE__,1.00DD, "BID not supported."},
+#endif
+ {0,0,0 }
+ };
+
+ d128_type d128types[] =
+ {
+#ifdef _DPD_BACKEND
+ {__LINE__,1.00DL, "+0,000,000,000,000,000,000,000,000,000,000,100E-2"},
+#else
+ {__LINE__,1.00DL, "BID not supported."},
+#endif
+ { 0,0,0 }
+ };
+
+ for (d128ptr = d128types; d128ptr->line; d128ptr++)
+ {
+ _DC_P(__FILE__,d128ptr->line, d128ptr->expect,d128ptr->d);
+ }
+
+ for (d64ptr = d64types; d64ptr->line; d64ptr++)
+ {
+ _DC_P(__FILE__,d64ptr->line, d64ptr->expect,d64ptr->d);
+ }
+
+ printf("foo: %.8lx%.8lx\n", d64u.i[0],d64u.i[1]);
+ printf("foo: %.8lx%.8lx%.8lx%.8lx\n", d128u.i[0],d128u.i[1],d128u.i[2],d128u.i[3]);
+/* printf("foo: %lld\n", d128u.lli); */
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
Added: libdfp/trunk/tests/test-finite.c
==============================================================================
--- libdfp/trunk/tests/test-finite.c (added)
+++ libdfp/trunk/tests/test-finite.c Tue May 25 23:18:27 2010
@@ -1,0 +1,134 @@
+/* Test finite[32|64|128] and polymorphic macro finite() in math.h.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h> /* DEC_NAN definition. */
+#include <dfp.h>
+#include <stdio.h>
+#include <math.h>
+
+#define _WANT_VC 1 /* Pick up the _VC_P(x,y,fmt) macro. */
+#include "scaffold.c" /* Pick up the _VC_P(x,y,fmt) macro. */
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d128_type;
+
+d128_type printf_d128s[] =
+{
+ {__LINE__, 1.20DL, 1, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D128, 0, "%d"},
+ {__LINE__, DEC_INFINITY, 0, "%d"},
+ {__LINE__, -1.95DL, 1, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal64 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d64_type;
+
+d64_type printf_d64s[] =
+{
+ {__LINE__, 1.20DD, 1, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D64, 0, "%d"},
+ {__LINE__, DEC_INFINITY, 0, "%d"},
+ {__LINE__, -1.95DD, 1, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal32 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d32_type;
+
+d32_type printf_d32s[] =
+{
+ {__LINE__, 1.20DF, 1, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D32, 0, "%d"},
+ {__LINE__, DEC_INFINITY, 0, "%d"},
+ {__LINE__, -1.95DF, 1, "%d"},
+ {0,0,0,0 }
+};
+
+int main (void)
+{
+ d128_type *d128ptr;
+ d64_type *d64ptr;
+ d32_type *d32ptr;
+
+ for (d128ptr = printf_d128s; d128ptr->line; d128ptr++)
+ {
+ int retval = finited128(d128ptr->x);
+ fprintf(stdout,"%d = finited128(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+
+ retval = isfinite(d128ptr->x);
+ fprintf(stdout,"%d = isfinite(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+ }
+
+ for (d64ptr = printf_d64s; d64ptr->line; d64ptr++)
+ {
+ int retval = finited64(d64ptr->x);
+ fprintf(stdout,"%d = finited64(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+
+ retval = isfinite(d64ptr->x);
+ fprintf(stdout,"%d = isfinite(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+ }
+
+ for (d32ptr = printf_d32s; d32ptr->line; d32ptr++)
+ {
+ int retval = finited32(d32ptr->x);
+ fprintf(stdout,"%d = finited32(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+
+ retval = isfinite(d32ptr->x);
+ fprintf(stdout,"%d = isfinite(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+ }
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
+
+
Added: libdfp/trunk/tests/test-fpclassify.c
==============================================================================
--- libdfp/trunk/tests/test-fpclassify.c (added)
+++ libdfp/trunk/tests/test-fpclassify.c Tue May 25 23:18:27 2010
@@ -1,0 +1,165 @@
+/* Test finite[32|64|128] and polymorphic macro finite() in math.h.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h> /* DEC_NAN definition. */
+#include <dfp.h>
+#include <stdio.h>
+#include <math.h>
+
+#define _WANT_VC 1 /* Pick up the _VC_P(x,y,fmt) macro. */
+#include "scaffold.c" /* Pick up the _VC_P(x,y,fmt) macro. */
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d128_type;
+
+d128_type printf_d128s[] =
+{
+ {__LINE__, DEC_NAN, FP_NAN, "%d"},
+ {__LINE__, DEC_INFINITY, FP_INFINITE, "%d"},
+ {__LINE__, HUGE_VAL_D128, FP_INFINITE, "%d"},
+ {__LINE__, 0.0DL, FP_ZERO, "%d"},
+ {__LINE__, 2.3DL, FP_NORMAL, "%d"},
+ {__LINE__, -2.3DL, FP_NORMAL, "%d"},
+ {__LINE__, __DEC128_DEN__, FP_SUBNORMAL, "%d"}, /* Subnormal */
+ {__LINE__, 0.000000000000000000000000000000001E-6143DL, FP_SUBNORMAL, "%d"},
+ {__LINE__, __DEC128_MIN__, FP_NORMAL, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal64 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d64_type;
+
+d64_type printf_d64s[] =
+{
+ {__LINE__, DEC_NAN, FP_NAN, "%d"},
+ {__LINE__, DEC_INFINITY, FP_INFINITE, "%d"},
+ {__LINE__, HUGE_VAL_D64, FP_INFINITE, "%d"},
+ {__LINE__, 0.0DD, FP_ZERO, "%d"},
+ {__LINE__, 2.3DD, FP_NORMAL, "%d"},
+ {__LINE__, -2.3DD, FP_NORMAL, "%d"},
+ {__LINE__, __DEC64_DEN__, FP_SUBNORMAL, "%d"}, /* Subnormal */
+ {__LINE__, 0.000000000000001E-383DD, FP_SUBNORMAL, "%d"},
+ {__LINE__, __DEC64_MIN__, FP_NORMAL, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal32 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d32_type;
+
+d32_type printf_d32s[] =
+{
+ {__LINE__, DEC_NAN, FP_NAN, "%d"},
+ {__LINE__, DEC_INFINITY, FP_INFINITE, "%d"},
+ {__LINE__, HUGE_VAL_D32, FP_INFINITE, "%d"},
+ {__LINE__, 0.0DF, FP_ZERO, "%d"},
+ {__LINE__, 2.3DF, FP_NORMAL, "%d"},
+ {__LINE__, -2.3DF, FP_NORMAL, "%d"},
+ {__LINE__, __DEC32_DEN__, FP_SUBNORMAL, "%d"}, /* Subnormal */
+ {__LINE__, 0.000001E-95DF, FP_SUBNORMAL, "%d"},
+ {__LINE__, __DEC32_MIN__, FP_NORMAL, "%d"},
+ {0,0,0,0 }
+};
+
+static void fpc(int i)
+{
+ switch (i) {
+ case FP_NAN:
+ fprintf(stdout,"FP_NAN");
+ break;
+ case FP_INFINITE:
+ fprintf(stdout,"FP_INFINITE");
+ break;
+ case FP_ZERO:
+ fprintf(stdout,"FP_ZERO");
+ break;
+ case FP_SUBNORMAL:
+ fprintf(stdout,"FP_SUBNORMAL");
+ break;
+ case FP_NORMAL:
+ fprintf(stdout,"FP_NORMAL");
+ break;
+ default:
+ fprintf(stdout,"unknown");
+ }
+}
+
+
+int main (void)
+{
+ d128_type *d128ptr;
+ d64_type *d64ptr;
+ d32_type *d32ptr;
+
+ for (d128ptr = printf_d128s; d128ptr->line; d128ptr++)
+ {
+ int retval = fpclassify(d128ptr->x);
+ fprintf(stdout,"%d (",retval);
+ fpc(retval);
+ fprintf(stdout,") = fpclassify(%DDfDL) in: %s:%d\n", d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+ }
+
+ for (d64ptr = printf_d64s; d64ptr->line; d64ptr++)
+ {
+ int retval = fpclassify(d64ptr->x);
+ fprintf(stdout,"%d (",retval);
+ fpc(retval);
+ fprintf(stdout,") = fpclassify(%DfDD) in: %s:%d\n", d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+ }
+
+
+ for (d32ptr = printf_d32s; d32ptr->line; d32ptr++)
+ {
+ int retval = fpclassify(d32ptr->x);
+ fprintf(stdout,"%d (",retval);
+ fpc(retval);
+ fprintf(stdout,") = fpclassify(%HfDF) in: %s:%d\n", d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+ }
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
+
+
Added: libdfp/trunk/tests/test-isinf.c
==============================================================================
--- libdfp/trunk/tests/test-isinf.c (added)
+++ libdfp/trunk/tests/test-isinf.c Tue May 25 23:18:27 2010
@@ -1,0 +1,134 @@
+/* Test isinfd[32|64|128] and polymorphic macro isinf() in math.h.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h> /* DEC_NAN definition. */
+#include <dfp.h>
+#include <stdio.h>
+#include <math.h>
+
+#define _WANT_VC 1 /* Pick up the _VC_P(x,y,fmt) macro. */
+#include "scaffold.c" /* Pick up the _VC_P(x,y,fmt) macro. */
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d128_type;
+
+d128_type printf_d128s[] =
+{
+ {__LINE__, 1.20DL, 0, "%d"},
+ {__LINE__, DEC_NAN, 0, "%d"},
+ {__LINE__, HUGE_VAL_D128, 1, "%d"},
+ {__LINE__, DEC_INFINITY, 1, "%d"},
+ {__LINE__, -1.95DL, 0, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal64 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d64_type;
+
+d64_type printf_d64s[] =
+{
+ {__LINE__, 1.20DD, 0, "%d"},
+ {__LINE__, DEC_NAN, 0, "%d"},
+ {__LINE__, HUGE_VAL_D64, 1, "%d"},
+ {__LINE__, DEC_INFINITY, 1, "%d"},
+ {__LINE__, -1.95DD, 0, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal32 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d32_type;
+
+d32_type printf_d32s[] =
+{
+ {__LINE__, 1.20DF, 0, "%d"},
+ {__LINE__, DEC_NAN, 0, "%d"},
+ {__LINE__, HUGE_VAL_D32, 1, "%d"},
+ {__LINE__, DEC_INFINITY, 1, "%d"},
+ {__LINE__, -1.95DF, 0, "%d"},
+ {0,0,0,0 }
+};
+
+int main (void)
+{
+ d128_type *d128ptr;
+ d64_type *d64ptr;
+ d32_type *d32ptr;
+
+ for (d128ptr = printf_d128s; d128ptr->line; d128ptr++)
+ {
+ int retval = isinfd128(d128ptr->x);
+ fprintf(stdout,"%d = isinfd128(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+
+ retval = isinf(d128ptr->x);
+ fprintf(stdout,"%d = isinf(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+ }
+
+ for (d64ptr = printf_d64s; d64ptr->line; d64ptr++)
+ {
+ int retval = isinfd64(d64ptr->x);
+ fprintf(stdout,"%d = isinfd64(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+
+ retval = isinf(d64ptr->x);
+ fprintf(stdout,"%d = isinf(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+ }
+
+ for (d32ptr = printf_d32s; d32ptr->line; d32ptr++)
+ {
+ int retval = isinfd32(d32ptr->x);
+ fprintf(stdout,"%d = isinfd32(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+
+ retval = isinf(d32ptr->x);
+ fprintf(stdout,"%d = isinf(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+ }
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
+
+
Added: libdfp/trunk/tests/test-isnan.c
==============================================================================
--- libdfp/trunk/tests/test-isnan.c (added)
+++ libdfp/trunk/tests/test-isnan.c Tue May 25 23:18:27 2010
@@ -1,0 +1,131 @@
+/* Test isnand[32|64|128] and polymorphic macro isnan() in math.h.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h> /* DEC_NAN definition. */
+#include <dfp.h>
+#include <stdio.h>
+#include <math.h>
+
+#define _WANT_VC 1 /* Pick up the _VC_P(x,y,fmt) macro. */
+#include "scaffold.c" /* Pick up the _VC_P(x,y,fmt) macro. */
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d128_type;
+
+d128_type printf_d128s[] =
+{
+ {__LINE__, 1.20DL, 0, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D128, 0, "%d"},
+ {__LINE__, -1.95DL, 0, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal64 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d64_type;
+
+d64_type printf_d64s[] =
+{
+ {__LINE__, 1.20DD, 0, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D64, 0, "%d"},
+ {__LINE__, -1.95DD, 0, "%d"},
+ {0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal32 x; /* Value to test */
+ int e; /* Result should be this. */
+ const char *format; /* printf %d */
+} d32_type;
+
+d32_type printf_d32s[] =
+{
+ {__LINE__, 1.20DF, 0, "%d"},
+ {__LINE__, DEC_NAN, 1, "%d"},
+ {__LINE__, HUGE_VAL_D32, 0, "%d"},
+ {__LINE__, -1.95DF, 0, "%d"},
+ {0,0,0,0 }
+};
+
+int main (void)
+{
+ d128_type *d128ptr;
+ d64_type *d64ptr;
+ d32_type *d32ptr;
+
+ for (d128ptr = printf_d128s; d128ptr->line; d128ptr++)
+ {
+ int retval = isnand128(d128ptr->x);
+ fprintf(stdout,"%d = isnand128(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+
+ retval = isnan(d128ptr->x);
+ fprintf(stdout,"%d = isnan(%DDfDL) in: %s:%d\n", retval, d128ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->e,retval,d128ptr->format);
+ }
+
+ for (d64ptr = printf_d64s; d64ptr->line; d64ptr++)
+ {
+ int retval = isnand64(d64ptr->x);
+ fprintf(stdout,"%d = isnand64(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+
+ retval = isnan(d64ptr->x);
+ fprintf(stdout,"%d = isnan(%DfDD) in: %s:%d\n", retval, d64ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->e,retval,d64ptr->format);
+ }
+
+ for (d32ptr = printf_d32s; d32ptr->line; d32ptr++)
+ {
+ int retval = isnand32(d32ptr->x);
+ fprintf(stdout,"%d = isnand32(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+
+ retval = isnan(d32ptr->x);
+ fprintf(stdout,"%d = isnan(%HfDF) in: %s:%d\n", retval, d32ptr->x,__FILE__,__LINE__-1);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->e,retval,d32ptr->format);
+ }
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
+
+
Modified: libdfp/trunk/tests/test-param.c
==============================================================================
--- libdfp/trunk/tests/test-param.c (original)
+++ libdfp/trunk/tests/test-param.c Tue May 25 23:18:27 2010
@@ -38,7 +38,8 @@
/* Pick up the decoded* headers. */
#include "decode.h"
-#include "scaffold.c" /* Pick up the _PC(x,y,...) macro. */
+#define _WANT_DC 1
+#include "scaffold.c" /* Pick up the _DC_P(x,y) macro. */
/* Inspired by GLIBC stdio-common/tfformat.c */
typedef struct{
Modified: libdfp/trunk/tests/test-printf.c
==============================================================================
--- libdfp/trunk/tests/test-printf.c (original)
+++ libdfp/trunk/tests/test-printf.c Tue May 25 23:18:27 2010
@@ -31,7 +31,8 @@
#include <stdio.h>
#include <wchar.h> /* This should pick up the libdfp wchar in dfp/wchar.h. */
-#include "scaffold.c" /* Pick up the _PC(x,y,...) macro. */
+#define _WANT_PC 1 /* Pick up the _PC(x,y,...) macro. */
+#include "scaffold.c"
/* Inspired by GLIBC stdio-common/tfformat.c */
typedef struct{
Added: libdfp/trunk/tests/test-quantize.c
==============================================================================
--- libdfp/trunk/tests/test-quantize.c (added)
+++ libdfp/trunk/tests/test-quantize.c Tue May 25 23:18:27 2010
@@ -1,0 +1,116 @@
+/* Test quantize
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of the Decimal Floating Point C Library.
+
+ Author(s): Ryan S. Arnold <rsa@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 __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+#include <float.h>
+#include <dfp.h>
+#include <stdio.h>
+#include <math.h>
+
+#define _WANT_VC 1 /* Pick up the _VC_P(x,y,fmt) macro. */
+#include "scaffold.c"
+
+/* Inspired by GLIBC stdio-common/tfformat.c */
+typedef struct{
+ int line;
+ _Decimal128 qx; /* Set the exponent of this... */
+ _Decimal128 qy; /* to the exponent of this... */
+ _Decimal128 qe; /* and the result should be this. */
+ const char *format; /* format code for displaying %H, %D, %DD */
+} d128_type;
+
+d128_type printf_d128s[] =
+{
+ {__LINE__, 123.456DL, 0.12DL, 123.46DL, "%DDfDL"},
+ {__LINE__, -1.95DL, -190.55DL, -1.95DL, "%DDfDL"},
+ {0,0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal64 qx; /* Set the exponent of this... */
+ _Decimal64 qy; /* to the exponent of this... */
+ _Decimal64 qe; /* and the result should be this. */
+ const char *format; /* format code for displaying %H, %D, %DD */
+} d64_type;
+
+d64_type printf_d64s[] =
+{
+ {__LINE__, 123.456DD, 0.12DD, 123.46DD, "%DfDD"},
+ {__LINE__, -1.95DD, -190.55DD, -1.95DD, "%DfDD"},
+ {0,0,0,0,0 }
+};
+
+typedef struct{
+ int line;
+ _Decimal32 qx; /* Set the exponent of this... */
+ _Decimal32 qy; /* to the exponent of this... */
+ _Decimal32 qe; /* and the result should be this. */
+ const char *format; /* format code for displaying %H, %D, %DD */
+} d32_type;
+
+d32_type printf_d32s[] =
+{
+ {__LINE__, 123.456DF, 0.12DF, 123.46DF, "%HfDF"},
+ {__LINE__, -1.95DF, -190.55DF, -1.95DF, "%HfDF"},
+ {0,0,0,0,0 }
+};
+
+int main (void)
+{
+ d128_type *d128ptr;
+ d64_type *d64ptr;
+ d32_type *d32ptr;
+
+ for (d128ptr = printf_d128s; d128ptr->line; d128ptr++)
+ {
+ _Decimal128 retval = quantized128(d128ptr->qx,d128ptr->qy);
+ fprintf(stdout,"%DDfDL = quantized128(%DDfDL,%DDfDL)\n", retval, d128ptr->qx, d128ptr->qy);
+ _VC_P(__FILE__,d128ptr->line, d128ptr->qe,retval,d128ptr->format);
+ }
+
+ for (d64ptr = printf_d64s; d64ptr->line; d64ptr++)
+ {
+ _Decimal64 retval = quantized64(d64ptr->qx,d64ptr->qy);
+ fprintf(stdout,"%DfDD = quantized64(%DfDD,%DfDD)\n", retval, d64ptr->qx, d64ptr->qy);
+ _VC_P(__FILE__,d64ptr->line, d64ptr->qe,retval,d64ptr->format);
+ }
+
+ for (d32ptr = printf_d32s; d32ptr->line; d32ptr++)
+ {
+ _Decimal32 retval = quantized32(d32ptr->qx,d32ptr->qy);
+ fprintf(stdout,"%HfDF = quantized32(%HfDF,%HfDF)\n", retval, d32ptr->qx, d32ptr->qy);
+ _VC_P(__FILE__,d32ptr->line, d32ptr->qe,retval,d32ptr->format);
+ }
+
+ _REPORT();
+
+ /* fail comes from scaffold.c */
+ return fail;
+}
+
+