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 05/28] powerpc: floor/floorf refactor


On Fri, Mar 29 2019, Adhemerval Zanella wrote:
> 
> 	* sysdeps/powerpc/fpu/round_to_integer.h (set_rounding_mode):
> 	Add FLOOR option.

Since you removed the definition of FLOOR from round_mode (enum) in the
previous patch, make sure you updated this ChangeLog entry with
something similar to:

	(round_mode): Add definition for FLOOR.

> diff --git a/sysdeps/powerpc/fpu/round_to_integer.h b/sysdeps/powerpc/fpu/round_to_integer.h
> index 417aae6242..77d9fc1f86 100644
> --- a/sysdeps/powerpc/fpu/round_to_integer.h
> +++ b/sysdeps/powerpc/fpu/round_to_integer.h
> @@ -37,6 +37,7 @@ set_fenv_mode (enum round_mode mode)
>    switch (mode)
>    {
>    case CEIL:  rmode = FE_UPWARD; break;
> +  case FLOOR: rmode = FE_DOWNWARD; break;
>    default:    rmode = FE_TONEAREST; break;
>    }
>    __fesetround_inline_nocheck (rmode);

Likewise, in this file, make sure you added the definition for FLOOR.

The patch looks good to me, with these changes.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>

> +double
> +__floor (double x)
> +{
> +#ifdef _ARCH_PWR5X
> +  return __builtin_floor (x);
> +#else
> +  return round_to_integer_double (FLOOR, x);
> +#endif
> +}

OK.  The arch check looks correct.


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