From c39cf53702e570b64a70d8f7fdfe277017acfb5f Mon Sep 17 00:00:00 2001 From: Joe Ramsay Date: Thu, 16 May 2024 09:16:36 +0100 Subject: [PATCH] Compile libmvec with -fno-math-errno 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 --- Makeconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makeconfig b/Makeconfig index 59e21d4c82..9fe664ae3a 100644 --- a/Makeconfig +++ b/Makeconfig @@ -899,9 +899,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 \