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

[patches] DFP branch: Make convert.h machine-independent



Hello,

dfp/sysdeps/soft-dfp/convert.h currently uses power specific functions. The attached patch replaces this with the generic versions of these functions.

I've just made sure that it compiles for S/390.
Could someone please test this on Power? Thanks.

Bye,

-Andreas-

2008-08-15  Andreas Krebbel  <krebbel1@xxxxxxxxxx>

	* dfp/sysdeps/soft-dfp/convert.h (DFP_TEST_EXCEPTIONS,
	DFP_CLEAR_EXCEPTIONS): Use machine-indepedent functions.


Index: dfp/sysdeps/soft-dfp/convert.h
===================================================================
*** dfp/sysdeps/soft-dfp/convert.h.orig	2008-08-15 16:56:20.000000000 +0200
--- dfp/sysdeps/soft-dfp/convert.h	2008-08-15 18:13:19.000000000 +0200
*************** extern const _Decimal128 decpowof2[];
*** 279,294 ****
        (((status) & DEC_IEEE_854_Underflow) ? FE_UNDERFLOW : 0))

  #include <fenv_libc.h>
! #define DFP_TEST_EXCEPTIONS(status)	({	\
! 	fenv_union_t u; 			\
! 	u.fenv = fegetenv_register(); 		\
! 	u.l[1] & (status);			\
! 	})
! #define DFP_CLEAR_EXCEPTIONS(status)	{	\
! 	fenv_union_t u;				\
! 	u.fenv = fegetenv_register();		\
! 	u.l[1] &= ~status;			\
! 	fesetenv_register(u.fenv);		\
! 	}
  #define DFP_HANDLE_EXCEPTIONS(status)	feraiseexcept(status)

--- 279,285 ----
        (((status) & DEC_IEEE_854_Underflow) ? FE_UNDERFLOW : 0))

  #include <fenv_libc.h>
! #define DFP_TEST_EXCEPTIONS(status)	fetestexcept (status)
! #define DFP_CLEAR_EXCEPTIONS(status)	feclearexcept (status)
  #define DFP_HANDLE_EXCEPTIONS(status)	feraiseexcept(status)