[llvm-dev] [PPC, APFloat] Add full PPCDoubleDouble to APFloat

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 2 19:43:27 PDT 2016


Hi Tim,

How, in general, are you thinking about doing this? I ask because, as you clearly know, the double-double format is formed by the sum of two double-precision numbers, and the various arithmetic operations are formed mostly in terms of double-precision arithmetic on the elements of the pairs. As a result, I suspect we really just want to store the two double-precision numbers, and essentially delegate to APFloat IEEEdouble in the implementation of the various operations.

As such, one option might be that, when PPCDoubleDouble fltSemantics are selected, the exponent and sign are ignored, and we just store the data for the two double-precision floating-point numbers in the significand. We might even do this directly, by making the significand something like this:

  union Significand {
    integerPart part;
    integerPart *parts;
    APFloat *fltparts; // used for PPCDoubleDouble
  } significand;

Thanks again,
Hal

----- Original Message -----
> From: "Tim Shen" <timshen at google.com>
> To: llvm-dev at lists.llvm.org
> Cc: resistor at mac.com, "Hal Finkel" <hfinkel at anl.gov>, "Fiona Glaser" <escha at apple.com>, "Stephen Canon"
> <scanon at apple.com>, "Eric Christopher" <echristo at gmail.com>
> Sent: Friday, September 30, 2016 4:43:12 PM
> Subject: [PPC, APFloat] Add full PPCDoubleDouble to APFloat
> 
> 
> 
> 
> I have found some internal test failures due to the wrong constant
> folding on ppc_fp128.
> 
> 
> As documented in APFloat::PPCDoubleDouble, APFloat doesn't support
> PowerPC double-double correctly <
> https://github.com/llvm-mirror/llvm/blob/492acdd450bcdf9837494d6da029ed064f14fc33/lib/Support/APFloat.cpp#L74
> >.
> 
> 
> To support this, we need to add a second tuple of (sign, exponent,
> significand) to APFloat. I wonder where should I start to change, so
> that it's less hacky? I certainly expect refactoring to come. :)
> 
> 
> Thanks!

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-dev mailing list