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

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 01:01:46 PST 2016


mgorny added inline comments.


================
Comment at: lib/builtins/floattitf.c:65
+        if (a & ((tu_int)1 << LDBL_MANT_DIG)) {
+            a >>= 1;
+            ++e;
----------------
scanon wrote:
> Strictly speaking there's no need to adjust `a` here. If we rounded up into a new binade, then `a` is necessarily `0b1000...0`, and the leading 1 bit will get killed by the mask when we assemble `fb.u.high.all` regardless of its position. Same comment applies to floatuntitf.
I'm sorry but I don't feel confident changing that. AFAIU if the LDBL_MANT_DIG+1 bit is set, this code shifts it lower, so it won't actually be killed by the mask.


https://reviews.llvm.org/D27898





More information about the cfe-commits mailing list