This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About GSOC.
- From: Tejas Joshi <tejasjoshi9673 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Martin Jambor <mjambor at suse dot cz>
- Date: Thu, 4 Apr 2019 18:39:11 +0530
- Subject: Re: About GSOC.
- References: <CACMrGjCeaZ7EoYqjLYiAJXjOtOfpJNo9zcbWhfarfkiLMN8YYA@mail.gmail.com> <CACMrGjBw3-Xm1rHAanVUjYGC3SojJSgKZKL5B+HdkcTEOZ=Kkg@mail.gmail.com> <CACMrGjBBvv=taD6vCK9QcqQJYbGWJj_KSSeSBfnU_DRdcuonrw@mail.gmail.com> <alpine.DEB.2.21.1901231735280.25816@digraph.polyomino.org.uk> <CACMrGjC6NP5CE17M1gDf09B+2Gbufp3offHQmRX1D8hiWGrQ2Q@mail.gmail.com> <alpine.DEB.2.21.1901252130130.8264@digraph.polyomino.org.uk> <CACMrGjDxpwLcVGgAwTDN=LojT01dUTK03dCH54CR1wYFPjGjAg@mail.gmail.com> <CACMrGjARaj3Dy-PzSvTehLzchbDEdE8mbD0rH9Ko6Eu3mFERGg@mail.gmail.com> <CAAgBjMk+QBgY3YgMbuBaq--PkBWfN8jg42Fon1F6cbC2dRV2BA@mail.gmail.com> <CACMrGjC6Gk6UFr9T5iY0OgW5PJ92bB3tSrx59+D3FK+fMGYErQ@mail.gmail.com> <CAAgBjMk+8M2MYNdePb=rNfSkkCW=ZCezQPmqkMbYHe0nVJLzwQ@mail.gmail.com> <CACMrGjBu3+X5HCbPGyzn95gpzHY+8JvkfpyQGj_DoEeCJu2GqA@mail.gmail.com> <CACMrGjATDLe-i+EqVaH4Q6gpaGLmAJ8KgnCS-9qRbxgXOmhgLg@mail.gmail.com> <CACMrGjAeHRzkrao5bxZ2SSYBU-9Kvp_Dtn7qEWbt4wiOn18cvg@mail.gmail.com> <alpine.DEB.2.21.1904011947310.25789@digraph.polyomino.org.uk>
Hello.
Here is the proposal draft for the idea. Please review and suggest
changes or modifications.
https://docs.google.com/document/d/15DEXa5NZL6Q_X_zlME3NNJw2zVimFWzi16x7cgIDqL0/edit?usp=sharing
Thanks,
-Tejas
On Tue, 2 Apr 2019 at 01:23, Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Sat, 30 Mar 2019, Tejas Joshi wrote:
>
> > Hello.
> > I have developed a fairly working patch for roundeven, attaching herewith.
> > The testcase function as follows :
> >
> > double f()
> > {
> > double x = 4.5;
> > double ret = __builtin_roundeven (x);
> > return ret;
> > }
>
> Tests need to be added to the testsuite, covering a range of inputs and
> automatically verifying that the test is optimized correctly.
>
> "Round X to nearest even integer towards zero." is not correct. The
> roundeven function does not round to an even integer. It rounds to the
> nearest integer, whether even or odd - but, if two integers are equally
> close, the result is even (and for any input that is not halfway between
> two integers, it produces the same result as round (which rounds halfway
> cases away from zero) - so 2.501, 3 and 3.499 round to 3, but 2.5 rounds
> to 2 not 3, unlike round, and 3.5 rounds to 4, as with round).
>
> The function can't rely on arguments being in the range of HOST_WIDE_INT,
> so it needs to examine the REAL_VALUE_TYPE representation directly to
> determine whether it's half way between two integers and which way to
> round in that case.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com