Use -fno-builtin for sqrt benchmark

Message ID alpine.DEB.2.20.1610211704430.27636@digraph.polyomino.org.uk
State Committed
Headers

Commit Message

Joseph Myers Oct. 21, 2016, 5:05 p.m. UTC
  This patch makes the sqrt benchmark use -fno-builtin, as already done
for benchmarks of ffs and ffsll, so that it actually benchmarks the
glibc function as (presumably) intended even in the presence of the
compiler inlining sqrt.

Tested for x86_64 and also used for benchmarking my ARM sqrt patch.

2016-10-21  Joseph Myers  <joseph@codesourcery.com>

	* benchtests/Makefile (CFLAGS-bench-sqrt.c): New variable.
  

Comments

Tulio Magno Quites Machado Filho Oct. 21, 2016, 9:14 p.m. UTC | #1
Joseph Myers <joseph@codesourcery.com> writes:

> This patch makes the sqrt benchmark use -fno-builtin, as already done
> for benchmarks of ffs and ffsll, so that it actually benchmarks the
> glibc function as (presumably) intended even in the presence of the
> compiler inlining sqrt.
>
> Tested for x86_64 and also used for benchmarking my ARM sqrt patch.
>
> 2016-10-21  Joseph Myers  <joseph@codesourcery.com>
>
> 	* benchtests/Makefile (CFLAGS-bench-sqrt.c): New variable.
>
> diff --git a/benchtests/Makefile b/benchtests/Makefile
> index 144b32e..5a61522 100644
> --- a/benchtests/Makefile
> +++ b/benchtests/Makefile
> @@ -72,6 +72,7 @@ benchset := $(string-benchset-all) $(stdlib-benchset) $(stdio-common-benchset) \
>
>  CFLAGS-bench-ffs.c += -fno-builtin
>  CFLAGS-bench-ffsll.c += -fno-builtin
> +CFLAGS-bench-sqrt.c += -fno-builtin
>
>  bench-malloc := malloc-thread

LGTM.
  

Patch

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 144b32e..5a61522 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -72,6 +72,7 @@  benchset := $(string-benchset-all) $(stdlib-benchset) $(stdio-common-benchset) \
 
 CFLAGS-bench-ffs.c += -fno-builtin
 CFLAGS-bench-ffsll.c += -fno-builtin
+CFLAGS-bench-sqrt.c += -fno-builtin
 
 bench-malloc := malloc-thread