This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 09/28] powerpc: consolidate rint
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 30 May 2019 11:36:40 -0300
- Subject: Re: [PATCH 09/28] powerpc: consolidate rint
- References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> <20190329133529.22523-10-adhemerval.zanella@linaro.org>
On Fri, Mar 29 2019, Adhemerval Zanella wrote:
>
> * sysdeps/powerpc/fpu/round_to_integer.h (set_fenv_mode,
> round_to_integer_float): Add RINT handling.
I think you should also add 'round_mode' to the list of entities that
got RINT handling added.
> (reset_fenv_mode): New symbol.
> * sysdeps/powerpc/fpu/s_rint.c (__rint): Use generic implementation.
> * sysdeps/powerpc/fpu/s_rintf.c (__rintf): Likewise.
OK.
> * sysdeps/powerpc/powerpc32/fpu/s_rint.S: Likewise.
> * sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Likewise.
> * sysdeps/powerpc/powerpc64/fpu/s_rint.S: Likewise.
> * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
Although 'Likewise' is semantically correct, I think these should be
listed as 'Remove file'.
Looks good to me.
Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
> set_fenv_mode (enum round_mode mode)
> {
> + fenv_t fe = 0;
> + if (mode != RINT)
> + /* Save current FPU rounding mode and inexact state. */
> + fe = fegetenv_register ();
> +
> switch (mode)
> {
> case CEIL:
> @@ -49,6 +55,22 @@ set_fenv_mode (enum round_mode mode)
> /* Disable FE_INEXACT exception */
> reset_fpscr_bit (FPSCR_XE);
> break;
> + case RINT:
> + break;
> + }
> + return fe;
OK. rint is like nearbyint but might raise INEXACT.