diff mbox series

Compile libmvec with -fno-math-errno

Message ID 20240516081636.53206-1-Joe.Ramsay@arm.com
State New
Headers show
Series Compile libmvec with -fno-math-errno | expand

Commit Message

Joe Ramsay May 16, 2024, 8:16 a.m. UTC
Rounding intrinsics may not be inlined without
-fno-math-errno. libmvec is free to do what it
likes with errno, so disable it for better
performance.

Tested with no regression on aarch64 and x86_64.
---
 Makeconfig | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Szabolcs Nagy May 21, 2024, 2 p.m. UTC | #1
The 05/16/2024 09:16, Joe Ramsay wrote:
> Rounding intrinsics may not be inlined without
> -fno-math-errno. libmvec is free to do what it
> likes with errno, so disable it for better
> performance.
> 
> Tested with no regression on aarch64 and x86_64.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

committed, thanks.


> ---
>  Makeconfig | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Makeconfig b/Makeconfig
> index e583765712..2807b423c3 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -875,9 +875,10 @@ endif
>  +math-flags = -frounding-math
>  
>  # Logically only "libnldbl", "nonlib" and "testsuite" should be using
> -# -fno-math-errno. However due to GCC bug #88576, only "libm" can use
> -# -fno-math-errno.
> -+extra-math-flags = $(if $(filter libm,$(in-module)),-fno-math-errno,-fmath-errno)
> +# -fno-math-errno. However due to GCC bug #88576, only "libm" and
> +# "libmvec" can use -fno-math-errno.
> ++extra-math-flags = $(if $(filter libmvec libm,$(in-module)),\
> +                      -fno-math-errno,-fmath-errno)
>  
>  # Use 64 bit time_t support for installed programs
>  installed-modules = nonlib nscd ldconfig locale_programs \
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/Makeconfig b/Makeconfig
index e583765712..2807b423c3 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -875,9 +875,10 @@  endif
 +math-flags = -frounding-math
 
 # Logically only "libnldbl", "nonlib" and "testsuite" should be using
-# -fno-math-errno. However due to GCC bug #88576, only "libm" can use
-# -fno-math-errno.
-+extra-math-flags = $(if $(filter libm,$(in-module)),-fno-math-errno,-fmath-errno)
+# -fno-math-errno. However due to GCC bug #88576, only "libm" and
+# "libmvec" can use -fno-math-errno.
++extra-math-flags = $(if $(filter libmvec libm,$(in-module)),\
+                      -fno-math-errno,-fmath-errno)
 
 # Use 64 bit time_t support for installed programs
 installed-modules = nonlib nscd ldconfig locale_programs \