Re: [PATCH] builtin fadd variants implementation

2019-09-09 Thread Joseph Myers
On Mon, 9 Sep 2019, Tejas Joshi wrote: > Hello. > I am using real_isfinite to check for overflow conditions. How should > I check for underflow? I have tried different ways but they > contradicted other cases to pass. I think the right check for underflow is: *before* calling exact_real_truncate

Re: [PATCH] builtin fadd variants implementation

2019-09-09 Thread Tejas Joshi
Hello. I am using real_isfinite to check for overflow conditions. How should I check for underflow? I have tried different ways but they contradicted other cases to pass. static bool fold_const_narrow_binary (real_value *result, const real_value *arg0, int icode, const real_value *ar

Re: [PATCH] builtin fadd variants implementation

2019-09-02 Thread Joseph Myers
On Mon, 2 Sep 2019, Tejas Joshi wrote: > Hello. > Should a result like 1.4 be considered as inexact if truncating > (narrowing?) from double to float? (due to loss of trailing bits) If the mathematical result of the arithmetic operation is literally the decimal number 1.4, as opposed to the doub

Re: [PATCH] builtin fadd variants implementation

2019-09-02 Thread Tejas Joshi
Hello. Should a result like 1.4 be considered as inexact if truncating (narrowing?) from double to float? (due to loss of trailing bits) Comments of real_arithmetic says that it returns TRUE if the result is inexact. There's another function, exact_real_truncate which returns TRUE if truncation is

Re: [PATCH] builtin fadd variants implementation

2019-08-27 Thread Joseph Myers
On Mon, 26 Aug 2019, Tejas Joshi wrote: > Hello. > I have made changes in the patch according to the above corrections. > However, I didn't understand how these following testcases are > supposed to handle. Will you please elaborate some more? > > > (E.g. fadd (0x1.01p0, FLT_MIN), as an examp

Re: [PATCH] builtin fadd variants implementation

2019-08-25 Thread Tejas Joshi
Hello. I have made changes in the patch according to the above corrections. However, I didn't understand how these following testcases are supposed to handle. Will you please elaborate some more? > (E.g. fadd (0x1.01p0, FLT_MIN), as an example from the glibc > tests: cases where an intermediat

Re: [PATCH] builtin fadd variants implementation

2019-08-21 Thread Joseph Myers
On Thu, 8 Aug 2019, Tejas Joshi wrote: > +/* Try to evaluate: > + > + *RESULT = fadd (*ARG0, *ARG1) > + > + in format FORMAT. Return true on success. */ > + > +static bool > +fold_const_fadd (real_value *result, const real_value *arg0, > + const real_value *arg1, const real_f

[PATCH] builtin fadd variants implementation

2019-08-08 Thread Tejas Joshi
Hi. This patch includes fadd variants implementation for folding. The patch bootstraps and survives regression tests on x86_64-linux-gnu. Thanks, Tejas gcc/ChangeLog: 2019-08-08 Tejas Joshi * builtin-types.def: New function type variable arguments. * builtins.def: New function defini