diff options
author | Sunil K Pandey <skpgkp2@gmail.com> | 2021-11-05 00:56:47 -0700 |
---|---|---|
committer | Sunil K Pandey <skpgkp2@gmail.com> | 2021-11-16 11:37:39 -0800 |
commit | a43c0b5483da4c5e3796af309864cb44256c02db (patch) | |
tree | a902af371c47da07212dc1022d8e9a39f83f7769 /sysdeps/x86_64/fpu/Makefile | |
parent | d8c2e8e0439b715918ee69b70aab4d222c17e2ca (diff) | |
download | glibc-a43c0b5483da4c5e3796af309864cb44256c02db.tar.gz glibc-a43c0b5483da4c5e3796af309864cb44256c02db.tar.xz glibc-a43c0b5483da4c5e3796af309864cb44256c02db.zip |
x86-64: Create microbenchmark infrastructure for libmvec
Add python script to generate libmvec microbenchmark from the input values for each libmvec function using skeleton benchmark template. Creates double and float benchmarks with vector length 1, 2, 4, 8, and 16 for each libmvec function. Vector length 1 corresponds to scalar version of function and is included for vector function perf comparison. Co-authored-by: Haochen Jiang <haochen.jiang@intel.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/fpu/Makefile')
-rw-r--r-- | sysdeps/x86_64/fpu/Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile index d172ae815d..9fb587cf8f 100644 --- a/sysdeps/x86_64/fpu/Makefile +++ b/sysdeps/x86_64/fpu/Makefile @@ -72,3 +72,43 @@ ifeq ($(subdir)$(config-cflags-mprefer-vector-width),mathyes) # performance of sin and cos by more than 40% on Skylake. CFLAGS-branred.c = -mprefer-vector-width=128 endif + +ifeq ($(subdir),benchtests) +double-vlen4-arch-ext-cflags = -mavx +double-vlen4-arch-ext2-cflags = -mavx2 +double-vlen8-arch-ext-cflags = -mavx512f + +float-vlen8-arch-ext-cflags = -mavx +float-vlen8-arch-ext2-cflags = -mavx2 +float-vlen16-arch-ext-cflags = -mavx512f + +bench-libmvec := $(bench-libmvec-double) $(bench-libmvec-float) + +ifeq (${BENCHSET},) +bench += $(bench-libmvec) +endif + +ifeq (${STATIC-BENCHTESTS},yes) +libmvec-benchtests = $(common-objpfx)mathvec/libmvec.a $(common-objpfx)math/libm.a +else +libmvec-benchtests = $(libmvec) $(libm) +endif + +$(addprefix $(objpfx)bench-,$(bench-libmvec-double)): $(libmvec-benchtests) +$(addprefix $(objpfx)bench-,$(bench-libmvec-float)): $(libmvec-benchtests) +bench-libmvec-deps = $(..)sysdeps/x86_64/fpu/bench-libmvec-skeleton.c bench-timing.h Makefile + +$(objpfx)bench-float-%.c: $(bench-libmvec-deps) + { if [ -n "$($*-INCLUDE)" ]; then \ + cat $($*-INCLUDE); \ + fi; \ + $(PYTHON) $(..)sysdeps/x86_64/fpu/scripts/bench_libmvec.py $(basename $(@F)); } > $@-tmp + mv -f $@-tmp $@ + +$(objpfx)bench-double-%.c: $(bench-libmvec-deps) + { if [ -n "$($*-INCLUDE)" ]; then \ + cat $($*-INCLUDE); \ + fi; \ + $(PYTHON) $(..)sysdeps/x86_64/fpu/scripts/bench_libmvec.py $(basename $(@F)); } > $@-tmp + mv -f $@-tmp $@ +endif |