This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 09/28] powerpc: consolidate rint


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]