About GSOC.
Joseph Myers
joseph@codesourcery.com
Thu May 9 16:55:00 GMT 2019
On Wed, 8 May 2019, Tejas Joshi wrote:
> Hello.
> I can't figure out from the documentation how to add test cases in the
> testsuite and inspect the results. How can I do that? Although, Taking
> the mentioned conditions under consideration, I have made another
> patch, attached.
This patch still has problems. You can't assume that all of sig[0] and
sig[1] are below the 0.5 bit. You have to allow for the 0.5 bit possibly
being in any word of the significand, not necessarily the SIGSZ - 1 word,
meaning you have to loop over all words of the significand. A word
completely below the 0.5 bit can just be checked for being 0. A word
containing the 0.5 bit needs checking both the bits in that word below the
0.5 bit, and checking that the 0.5 bit is 1.
REAL_EXP (r) could be bigger than SIGNIFICAND_BITS, so you need to handle
that case (automatically an integer) rather than computing a spurious very
large n.
This should illustrate testcases that need adding, to cover the various
cases of where the 0.5 bit is and where any nonzero bit below it might be
- my suggestion is to add such tests, make sure they fail with your
existing patch, and only then fix the implementation to make them pass.
For some of those tests, you'll need to test long double or _Float128.
(Use DEF_EXT_LIB_FLOATN_NX_BUILTINS in builtins.def to add the built-in
function variants such as roundevenf128; existing round-to-integer
functions already have such variants.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list