[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r12619 - in /libdfp/trunk: ./ sysdeps/s390/dfpu/



Author: ryanarn
Date: Fri Jan 21 08:43:23 2011
New Revision: 12619

Log:
Fixed x390 hw support for numdigits to bias the exponent and return '1' for a
zero mantissa which is congruent to what is done for soft-dfp.  Also enabled
extended rounding modes for s390.

Incremented version to 1.0.7.

2011-1-21  Ryan S. Arnold  <rsa@xxxxxxxxxx>

	* configure: Regenerated.
	* configure.ac: Incremented the version umber to 1.0.7.
	* Versions.def: Incremented the version umber to 1.0.7.

2011-1-21  Andreas Krebbel  <Andreas.Krebbel@xxxxxxxxxx>

	* sysdeps/s390/dfpu/numdigits.h (setexp): Bias the exponent and return
	'1' for z zero mantissa, which is what is done for soft-dfp.
	* sysdeps/s390/dfpu/fe_decround.c (__fe_dec_setround): Enable extended
	rounding modes (5,6 and 7) which are not covered by the standard.



Modified:
    libdfp/trunk/ChangeLog
    libdfp/trunk/Versions.def
    libdfp/trunk/configure
    libdfp/trunk/configure.ac
    libdfp/trunk/sysdeps/s390/dfpu/fe_decround.c
    libdfp/trunk/sysdeps/s390/dfpu/numdigits.h

Modified: libdfp/trunk/ChangeLog
==============================================================================
--- libdfp/trunk/ChangeLog (original)
+++ libdfp/trunk/ChangeLog Fri Jan 21 08:43:23 2011
@@ -1,3 +1,16 @@
+2011-1-21  Ryan S. Arnold  <rsa@xxxxxxxxxx>
+
+	* configure: Regenerated.
+	* configure.ac: Incremented the version umber to 1.0.7.
+	* Versions.def: Incremented the version umber to 1.0.7.
+
+2011-1-21  Andreas Krebbel  <Andreas.Krebbel@xxxxxxxxxx>
+
+	* sysdeps/s390/dfpu/numdigits.h (setexp): Bias the exponent and return
+	'1' for z zero mantissa, which is what is done for soft-dfp.
+	* sysdeps/s390/dfpu/fe_decround.c (__fe_dec_setround): Enable extended
+	rounding modes (5,6 and 7) which are not covered by the standard.
+
 2011-1-18  Ryan S. Arnold  <rsa@xxxxxxxxxx>
 
 	* configure: Regenerated.

Modified: libdfp/trunk/Versions.def
==============================================================================
--- libdfp/trunk/Versions.def (original)
+++ libdfp/trunk/Versions.def Fri Jan 21 08:43:23 2011
@@ -5,5 +5,6 @@
   LIBDFP_1.0.4
   LIBDFP_1.0.5
   LIBDFP_1.0.6
+  LIBDFP_1.0.7
   LIBDFP_PRIVATE
 }

Modified: libdfp/trunk/configure
==============================================================================
--- libdfp/trunk/configure (original)
+++ libdfp/trunk/configure Fri Jan 21 08:43:23 2011
@@ -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.6.
+# Generated by GNU Autoconf 2.59 for libdfp 1.0.7.
 #
 # Report bugs to <rsa@xxxxxxxxxx>.
 #
@@ -269,8 +269,8 @@
 # Identity of this package.
 PACKAGE_NAME='libdfp'
 PACKAGE_TARNAME='libdfp'
-PACKAGE_VERSION='1.0.6'
-PACKAGE_STRING='libdfp 1.0.6'
+PACKAGE_VERSION='1.0.7'
+PACKAGE_STRING='libdfp 1.0.7'
 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.6 to adapt to many kinds of systems.
