This is the mail archive of the gcc@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: RFC: Add BID as a configure time option for DFP


> -----Original Message-----
> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf
Of H.
> J. Lu
> Sent: Wednesday, January 10, 2007 5:35 PM
> To: Janis Johnson
> Cc: gcc@gcc.gnu.org; marius.cornea@intel.com; Menezes, Evandro;
> bje@au1.ibm.com
> Subject: Re: RFC: Add BID as a configure time option for DFP
> 
> On Wed, Jan 10, 2007 at 02:10:58PM -0800, Janis Johnson wrote:
> > On Wed, Jan 10, 2007 at 11:40:46AM -0800, H. J. Lu wrote:
> > > Both AMD and Intel like to have BID as a configure time option
> > > for DFP. Intel is planning to contribute a complete BID runtime
> > > library, which can be used by executables generate by gcc.
> > >
> > > As the first step, we'd like to contribute a BID<->DPD library so
that
> > > BID can be used with libdecnumber by executables generate by gcc
> > > before the complete BID runtime library is ready.
> > >
> > > Any comments?
> >
> > libdecnumber doesn't use DPD (densely packed decimal), it uses the
> > decNumber format.  Functions in libgcc convert from DPD to
decNumber,
> > call into libdecnumber to do computations, and then convert the
result
> > back to DPD.  It's all parameterized in dfp-bit.[ch], so replacing
> > conversions between decNumber structs and DPD with conversions
between
> > decNumber structs and BID (binary integer decimal) should be
> > straightforward; I don't think there's any need to convert between
BID
> > and DPD to use libdecnumber.
> 
> libdecnumber is used by both gcc and DFP executables.  We only want
> to use BID for DFP executables. That means we will need
BID<->decNumber
> for gcc to generate DFP executables which use the BID library.
> 
> Since the real BID library won't be ready for a while and in the
> meantime, we like to enable BID for gcc now, that is why we
> propose the BID<->DPD<->libdecnumber approach as a stopgap
> measure. We can plug in the real BID library later.
> 
> >
> > If all x86* targets will use BID then there's no need for a
configure
> > option.  Initial support using DPD for x86* was a proof of concept,
I
> > doubt that anyone would care if you replace it with BID support.
> 
> Glad to hear that. We can make it BID only for x86.

I've been looking into doing this, and now have some time cleared up on
my schedule that I can look at implementing it.  What I would like to do
is:

1) Update --enable-decimal-float to take an option of which format to
use
2) Set the defaults for x86_64/i386 to use BID
3) Add converter functions to libdecnumber that convert from/to BID to
the internal libdecnumber format.
4) I'm of two minds what to call the functions.  On one hand, it is
convenient to use the same names for the functions, but over the years,
I have seen many problems from using the same names for things that take
different formatted inputs, so I will likely make using BID functions
use different names.  This will also allow us to generate testing
compilers that use that alternate format.
5) Hopefully the Intel library will use the same names as the BID
functions in libdecnumber, so that it can be linked in.  We obviously
need names for each of the standard math support functions (ie,
add/sub/mul/div for _Decimal32/_Decimal64/_Decimal128 types).
6) Add a macro to libdec.h that says which format is being used.

--
Michael Meissner
AMD, MS 83-29
90 Central Street
Boxborough, MA 01719



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