comparison test/Makefile.template @ 37:4b5a557aa64f

*: turns out extern is a practical joke. rewrite to be always inline again the sample benchmark performs about 3x as well with optimizations disabled :)
author Paper <paper@tflc.us>
date Sat, 26 Apr 2025 01:04:35 -0400
parents 677c03c382b8
children f9ca85d2f14c
comparison
equal deleted inserted replaced
36:677c03c382b8 37:4b5a557aa64f
1 CPPFLAGS += -g -O2 -I../include -Wall -Wpedantic -Werror=strict-aliasing 1 CPPFLAGS += -O2 -I../include -Wall -Wpedantic -Werror=strict-aliasing
2 CFLAGS += $(CPPFLAGS) -std=c99 2 CFLAGS += $(CPPFLAGS) -std=c99
3 CXXFLAGS += $(CPPFLAGS) -std=c++11 3 CXXFLAGS += $(CPPFLAGS) -std=c++11
4 4
5 HEADERS = ../include/vec/vec.h \ 5 HEADERS = ../include/vec/vec.h \
6 ../include/vec/impl/ppc/altivec.h \ 6 ../include/vec/impl/ppc/altivec.h \
8 ../include/vec/impl/x86/avx512f.h \ 8 ../include/vec/impl/x86/avx512f.h \
9 ../include/vec/impl/x86/mmx.h \ 9 ../include/vec/impl/x86/mmx.h \
10 ../include/vec/impl/x86/sse2.h \ 10 ../include/vec/impl/x86/sse2.h \
11 ../include/vec/impl/x86/sse41.h \ 11 ../include/vec/impl/x86/sse41.h \
12 ../include/vec/impl/cpu.h \ 12 ../include/vec/impl/cpu.h \
13 ../include/vec/impl/fallback.h \
14 ../include/vec/impl/generic.h \ 13 ../include/vec/impl/generic.h \
15 test_align.h \ 14 test_align.h \
16 test_arith.h \ 15 test_arith.h \
17 test_compare.h \ 16 test_compare.h \
18 test_shift.h 17 test_shift.h \
18 test_benchmark.h
19 BINS = test-generic test-host test-cxx 19 BINS = test-generic test-host test-cxx
20 OBJS = vec-generic.o vec-host.o test.o test-cxx.o 20 OBJS = test.o test-cxx.o test_benchmark_simple.o test_benchmark_vec.o
21 21
22 .PHONY: all clean test 22 .PHONY: all clean test
23 23
24 all: $(BINS) 24 all: $(BINS)
25 25
26 vec-generic.o: ../src/vec.c $(HEADERS) 26 test.o: test.c test_benchmark_simple.o test_benchmark_vec.o $(HEADERS)
27 $(CC) $(CFLAGS) -DVEC_SUPPRESS_HW=1 -c -o $@ $<
28
29 vec-host.o: ../src/vec.c $(HEADERS)
30 $(CC) $(CFLAGS) -c -o $@ $<
31
32 test.o: test.c
33 $(CC) $(CFLAGS) -c -o $@ $< 27 $(CC) $(CFLAGS) -c -o $@ $<
34 28
35 test-cxx.o: test.cc 29 test-cxx.o: test.cc
36 $(CXX) $(CXXFLAGS) -c -o $@ $< 30 $(CXX) $(CXXFLAGS) -c -o $@ $<
37 31
38 test-generic: vec-generic.o test.o 32 test-generic: test.o test_benchmark_simple.o test_benchmark_vec.o
39 $(CC) $(LDFLAGS) -o $@ $^ 33 $(CC) $(LDFLAGS) -o $@ $^
40 34
41 test-host: vec-host.o test.o 35 test-host: test.o test_benchmark_simple.o test_benchmark_vec.o
42 $(CC) $(LDFLAGS) -o $@ $^ 36 $(CC) $(LDFLAGS) -o $@ $^
43 37
44 test-cxx: test-cxx.o $(HEADERS) 38 test-cxx: test-cxx.o $(HEADERS)
45 $(CXX) $(LDFLAGS) -o $@ $< 39 $(CXX) $(LDFLAGS) -o $@ $<
46 40