summaryrefslogtreecommitdiff
path: root/SFMT/Makefile
blob: 13b1bb6d98d977560edcc66be6477fa50ccb5a63 (plain)
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# @file  Makefile
# @brief Makefile
#
# @author Mutsuo Saito (Hiroshima University)
# @author Makoto Matsumoto (Hiroshima University)
#
# Copyright (C) 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima
# University. All rights reserved.
#
# The new BSD License is applied to this software.
# see LICENSE.txt
#
# @note
# We could comple test-sse2-Mxxx using gcc 3.4.4 of cygwin.
# We could comple test-sse2-Mxxx using gcc 4.0.1 of Linux.
# We coundn't comple test-sse2-Mxxx using gcc 3.3.2 of Linux.
# We could comple test-alti-Mxxx using gcc 3.3 of osx.
# We could comple test-alti-Mxxx using gcc 4.0 of osx.

WARN = -Wmissing-prototypes -Wall #-Winline
#WARN = -Wmissing-prototypes -Wall -W
OPTI = -O3 -finline-functions -fomit-frame-pointer -DNDEBUG \
-fno-strict-aliasing --param max-inline-insns-single=1800
#--param inline-unit-growth=500 --param large-function-growth=900 #for gcc 4
#STD =
#STD = -std=c89 -pedantic
#STD = -std=c99 -pedantic
STD = -std=c99
CC = gcc
CCFLAGS = $(OPTI) $(WARN) $(STD)
ALTIFLAGS = -mabi=altivec -maltivec -DHAVE_ALTIVEC
OSXALTIFLAGS = -faltivec -maltivec -DHAVE_ALTIVEC
SSE2FLAGS = -msse2 -DHAVE_SSE2
STD_TARGET = test-std-M19937
BIG_TARGET = test-big64-M19937
ALL_STD_TARGET = test-std-M607 test-std-M1279 test-std-M2281 test-std-M4253 \
test-std-M11213 test-std-M19937 test-std-M44497 test-std-M86243 \
test-std-M132049 test-std-M216091
ALL_BIG_TARGET = test-big64-M607 test-big64-M1279 test-big64-M2281 \
test-big64-M4253 test-big64-M11213 test-big64-M19937 test-big64-M44497 \
test-big64-M86243 test-big64-M132049 test-big64-M216091
ALTI_TARGET = test-alti-M19937
ALL_ALTI_TARGET = test-alti-M607 test-alti-M1279 test-alti-M2281 \
test-alti-M4253 test-alti-M11213 test-alti-M19937 test-alti-M44497 \
test-alti-M86243 test-alti-M132049 test-alti-M216091
ALL_ALTIBIG_TARGET = test-alti64-M607 test-alti64-M1279 test-alti64-M2281 \
test-alti64-M4253 test-alti64-M11213 test-alti64-M19937 test-alti64-M44497 \
test-alti64-M86243 test-alti64-M132049 test-alti64-M216091
SSE2_TARGET = test-sse2-M19937
ALL_SSE2_TARGET = test-sse2-M607 test-sse2-M1279 test-sse2-M2281 \
test-sse2-M4253 test-sse2-M11213 test-sse2-M19937 test-sse2-M44497 \
test-sse2-M86243 test-sse2-M132049 test-sse2-M216091
# ==========================================================
# comment out or EDIT following lines to get max performance
# ==========================================================
# --------------------
# for gcc 4
# --------------------
#CCFLAGS += --param inline-unit-growth=500 \
#--param large-function-growth=900
# --------------------
# for icl
# --------------------
#CC = icl /Wcheck /O3 /QxB /Qprefetch
# -----------------
# for PowerPC
# -----------------
#CCFLAGS += -arch ppc
# -----------------
# for Pentium M
# -----------------
#CCFLAGS += -march=prescott
# -----------------
# for Athlon 64
# -----------------
#CCFLAGS += -march=athlon64

.PHONY: std-check sse2-check alti-check

std: ${STD_TARGET}

sse2:${SSE2_TARGET}

alti:${ALTI_TARGET}

osx-alti:
	make "ALTIFLAGS=${OSXALTIFLAGS}" alti

big:${BIG_TARGET}

std-check: ${ALL_STD_TARGET}
	./check.sh 32 test-std

sse2-check: ${ALL_SSE2_TARGET}
	./check.sh 32 test-sse2

alti-check: ${ALL_ALTI_TARGET}
	./check.sh 32 test-alti

osx-alti-check:
	make "ALTIFLAGS=${OSXALTIFLAGS}" alti-check

big-check: ${ALL_BIG_TARGET} ${ALL_STD_TARGET}
	./check.sh 64 test-big64

altibig-check: ${ALL_ALTIBIG_TARGET} ${ALL_STD_TARGET}
	./check.sh 64 test-alti64

osx-altibig-check:
	make "ALTIFLAGS=${OSXALTIFLAGS}" altibig-check

test-std-M607: test.c SFMT.c SFMT.h SFMT-params607.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=607 -o $@ test.c SFMT.c

test-alti-M607: test.c SFMT.c SFMT.h SFMT-alti.h SFMT-params607.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=607 -o $@ test.c SFMT.c

test-sse2-M607: test.c SFMT.c SFMT.h SFMT-sse2.h SFMT-params607.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=607 -o $@ test.c SFMT.c

test-std-M1279: test.c SFMT.c SFMT.h SFMT-params1279.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=1279 -o $@ test.c SFMT.c

test-alti-M1279: test.c SFMT.c SFMT.h SFMT-alti.h SFMT-params1279.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=1279 -o $@ test.c SFMT.c

