[PATCH] D26817: [APFloat] Implement PPCDoubleDouble add and subtract.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 12:10:02 PST 2016


timshen added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:4076
+
+bool DoubleAPFloat::isNegative() const { return Floats[0].isNegative(); }
+
----------------
hubert.reinterpretcast wrote:
> kbarton wrote:
> > Is it possible for Floats[1] to ever be negative?
> The magnitude of Floats[0] should be greater than that of Floats[1].
> The negative zero case may be interesting.
> Is it possible for Floats[1] to ever be negative?

It's possible, e.g. (+1.0, -1e-100), which models mathematical 1-1e-100.

And yes, the magnitude of Floats[0] is greater than Floats[1].

APFloat has special category flags for zero, so Floats[1] is completely ignored when Floats[0].getCategory() is Zero.


https://reviews.llvm.org/D26817





More information about the llvm-commits mailing list