1 ifeq ($(subdir),mathvec)
2 libmvec-double-func-list = \
7 libmvec-float-func-list = \
21 $(foreach l,$(libmvec-double-func-list), \
22 $(addprefix svml_d_,$(addsuffix $(l),$(libmvec-funcs)))) \
23 $(foreach l,$(libmvec-float-func-list), \
24 $(addprefix svml_s_,$(addsuffix $(l),$(libmvec-funcs))))
27 # Do not run libmvec tests if multiarch not enabled.
28 ifneq ($(multi-arch),no)
29 # Variables for libmvec tests.
30 ifeq ($(subdir)$(build-mathvec),mathyes)
31 libmvec-tests += double-vlen2 double-vlen4 double-vlen4-avx2 \
32 float-vlen4 float-vlen8 float-vlen8-avx2 \
33 double-vlen8 float-vlen16
35 $(libmvec-abi-func-tests) \
36 $(libmvec-abi-func-avx-tests) \
37 $(libmvec-abi-func-avx2-tests) \
38 $(libmvec-abi-func-avx512f-tests)
40 double-vlen2-funcs = $(libmvec-funcs)
41 double-vlen4-funcs = $(libmvec-funcs)
42 double-vlen4-avx2-funcs = $(libmvec-funcs)
43 double-vlen8-funcs = $(libmvec-funcs)
44 float-vlen4-funcs = $(libmvec-funcs)
45 float-vlen8-funcs = $(libmvec-funcs)
46 float-vlen8-avx2-funcs = $(libmvec-funcs)
47 float-vlen16-funcs = $(libmvec-funcs)
49 double-vlen4-arch-ext-cflags = -mavx
50 double-vlen4-arch-ext2-cflags = -mavx2
51 double-vlen8-arch-ext-cflags = -mavx512f
53 float-vlen8-arch-ext-cflags = -mavx
54 float-vlen8-arch-ext2-cflags = -mavx2
55 float-vlen16-arch-ext-cflags = -mavx512f
57 libmvec-abi-test-cflags = \
58 $(libm-test-fast-math-cflags) \
59 -fno-inline -fopenmp -Wno-unknown-pragmas
61 CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags)
63 CFLAGS-test-float-vlen8-avx2-wrappers.c = $(float-vlen8-arch-ext2-cflags)
66 ifeq ($(subdir)$(config-cflags-mprefer-vector-width),mathyes)
67 # When compiled with -O3 -march=skylake, GCC 8 and 9 optimize some loops
68 # in branred.c with 256-bit vector instructions, which leads to store
71 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90579
73 # Limit vector width to 128 bits to work around this issue. It improves
74 # performance of sin and cos by more than 40% on Skylake.
75 CFLAGS-branred.c = -mprefer-vector-width=128
78 ifeq ($(subdir)$(build-mathvec),benchtestsyes)
79 double-vlen4-arch-ext-cflags = -mavx
80 double-vlen4-arch-ext2-cflags = -mavx2
81 double-vlen8-arch-ext-cflags = -mavx512f
83 float-vlen8-arch-ext-cflags = -mavx
84 float-vlen8-arch-ext2-cflags = -mavx2
85 float-vlen16-arch-ext-cflags = -mavx512f
87 bench-libmvec := $(bench-libmvec-double) $(bench-libmvec-float)
89 ifeq (${STATIC-BENCHTESTS},yes)
90 libmvec-benchtests = $(common-objpfx)mathvec/libmvec.a $(common-objpfx)math/libm.a
92 libmvec-benchtests = $(libmvec) $(libm)
95 $(addprefix $(objpfx)bench-,$(bench-libmvec-double)): $(libmvec-benchtests)
96 $(addprefix $(objpfx)bench-,$(bench-libmvec-float)): $(libmvec-benchtests)
97 bench-libmvec-deps = $(..)sysdeps/x86_64/fpu/bench-libmvec-skeleton.c bench-timing.h Makefile
99 $(objpfx)bench-float-%.c: $(bench-libmvec-deps)
100 { if [ -n "$($*-INCLUDE)" ]; then \
103 $(PYTHON) $(..)sysdeps/x86_64/fpu/scripts/bench_libmvec.py $(basename $(@F)); } > $@-tmp
106 $(objpfx)bench-double-%.c: $(bench-libmvec-deps)
107 { if [ -n "$($*-INCLUDE)" ]; then \
110 $(PYTHON) $(..)sysdeps/x86_64/fpu/scripts/bench_libmvec.py $(basename $(@F)); } > $@-tmp