diff mbox series

[02/12] powerpc: Add missing arch flags on rounding ifunc variants

Message ID 20231228172026.2013007-3-adhemerval.zanella@linaro.org
State New
Headers show
Series Improve rounding to interger function for C23 | expand

Commit Message

Adhemerval Zanella Dec. 28, 2023, 5:20 p.m. UTC
The ifunc variants now uses the powerpc implementation which in turn
uses the compiler builtin.  Without the proper -mcpu switch the builtin
does not generate the expected optimization.

Checked on powerpc-linux-gnu.
---
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

H.J. Lu April 1, 2024, 1:59 p.m. UTC | #1
On Thu, Dec 28, 2023 at 9:21 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> The ifunc variants now uses the powerpc implementation which in turn
> uses the compiler builtin.  Without the proper -mcpu switch the builtin
> does not generate the expected optimization.
>
> Checked on powerpc-linux-gnu.
> ---
>  sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> index 64317506c6..2f5c0eded6 100644
> --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> @@ -34,6 +34,12 @@ CFLAGS-s_modff-power5+.c = -mcpu=power5+
>  CFLAGS-s_logbl-power7.c = -mcpu=power7
>  CFLAGS-s_logb-power7.c = -mcpu=power7
>  CFLAGS-s_logbf-power7.c = -mcpu=power7
> +CFLAGS-s_round-power5+.c += -mcpu=power5+
> +CFLAGS-s_roundf-power5+.c += -mcpu=power5+
> +CFLAGS-s_floor-power5+.c += -mcpu=power5+
> +CFLAGS-s_floorf-power5+.c += -mcpu=power5+
> +CFLAGS-s_trunc-power5+.c += -mcpu=power5+
> +CFLAGS-s_truncf-power5+.c += -mcpu=power5+
>
>  # These files quiet sNaNs in a way that is optimized away without
>  # -fsignaling-nans.
> --
> 2.34.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.
Peter Bergner April 1, 2024, 4:50 p.m. UTC | #2
On 4/1/24 8:59 AM, H.J. Lu wrote:
> On Thu, Dec 28, 2023 at 9:21 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>> The ifunc variants now uses the powerpc implementation which in turn
>> uses the compiler builtin.  Without the proper -mcpu switch the builtin
>> does not generate the expected optimization.
>>
>> Checked on powerpc-linux-gnu.
>> ---
>>  sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
>> index 64317506c6..2f5c0eded6 100644
>> --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
>> +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
>> @@ -34,6 +34,12 @@ CFLAGS-s_modff-power5+.c = -mcpu=power5+
>>  CFLAGS-s_logbl-power7.c = -mcpu=power7
>>  CFLAGS-s_logb-power7.c = -mcpu=power7
>>  CFLAGS-s_logbf-power7.c = -mcpu=power7
>> +CFLAGS-s_round-power5+.c += -mcpu=power5+
>> +CFLAGS-s_roundf-power5+.c += -mcpu=power5+
>> +CFLAGS-s_floor-power5+.c += -mcpu=power5+
>> +CFLAGS-s_floorf-power5+.c += -mcpu=power5+
>> +CFLAGS-s_trunc-power5+.c += -mcpu=power5+
>> +CFLAGS-s_truncf-power5+.c += -mcpu=power5+
>>
>>  # These files quiet sNaNs in a way that is optimized away without
>>  # -fsignaling-nans.
>> --
>> 2.34.1
>>
> 
> LGTM.
> 
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

This predated me taking over the Power port, but...

LGTM too.

Reviewed-by: Peter Bergner <bergner@linux.ibm.com>


Peter
diff mbox series

Patch

diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
index 64317506c6..2f5c0eded6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
@@ -34,6 +34,12 @@  CFLAGS-s_modff-power5+.c = -mcpu=power5+
 CFLAGS-s_logbl-power7.c = -mcpu=power7
 CFLAGS-s_logb-power7.c = -mcpu=power7
 CFLAGS-s_logbf-power7.c = -mcpu=power7
+CFLAGS-s_round-power5+.c += -mcpu=power5+
+CFLAGS-s_roundf-power5+.c += -mcpu=power5+
+CFLAGS-s_floor-power5+.c += -mcpu=power5+
+CFLAGS-s_floorf-power5+.c += -mcpu=power5+
+CFLAGS-s_trunc-power5+.c += -mcpu=power5+
+CFLAGS-s_truncf-power5+.c += -mcpu=power5+
 
 # These files quiet sNaNs in a way that is optimized away without
 # -fsignaling-nans.