test-sse2-M1279: test.c SFMT.c SFMT.h SFMT-sse2.h SFMT-params1279.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=1279 -o $@ test.c SFMT.c

test-std-M2281: test.c SFMT.c SFMT.h SFMT-params2281.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=2281 -o $@ test.c SFMT.c

test-alti-M2281: test.c SFMT.c SFMT.h SFMT-alti.h SFMT-params2281.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=2281 -o $@ test.c SFMT.c

test-sse2-M2281: test.c SFMT.c SFMT.h SFMT-sse2.h SFMT-params2281.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=2281 -o $@ test.c SFMT.c

test-std-M4253: test.c SFMT.c SFMT.h SFMT-params4253.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=4253 -o $@ test.c SFMT.c

test-alti-M4253: test.c SFMT.c SFMT.h SFMT-alti.h SFMT-params4253.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=4253 -o $@ test.c SFMT.c

test-sse2-M4253: test.c SFMT.c SFMT.h SFMT-sse2.h SFMT-params4253.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=4253 -o $@ test.c SFMT.c

test-std-M11213: test.c SFMT.c SFMT.h SFMT-params11213.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=11213 -o $@ test.c SFMT.c

test-alti-M11213: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params11213.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=11213 -o $@ test.c SFMT.c

test-sse2-M11213: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params11213.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=11213 -o $@ test.c SFMT.c

test-std-M19937: test.c SFMT.c SFMT.h SFMT-params19937.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=19937 -o $@ test.c SFMT.c

test-alti-M19937: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params19937.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=19937 -o $@ test.c SFMT.c

test-sse2-M19937: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params19937.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=19937 -o $@ test.c SFMT.c

test-std-M44497: test.c SFMT.c SFMT.h SFMT-params44497.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=44497 -o $@ test.c SFMT.c

test-alti-M44497: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params44497.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=44497 -o $@ test.c SFMT.c

test-sse2-M44497: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params44497.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=44497 -o $@ test.c SFMT.c

test-std-M86243: test.c SFMT.c SFMT.h SFMT-params86243.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=86243 -o $@ test.c SFMT.c

test-alti-M86243: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params86243.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=86243 -o $@ test.c SFMT.c

test-sse2-M86243: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params86243.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=86243 -o $@ test.c SFMT.c

test-std-M132049: test.c SFMT.c SFMT.h SFMT-params132049.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=132049 -o $@ test.c SFMT.c

test-alti-M132049: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params132049.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=132049 -o $@ test.c SFMT.c

test-sse2-M132049: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params132049.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=132049 -o $@ test.c SFMT.c

test-std-M216091: test.c SFMT.c SFMT.h SFMT-params216091.h
	${CC} ${CCFLAGS} -DSFMT_MEXP=216091 -o $@ test.c SFMT.c

test-alti-M216091: test.c SFMT.c SFMT.h SFMT-alti.h \
	SFMT-params216091.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=216091 -o $@ test.c SFMT.c

test-sse2-M216091: test.c SFMT.c SFMT.h SFMT-sse2.h \
	SFMT-params216091.h
	${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=216091 -o $@ test.c SFMT.c

test-big64-M607: test.c SFMT.c SFMT.h SFMT-params607.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=607 -o $@ test.c SFMT.c

test-alti64-M607: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params607.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=607 -o \
	$@ test.c SFMT.c

test-big64-M1279: test.c SFMT.c SFMT.h SFMT-params1279.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=1279 -o $@ test.c

test-alti64-M1279: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params1279.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=1279 -o \
	$@ test.c SFMT.c

test-big64-M2281: test.c SFMT.c SFMT.h SFMT-params2281.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=2281 -o $@ test.c SFMT.c

test-alti64-M2281: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params2281.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=2281 -o \
	$@ test.c SFMT.c

test-big64-M4253: test.c SFMT.c SFMT.h SFMT-params4253.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=4253 -o $@ test.c SFMT.c

test-alti64-M4253: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params4253.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=4253 -o \
	$@ test.c SFMT.c

test-big64-M11213: test.c SFMT.c SFMT.h SFMT-params11213.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=11213 -o $@ test.c SFMT.c

test-alti64-M11213: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params11213.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=11213 -o \
	$@ test.c SFMT.c

test-big64-M19937: test.c SFMT.c SFMT.h SFMT-params19937.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=19937 -o $@ test.c SFMT.c

test-alti64-M19937: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params19937.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=19937 -o \
	$@ test.c SFMT.c

test-big64-M44497: test.c SFMT.c SFMT.h SFMT-params44497.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=44497 -o $@ test.c SFMT.c

test-alti64-M44497: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params44497.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=44497 -o \
	$@ test.c SFMT.c

test-big64-M86243: test.c SFMT.c SFMT.h SFMT-params86243.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=86243 -o $@ test.c SFMT.c

test-alti64-M86243: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params86243.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=86243 -o \
	$@ test.c SFMT.c

test-big64-M132049: test.c SFMT.c SFMT.h SFMT-params132049.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=132049 -o $@ test.c SFMT.c

test-alti64-M132049: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params132049.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=132049 -o \
	$@ test.c SFMT.c

test-big64-M216091: test.c SFMT.c SFMT.h SFMT-params216091.h
	${CC} ${CCFLAGS} -DONLY64 -DSFMT_MEXP=216091 -o $@ test.c SFMT.c

test-alti64-M216091: test.c SFMT.c SFMT.h SFMT-alti.h \
		  SFMT-params216091.h
	${CC} ${CCFLAGS} ${ALTIFLAGS} -DONLY64 -DSFMT_MEXP=216091 -o \
	$@ test.c SFMT.c

clean:
	rm -f *.o *~