-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
205 lines (162 loc) · 7.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
CC_X86_64 = x86_64-linux-gnu-gcc
CC_I386 = i686-linux-gnu-gcc
CC_AARCH64 = aarch64-linux-gnu-gcc
CC_PPC64LE = powerpc64le-linux-gnu-gcc
CFLAGS = -O2 -Wall
CFLAGS_SIMD128_X86 = $(CFLAGS) -march=sandybridge -mtune=native -msse4.1 -maes
CFLAGS_SIMD256_X86 = $(CFLAGS) -march=haswell -mtune=native -mavx2 -maes
CFLAGS_SIMD256_X86_VAES = $(CFLAGS) -march=haswell -mtune=native -mavx2 -maes -mvaes
CFLAGS_SIMD256_X86_VAES_AVX512 = $(CFLAGS) -march=znver3 -mavx512f -mavx512vl -mavx512bw \
-mavx512dq -mavx512vbmi -mavx512ifma -mavx512vpopcntdq \
-mavx512vbmi2 -mavx512bitalg -mavx512vnni \
-mprefer-vector-width=512 -mavx2 -maes -mvaes -mgfni
CFLAGS_SIMD128_ARM = $(CFLAGS) -march=armv8-a+crypto -mtune=cortex-a53
CFLAGS_SIMD128_PPC = $(CFLAGS) -mcpu=power8 -maltivec -mvsx -mcrypto
LDFLAGS =
PROGRAMS =
ifneq ($(shell which $(CC_X86_64)),)
PROGRAMS += \
test_simd128_intrinsics_x86_64 \
test_simd256_intrinsics_x86_64 test_simd256_intrinsics_x86_64_vaes \
test_simd256_intrinsics_x86_64_vaes_avx512 \
test_simd256_intrinsics_x86_64_gfni_avx512 \
test_simd128_asm_x86_64 test_simd256_asm_x86_64 \
test_simd256_asm_x86_64_vaes test_simd256_asm_x86_64_gfni
endif
ifneq ($(shell which $(CC_I386)),)
PROGRAMS += test_simd128_intrinsics_i386 test_simd256_intrinsics_i386
endif
ifneq ($(shell which $(CC_AARCH64)),)
PROGRAMS += test_simd128_intrinsics_aarch64
endif
ifneq ($(shell which $(CC_PPC64LE)),)
PROGRAMS += test_simd128_intrinsics_ppc64le
endif
all: $(PROGRAMS)
clean:
rm *.o 2>/dev/null || true
rm test_simd128_intrinsics_x86_64 2>/dev/null || true
rm test_simd256_intrinsics_x86_64 2>/dev/null || true
rm test_simd128_asm_x86_64 2>/dev/null || true
rm test_simd256_asm_x86_64 2>/dev/null || true
rm test_simd256_asm_x86_64_vaes 2>/dev/null || true
rm test_simd256_asm_x86_64_gfni 2>/dev/null || true
rm test_simd256_intrinsics_x86_64_vaes 2>/dev/null || true
rm test_simd256_intrinsics_x86_64_vaes_avx512 2>/dev/null || true
rm test_simd256_intrinsics_x86_64_gfni_avx512 2>/dev/null || true
rm test_simd128_intrinsics_i386 2>/dev/null || true
rm test_simd256_intrinsics_i386 2>/dev/null || true
rm test_simd128_intrinsics_aarch64 2>/dev/null || true
rm test_simd128_intrinsics_ppc64le 2>/dev/null || true
test_simd128_intrinsics_x86_64: camellia_simd128_with_x86_aesni.o \
main_simd128.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_intrinsics_x86_64: camellia_simd128_with_x86_aesni_avx2.o \
camellia_simd256_x86_aesni.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_intrinsics_x86_64_vaes: camellia_simd128_with_x86_aesni_avx2.o \
camellia_simd256_x86_vaes.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_intrinsics_x86_64_vaes_avx512: camellia_simd128_with_x86_aesni_avx512.o \
camellia_simd256_x86_vaes_avx512.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_intrinsics_x86_64_gfni_avx512: camellia_simd128_with_x86_aesni_avx512.o \
camellia_simd256_x86_gfni_avx512.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd128_asm_x86_64: camellia_simd128_x86-64_aesni_avx.o \
main_simd128.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_asm_x86_64: camellia_simd128_x86-64_aesni_avx.o \
camellia_simd256_x86-64_aesni_avx2.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_asm_x86_64_vaes: camellia_simd128_x86-64_aesni_avx.o \
camellia_simd256_x86-64_vaes_avx2.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd256_asm_x86_64_gfni: camellia_simd128_x86-64_aesni_avx.o \
camellia_simd256_x86-64_gfni_avx2.o \
main_simd256.o \
camellia_ref_x86-64.o
$(CC_X86_64) $^ -o $@ $(LDFLAGS)
test_simd128_intrinsics_i386: camellia_simd128_with_x86_aesni_i386.o \
main_simd128_i386.o \
camellia_ref_i386.o
$(CC_I386) $^ -o $@ $(LDFLAGS)
test_simd256_intrinsics_i386: camellia_simd128_with_x86_aesni_avx2_i386.o \
camellia_simd256_x86_aesni_i386.o \
main_simd256_i386.o \
camellia_ref_i386.o
$(CC_I386) $^ -o $@ $(LDFLAGS)
test_simd128_intrinsics_aarch64: camellia_simd128_with_aarch64_ce.o \
main_simd128_aarch64.o \
camellia_ref_aarch64.o
$(CC_AARCH64) $^ -o $@ $(LDFLAGS)
test_simd128_intrinsics_ppc64le: camellia_simd128_with_ppc64le.o \
main_simd128_ppc64le.o \
camellia_ref_ppc64le.o
$(CC_PPC64LE) $^ -o $@ $(LDFLAGS)
camellia_simd128_with_x86_aesni.o: camellia_simd128_with_aes_instruction_set.c
$(CC_X86_64) $(CFLAGS_SIMD128_X86) -c $< -o $@
camellia_simd128_with_x86_aesni_avx512.o: camellia_simd128_with_aes_instruction_set.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86_VAES_AVX512) -c $< -o $@
camellia_simd128_with_x86_aesni_avx2.o: camellia_simd128_with_aes_instruction_set.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86) -c $< -o $@
camellia_simd256_x86_aesni.o: camellia_simd256_x86_aesni.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86) -c $< -o $@
camellia_simd256_x86_vaes.o: camellia_simd256_x86_aesni.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86_VAES) -DUSE_VAES -c $< -o $@
camellia_simd256_x86_vaes_avx512.o: camellia_simd256_x86_aesni.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86_VAES_AVX512) -DUSE_VAES -c $< -o $@
camellia_simd256_x86_gfni_avx512.o: camellia_simd256_x86_aesni.c
$(CC_X86_64) $(CFLAGS_SIMD256_X86_VAES_AVX512) -DUSE_GFNI -c $< -o $@
camellia_simd128_x86-64_aesni_avx.o: camellia_simd128_x86-64_aesni_avx.S
$(CC_X86_64) $(CFLAGS) -c $< -o $@
camellia_simd256_x86-64_aesni_avx2.o: camellia_simd256_x86-64_aesni_avx2.S
$(CC_X86_64) $(CFLAGS) -c $< -o $@
camellia_simd256_x86-64_vaes_avx2.o: camellia_simd256_x86-64_aesni_avx2.S
$(CC_X86_64) $(CFLAGS) -DUSE_VAES -c $< -o $@
camellia_simd256_x86-64_gfni_avx2.o: camellia_simd256_x86-64_aesni_avx2.S
$(CC_X86_64) $(CFLAGS) -DUSE_GFNI -c $< -o $@
camellia_ref_x86-64.o: camellia-BSD-1.2.0/camellia.c
$(CC_X86_64) $(CFLAGS) -c $< -o $@
main_simd128.o: main.c
$(CC_X86_64) $(CFLAGS) -c $< -o $@
main_simd256.o: main.c
$(CC_X86_64) $(CFLAGS) -DUSE_SIMD256 -c $< -o $@
camellia_simd128_with_x86_aesni_i386.o: camellia_simd128_with_aes_instruction_set.c
$(CC_I386) $(CFLAGS_SIMD128_X86) -c $< -o $@
camellia_simd128_with_x86_aesni_avx2_i386.o: camellia_simd128_with_aes_instruction_set.c
$(CC_I386) $(CFLAGS_SIMD256_X86) -c $< -o $@
camellia_simd256_x86_aesni_i386.o: camellia_simd256_x86_aesni.c
$(CC_I386) $(CFLAGS_SIMD256_X86) -c $< -o $@
camellia_ref_i386.o: camellia-BSD-1.2.0/camellia.c
$(CC_I386) $(CFLAGS) -c $< -o $@
main_simd128_i386.o: main.c
$(CC_I386) $(CFLAGS) -c $< -o $@
main_simd256_i386.o: main.c
$(CC_I386) $(CFLAGS) -DUSE_SIMD256 -c $< -o $@
camellia_simd128_with_aarch64_ce.o: camellia_simd128_with_aes_instruction_set.c
$(CC_AARCH64) $(CFLAGS_SIMD128_ARM) -c $< -o $@
camellia_ref_aarch64.o: camellia-BSD-1.2.0/camellia.c
$(CC_AARCH64) $(CFLAGS_SIMD128_ARM) -c $< -o $@
main_simd128_aarch64.o: main.c
$(CC_AARCH64) $(CFLAGS_SIMD128_ARM) -c $< -o $@
camellia_simd128_with_ppc64le.o: camellia_simd128_with_aes_instruction_set.c
$(CC_PPC64LE) $(CFLAGS_SIMD128_PPC) -c $< -o $@
camellia_ref_ppc64le.o: camellia-BSD-1.2.0/camellia.c
$(CC_PPC64LE) $(CFLAGS_SIMD128_PPC) -c $< -o $@
main_simd128_ppc64le.o: main.c
$(CC_PPC64LE) $(CFLAGS_SIMD128_PPC) -c $< -o $@