This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR other/30530: dfp.c assumes DPD encoding


On Sun, Jan 21, 2007 at 03:24:26PM -0800, H. J. Lu wrote:
> On Sun, Jan 21, 2007 at 02:57:54PM -0800, H. J. Lu wrote:
> > On Mon, Jan 22, 2007 at 09:19:43AM +1100, Ben Elliston wrote:
> > > Hi HJ
> > > 
> > > On Sun, 2007-01-21 at 13:55 -0800, H. J. Lu wrote:
> > > 
> > > > Does this patch look OK?
> > > 
> > > Yes, but how did you test it?
> > > 
> > 
> > I tested it on Linux/x86-64 with --enable-decimal-float=dpd.
> > Unfortunately, there are 2 problems:
> > 
> > 1. There are
> > 
> >   if test x$enablevar = xyes ; then 
> >     case $target in
> >     powerpc*-*-linux* | i?86*-*-linux*)
> >       enable_decimal_float=yes
> >       ;;   
> > in configure.ac. That means DFP isn't enabled on Linux/x86-64 even
> > if it should work.
> > 
> > 2. There are
> > 
> > /* Set sign [this assumes sign previously 0] */
> > #define decimal128SetSign(d, b) {                                   \
> >       (d)->bytes[0]|=((unsigned)(b)<<7);}
> > 
> > That means decimal128SetSign(d, 0) doesn't work.  Why does it need
> > the second arg at all when only 1 works for the second arg? I
> > think we should change it to
> > 
> > #define decimal128SetSign(d) { (d)->bytes[0]|=0x80;}
> > 
> > and add
> > 
> > #define decimal128ClearSign(d) { (d)->bytes[0]&=~0x80;}
> > #define decimal128FlipSign(d) { (d)->bytes[0]^=0x80;}
> > 
> > The same apply for decimal32/decimal64.
> > 
> > I will prepare a patch.
> > 
> 
> I am testing this patch on Linux/x86-64 now.
> 

The result look OK:

http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00816.html


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]