]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/Makefile.nmake
import quincy beta 17.1.0
[ceph.git] / ceph / src / isa-l / Makefile.nmake
1 ########################################################################
2 # Copyright(c) 2011-2017 Intel Corporation All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in
11 # the documentation and/or other materials provided with the
12 # distribution.
13 # * Neither the name of Intel Corporation nor the names of its
14 # contributors may be used to endorse or promote products derived
15 # from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ########################################################################
29
30 # This file can be auto-regenerated with $make -f Makefile.unx Makefile.nmake
31
32 objs = \
33 bin\ec_base.obj \
34 bin\raid_base.obj \
35 bin\crc_base.obj \
36 bin\crc64_base.obj \
37 bin\igzip.obj \
38 bin\hufftables_c.obj \
39 bin\igzip_base.obj \
40 bin\igzip_icf_base.obj \
41 bin\adler32_base.obj \
42 bin\flatten_ll.obj \
43 bin\encode_df.obj \
44 bin\igzip_icf_body.obj \
45 bin\huff_codes.obj \
46 bin\igzip_inflate.obj \
47 bin\mem_zero_detect_base.obj \
48 bin\ec_highlevel_func.obj \
49 bin\gf_vect_mul_sse.obj \
50 bin\gf_vect_mul_avx.obj \
51 bin\gf_vect_dot_prod_sse.obj \
52 bin\gf_vect_dot_prod_avx.obj \
53 bin\gf_vect_dot_prod_avx2.obj \
54 bin\gf_2vect_dot_prod_sse.obj \
55 bin\gf_3vect_dot_prod_sse.obj \
56 bin\gf_4vect_dot_prod_sse.obj \
57 bin\gf_5vect_dot_prod_sse.obj \
58 bin\gf_6vect_dot_prod_sse.obj \
59 bin\gf_2vect_dot_prod_avx.obj \
60 bin\gf_3vect_dot_prod_avx.obj \
61 bin\gf_4vect_dot_prod_avx.obj \
62 bin\gf_5vect_dot_prod_avx.obj \
63 bin\gf_6vect_dot_prod_avx.obj \
64 bin\gf_2vect_dot_prod_avx2.obj \
65 bin\gf_3vect_dot_prod_avx2.obj \
66 bin\gf_4vect_dot_prod_avx2.obj \
67 bin\gf_5vect_dot_prod_avx2.obj \
68 bin\gf_6vect_dot_prod_avx2.obj \
69 bin\gf_vect_mad_sse.obj \
70 bin\gf_2vect_mad_sse.obj \
71 bin\gf_3vect_mad_sse.obj \
72 bin\gf_4vect_mad_sse.obj \
73 bin\gf_5vect_mad_sse.obj \
74 bin\gf_6vect_mad_sse.obj \
75 bin\gf_vect_mad_avx.obj \
76 bin\gf_2vect_mad_avx.obj \
77 bin\gf_3vect_mad_avx.obj \
78 bin\gf_4vect_mad_avx.obj \
79 bin\gf_5vect_mad_avx.obj \
80 bin\gf_6vect_mad_avx.obj \
81 bin\gf_vect_mad_avx2.obj \
82 bin\gf_2vect_mad_avx2.obj \
83 bin\gf_3vect_mad_avx2.obj \
84 bin\gf_4vect_mad_avx2.obj \
85 bin\gf_5vect_mad_avx2.obj \
86 bin\gf_6vect_mad_avx2.obj \
87 bin\ec_multibinary.obj \
88 bin\gf_vect_dot_prod_avx512.obj \
89 bin\gf_2vect_dot_prod_avx512.obj \
90 bin\gf_3vect_dot_prod_avx512.obj \
91 bin\gf_4vect_dot_prod_avx512.obj \
92 bin\gf_5vect_dot_prod_avx512.obj \
93 bin\gf_6vect_dot_prod_avx512.obj \
94 bin\gf_vect_mad_avx512.obj \
95 bin\gf_2vect_mad_avx512.obj \
96 bin\gf_3vect_mad_avx512.obj \
97 bin\gf_4vect_mad_avx512.obj \
98 bin\gf_5vect_mad_avx512.obj \
99 bin\gf_6vect_mad_avx512.obj \
100 bin\xor_gen_sse.obj \
101 bin\pq_gen_sse.obj \
102 bin\xor_check_sse.obj \
103 bin\pq_check_sse.obj \
104 bin\pq_gen_avx.obj \
105 bin\xor_gen_avx.obj \
106 bin\pq_gen_avx2.obj \
107 bin\xor_gen_avx512.obj \
108 bin\pq_gen_avx512.obj \
109 bin\raid_multibinary.obj \
110 bin\crc16_t10dif_01.obj \
111 bin\crc16_t10dif_by4.obj \
112 bin\crc16_t10dif_02.obj \
113 bin\crc16_t10dif_by16_10.obj \
114 bin\crc16_t10dif_copy_by4.obj \
115 bin\crc16_t10dif_copy_by4_02.obj \
116 bin\crc32_ieee_01.obj \
117 bin\crc32_ieee_02.obj \
118 bin\crc32_ieee_by4.obj \
119 bin\crc32_ieee_by16_10.obj \
120 bin\crc32_iscsi_01.obj \
121 bin\crc32_iscsi_00.obj \
122 bin\crc32_iscsi_by16_10.obj \
123 bin\crc_multibinary.obj \
124 bin\crc64_multibinary.obj \
125 bin\crc64_ecma_refl_by8.obj \
126 bin\crc64_ecma_refl_by16_10.obj \
127 bin\crc64_ecma_norm_by8.obj \
128 bin\crc64_ecma_norm_by16_10.obj \
129 bin\crc64_iso_refl_by8.obj \
130 bin\crc64_iso_refl_by16_10.obj \
131 bin\crc64_iso_norm_by8.obj \
132 bin\crc64_iso_norm_by16_10.obj \
133 bin\crc64_jones_refl_by8.obj \
134 bin\crc64_jones_refl_by16_10.obj \
135 bin\crc64_jones_norm_by8.obj \
136 bin\crc64_jones_norm_by16_10.obj \
137 bin\crc32_gzip_refl_by8.obj \
138 bin\crc32_gzip_refl_by8_02.obj \
139 bin\crc32_gzip_refl_by16_10.obj \
140 bin\igzip_body.obj \
141 bin\igzip_finish.obj \
142 bin\igzip_icf_body_h1_gr_bt.obj \
143 bin\igzip_icf_finish.obj \
144 bin\rfc1951_lookup.obj \
145 bin\adler32_sse.obj \
146 bin\adler32_avx2_4.obj \
147 bin\igzip_multibinary.obj \
148 bin\igzip_update_histogram_01.obj \
149 bin\igzip_update_histogram_04.obj \
150 bin\igzip_decode_block_stateless_01.obj \
151 bin\igzip_decode_block_stateless_04.obj \
152 bin\igzip_inflate_multibinary.obj \
153 bin\encode_df_04.obj \
154 bin\encode_df_06.obj \
155 bin\proc_heap.obj \
156 bin\igzip_deflate_hash.obj \
157 bin\igzip_gen_icf_map_lh1_06.obj \
158 bin\igzip_gen_icf_map_lh1_04.obj \
159 bin\igzip_set_long_icf_fg_04.obj \
160 bin\igzip_set_long_icf_fg_06.obj \
161 bin\mem_zero_detect_avx.obj \
162 bin\mem_zero_detect_sse.obj \
163 bin\mem_multibinary.obj
164
165 INCLUDES = -I./ -Ierasure_code/ -Iraid/ -Icrc/ -Iigzip/ -Iprograms/ -Imem/ -Iinclude/ -Itests/fuzz/ -Iexamples/ec/
166 # Modern asm feature level, consider upgrading nasm/yasm before decreasing feature_level
167 FEAT_FLAGS = -DHAVE_AS_KNOWS_AVX512 -DAS_FEATURE_LEVEL=10
168 CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy
169 CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd
170 LINKFLAGS = -nologo -incremental:no -debug
171 CFLAGS = $(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $(FEAT_FLAGS) $(INCLUDES) $(D)
172 AFLAGS = -f win64 $(FEAT_FLAGS) $(INCLUDES) $(D)
173 CC = cl
174 # or CC = icl -Qstd=c99
175 AS = nasm
176
177 lib: bin static dll
178 static: bin isa-l_static.lib
179 dll: bin isa-l.dll
180
181 bin: ; -mkdir $@
182
183 isa-l_static.lib: $(objs)
184 lib -out:$@ @<<
185 $?
186 <<
187
188 isa-l.dll: $(objs)
189 link -out:$@ -dll -def:isa-l.def $(LINKFLAGS) @<<
190 $?
191 <<
192
193 {erasure_code}.c.obj:
194 $(CC) $(CFLAGS) /c -Fo$@ $?
195 {erasure_code}.asm.obj:
196 $(AS) $(AFLAGS) -o $@ $?
197
198 {raid}.c.obj:
199 $(CC) $(CFLAGS) /c -Fo$@ $?
200 {raid}.asm.obj:
201 $(AS) $(AFLAGS) -o $@ $?
202
203 {crc}.c.obj:
204 $(CC) $(CFLAGS) /c -Fo$@ $?
205 {crc}.asm.obj:
206 $(AS) $(AFLAGS) -o $@ $?
207
208 {igzip}.c.obj:
209 $(CC) $(CFLAGS) /c -Fo$@ $?
210 {igzip}.asm.obj:
211 $(AS) $(AFLAGS) -o $@ $?
212
213 {programs}.c.obj:
214 $(CC) $(CFLAGS) /c -Fo$@ $?
215 {programs}.asm.obj:
216 $(AS) $(AFLAGS) -o $@ $?
217
218 {mem}.c.obj:
219 $(CC) $(CFLAGS) /c -Fo$@ $?
220 {mem}.asm.obj:
221 $(AS) $(AFLAGS) -o $@ $?
222
223
224 # Examples
225 ex = \
226 xor_example.exe \
227 crc_simple_test.exe \
228 crc64_example.exe \
229 igzip_example.exe \
230 igzip_sync_flush_example.exe \
231 ec_simple_example.exe \
232 ec_piggyback_example.exe
233
234 ex: lib $(ex)
235
236 $(ex): $(@B).obj
237
238 .obj.exe:
239 link /out:$@ $(LINKFLAGS) isa-l.lib $?
240
241 # Check tests
242 checks = \
243 gf_vect_mul_test.exe \
244 erasure_code_test.exe \
245 gf_inverse_test.exe \
246 erasure_code_update_test.exe \
247 xor_gen_test.exe \
248 pq_gen_test.exe \
249 xor_check_test.exe \
250 pq_check_test.exe \
251 crc16_t10dif_test.exe \
252 crc16_t10dif_copy_test.exe \
253 crc64_funcs_test.exe \
254 crc32_funcs_test.exe \
255 igzip_rand_test.exe \
256 igzip_wrapper_hdr_test.exe \
257 checksum32_funcs_test.exe \
258 mem_zero_detect_test.exe
259
260 checks: lib $(checks)
261 $(checks): $(@B).obj
262 check: $(checks)
263 !$?
264
265 # Unit tests
266 tests = \
267 gf_vect_mul_base_test.exe \
268 gf_vect_dot_prod_base_test.exe \
269 gf_vect_dot_prod_test.exe \
270 gf_vect_mad_test.exe \
271 erasure_code_base_test.exe
272
273 tests: lib $(tests)
274 $(tests): $(@B).obj
275
276 # Performance tests
277 perfs = \
278 gf_vect_mul_perf.exe \
279 gf_vect_dot_prod_perf.exe \
280 gf_vect_dot_prod_1tbl.exe \
281 erasure_code_perf.exe \
282 erasure_code_base_perf.exe \
283 erasure_code_update_perf.exe \
284 xor_gen_perf.exe \
285 pq_gen_perf.exe \
286 crc16_t10dif_perf.exe \
287 crc16_t10dif_copy_perf.exe \
288 crc16_t10dif_op_perf.exe \
289 crc32_ieee_perf.exe \
290 crc32_iscsi_perf.exe \
291 crc64_funcs_perf.exe \
292 crc32_gzip_refl_perf.exe \
293 adler32_perf.exe \
294 mem_zero_detect_perf.exe
295
296 perfs: lib $(perfs)
297 $(perfs): $(@B).obj
298
299 progs = \
300 igzip.exe
301
302 progs: lib $(progs)
303 igzip.exe: programs\igzip_cli.obj
304 link /out:$@ $(LINKFLAGS) isa-l.lib $?
305
306 clean:
307 -if exist *.obj del *.obj
308 -if exist bin\*.obj del bin\*.obj
309 -if exist isa-l_static.lib del isa-l_static.lib
310 -if exist *.exe del *.exe
311 -if exist *.pdb del *.pdb
312 -if exist isa-l.lib del isa-l.lib
313 -if exist isa-l.dll del isa-l.dll
314 -if exist isa-l.exp del isa-l.exp
315
316 zlib.lib:
317 igzip_perf.exe: zlib.lib
318 igzip_inflate_test.exe: zlib.lib