[PATCH] D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf()

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 10:38:47 PST 2016


mgorny 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 */
----------------
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.


https://reviews.llvm.org/D27898





More information about the cfe-commits mailing list