Hello. I have already sent a patch for roundeven implementation but I do not know how do I commit my changes to GCC. Am I supposed to create a branch or anything etc? Also I have been trying to do folding for constant arguments and inspecting for only func (func (x)) -> func (x) right now. I made some changes to make this work including like : +(for fns (TRUNC_ALL FLOOR_ALL CEIL_ALL ROUND_ALL ROUNDEVEN_ALL NEARBYINT_ALL RINT_ALL) Also, BUILT_IN_ROUNDEVEN instead of ROUNDEVEN_ALL is not working here. Other changes regarding to this after inspecting round are included in this patch, but this seems not working and I am surely missing something. Do I need to include roundeven like round: DEFINE_INT_AND_FLOAT_ROUND_FN (ROUND) but this would require defining IROUNDEVEN in builtins.def but it is not supposed to? Thanks, --Tejas On Fri, 31 May 2019 at 19:00, Eric Gallager wrote: > > On 5/31/19, Nathan Sidwell wrote: > > On 5/30/19 5:38 PM, Segher Boessenkool wrote: > >> On Thu, May 30, 2019 at 07:08:45PM +0200, Martin Jambor wrote: > >>> Interesting, I was also puzzled for a moment. But notice that: > >>> > >>> int main () > >>> { > >>> _Float128 x = 18446744073709551617.5f128; > >>> _Float128 y = __builtin_roundf128 (x); > >>> } > >>> > >>> behaves as expected... the difference is of course the suffix pegged to > >>> the literal constant (see > >>> https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Floating-Types.html). > >>> > >>> I would also expect GCC to use a larger type if a constant does not fit > >>> into a double, but apparently that does not happen. I would have to > >>> check but it is probably the right behavior according to the standard. > >> > >> 6.4.4.2/4: "An unsuffixed floating constant has type double." I don't > >> think your suggestion would be okay? > > > > Not only that, but > > > > 1) there isn't a literal suffix to mean 'double', so one couldn't > > override that extended type. > > There's not a standard one, but there is 'D' or 'd' as a GNU > extension. The fact that it's nonstandard, though, is what causes some > projects to ignore -Wunsuffixed-float-constants: > https://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00017.html > > > 2) how do you define 'doesn't fit'? decimal 0.1 has a recurring binary > > representation. Should that become the longest floating point type? > > > > nathan > > > > -- > > Nathan Sidwell > >