+\`configure' configures libdfp 1.0.7 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.6:";;
+     short | recursive ) echo "Configuration of libdfp 1.0.7:";;
    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.6
+libdfp configure 1.0.7
 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.6, which was
+It was created by libdfp $as_me 1.0.7, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -3434,7 +3434,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by libdfp $as_me 1.0.6, which was
+This file was extended by libdfp $as_me 1.0.7, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3494,7 +3494,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-libdfp config.status 1.0.6
+libdfp config.status 1.0.7
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 

Modified: libdfp/trunk/configure.ac
==============================================================================
--- libdfp/trunk/configure.ac (original)
+++ libdfp/trunk/configure.ac Fri Jan 21 08:43:23 2011
@@ -5,7 +5,7 @@
 # has a hard-coded 2.59 requirement and Libdfp doesn't really care, but can't
 # control libdecnumber.
 AC_PREREQ(2.59)
-AC_INIT(libdfp, 1.0.6, rsa@xxxxxxxxxx)
+AC_INIT(libdfp, 1.0.7, rsa@xxxxxxxxxx)
 AC_CONFIG_SRCDIR([printf_dfp.c])
 
 # We don't use Automake so this is necessary.

Modified: libdfp/trunk/sysdeps/s390/dfpu/fe_decround.c
==============================================================================
--- libdfp/trunk/sysdeps/s390/dfpu/fe_decround.c (original)
+++ libdfp/trunk/sysdeps/s390/dfpu/fe_decround.c Fri Jan 21 08:43:23 2011
@@ -43,15 +43,17 @@
 int
 __fe_dec_setround (int round)
 {
-  if ((round|FPC_DFP_RM_MASK) != FPC_DFP_RM_MASK
-      || (round > FE_DEC_TONEARESTFROMZERO))
+  /* This currently also allows the extended rounding modes (5, 6 and
+     7) which are not covered by the standard.  Please see
+     fe_decround.c in the root dir for more information.  */
+  if (((round << 4) | FPC_DFP_RM_MASK) != FPC_DFP_RM_MASK)
     {
       /* ROUND is not a valid rounding mode.  */
       return 1;
     }
-  __asm__ volatile ("srnmt 0(%0)"
-		 		     :
-		 		     : "a" (round << 4));
+  __asm__ volatile ("llgfr %0,%0  \n\t"
+		    "srnmt 0(%0)"
+		    : "+a" (round));
 
   return 0;
 }

Modified: libdfp/trunk/sysdeps/s390/dfpu/numdigits.h
==============================================================================
--- libdfp/trunk/sysdeps/s390/dfpu/numdigits.h (original)
+++ libdfp/trunk/sysdeps/s390/dfpu/numdigits.h Fri Jan 21 08:43:23 2011
@@ -86,6 +86,8 @@
 static inline DEC_TYPE
 FUNC_D (setexp) (DEC_TYPE x, int exp)
 {
+  int biased_exp = exp + DECIMAL_BIAS;
+
 #if _DECIMAL_SIZE == 32
   _Decimal64 tmp = (_Decimal64)x;
 #elif _DECIMAL_SIZE == 128
@@ -95,12 +97,13 @@
 #endif
 
   asm (
+    "llgfr %1,%1   \n\t"
 #if _DECIMAL_SIZE == 128
     "iextr %0,%0,%1"
 #else
     "iedtr %0,%0,%1"
 #endif
-    : "+f" (tmp) : "r" (exp + DECIMAL_BIAS));
+    : "+f" (tmp), "+d" (biased_exp));
 
 #if _DECIMAL_SIZE == 32
   return (_Decimal32)tmp;
@@ -131,7 +134,12 @@
 #endif
    : "=d"(result) : "f"(tmp));
 
-  return result;
+  /* The Power hardware implementation returns 1 even for a zero
+     mantissa.  The software implementation in soft-dfp mimics that
+     behaviour.  The S/390 instructions return 0 for zero values.  So
+     we have to adjust this here in order to match the behaviour of
+     the existing functions.  */
+  return (result == 0 ? 1 : result);
 }
 
 static DEC_TYPE