[PATCH] D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf()
Steve Canon via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 22 10:41:52 PST 2016
scanon added inline comments.
================
Comment at: lib/builtins/floatuntitf.c:73
+ long_double_bits fb;
+ fb.u.high.all = (du_int)(e + 16383) << 48 /* exponent */
+ | ((a >> 64) & 0x0000ffffffffffffLL); /* mantissa */
----------------
mgorny wrote:
> rengolin wrote:
> > rengolin wrote:
> > > mgorny wrote:
> > > > rengolin wrote:
> > > > > nit: an hexadecimal pattern here would be clearer. same above.
> > > > Do you mean something like: `(foo << 48) & 0xffff....`?
> > > No, just the `16383` to `0x3FFF`
> > Though, now I think your proposal may be better. :)
> >
> > Whatever works, I'm not too concerned about that.
> Well, I used the decimal form because that's how the IEEE 754 standard specifies it, so I guessed the correlation would be clearer that way.
FWIW, I think both are pretty obvious, but if you want to be totally explicit:
const int bias = 0x3fff;
... (e + bias) ...
https://reviews.llvm.org/D27898
More information about the cfe-commits
mailing list