2 CROSS_COMPILE ?
= mips64el-unknown-linux-gnu-
4 SIM
= qemu-system-mips64el
5 SIMFLAGS
= -nographic
-cpu mips64dspr2
-kernel
7 AS
= $(CROSS_COMPILE
)as
8 LD
= $(CROSS_COMPILE
)ld
9 CC
= $(CROSS_COMPILE
)gcc
10 AR
= $(CROSS_COMPILE
)ar
11 NM
= $(CROSS_COMPILE
)nm
12 STRIP
= $(CROSS_COMPILE
)strip
13 RANLIB
= $(CROSS_COMPILE
)ranlib
14 OBJCOPY
= $(CROSS_COMPILE
)objcopy
15 OBJDUMP
= $(CROSS_COMPILE
)objdump
17 VECTORS_OBJ ?
= .
/head.o .
/printf.o
19 HEAD_FLAGS ?
= -nostdinc
-mabi
=64 -G
0 -mno-abicalls
-fno-pic
-pipe \
20 -msoft-float
-march
=mips64
-Wa
,-mips64
-Wa
,--trap \
21 -msym32
-DKBUILD_64BIT_SYM32
-I.
/
23 CFLAGS ?
= -nostdinc
-mabi
=64 -G
0 -mno-abicalls
-fno-pic
-fno-builtin \
24 -pipe
-march
=mips64r2
-mgp64
-mdsp
-static
-Wa
,--trap
-msym32 \
25 -DKBUILD_64BIT_SYM32
-I.
/
27 LDFLAGS
= -T.
/mips_boot.lds
-L.
/
28 FLAGS
= -nostdlib
-mabi
=64 -march
=mips64r2
-mgp64
-mdsp
31 #TESTCASES = absq_s_ob.tst
32 TESTCASES
= absq_s_ph.tst
33 TESTCASES
+= absq_s_pw.tst
34 TESTCASES
+= absq_s_qh.tst
35 TESTCASES
+= absq_s_w.tst
36 TESTCASES
+= addq_ph.tst
37 TESTCASES
+= addq_pw.tst
38 TESTCASES
+= addq_qh.tst
39 TESTCASES
+= addq_s_ph.tst
40 TESTCASES
+= addq_s_pw.tst
41 TESTCASES
+= addq_s_qh.tst
42 TESTCASES
+= addq_s_w.tst
43 TESTCASES
+= addsc.tst
44 TESTCASES
+= addu_ob.tst
45 TESTCASES
+= addu_qb.tst
46 TESTCASES
+= addu_s_ob.tst
47 TESTCASES
+= addu_s_qb.tst
48 TESTCASES
+= addwc.tst
49 TESTCASES
+= bitrev.tst
50 TESTCASES
+= bposge32.tst
51 TESTCASES
+= bposge64.tst
52 TESTCASES
+= cmp_eq_ph.tst
53 TESTCASES
+= cmp_eq_pw.tst
54 TESTCASES
+= cmp_eq_qh.tst
55 TESTCASES
+= cmpgu_eq_ob.tst
56 TESTCASES
+= cmpgu_eq_qb.tst
57 TESTCASES
+= cmpgu_le_ob.tst
58 TESTCASES
+= cmpgu_le_qb.tst
59 TESTCASES
+= cmpgu_lt_ob.tst
60 TESTCASES
+= cmpgu_lt_qb.tst
61 TESTCASES
+= cmp_le_ph.tst
62 TESTCASES
+= cmp_le_pw.tst
63 TESTCASES
+= cmp_le_qh.tst
64 TESTCASES
+= cmp_lt_ph.tst
65 TESTCASES
+= cmp_lt_pw.tst
66 TESTCASES
+= cmp_lt_qh.tst
67 TESTCASES
+= cmpu_eq_ob.tst
68 TESTCASES
+= cmpu_eq_qb.tst
69 TESTCASES
+= cmpu_le_ob.tst
70 TESTCASES
+= cmpu_le_qb.tst
71 TESTCASES
+= cmpu_lt_ob.tst
72 TESTCASES
+= cmpu_lt_qb.tst
73 #TESTCASES += dappend.tst
74 TESTCASES
+= dextp.tst
75 TESTCASES
+= dextpdp.tst
76 TESTCASES
+= dextpdpv.tst
77 TESTCASES
+= dextpv.tst
78 TESTCASES
+= dextr_l.tst
79 TESTCASES
+= dextr_r_l.tst
80 TESTCASES
+= dextr_rs_l.tst
81 TESTCASES
+= dextr_rs_w.tst
82 TESTCASES
+= dextr_r_w.tst
83 TESTCASES
+= dextr_s_h.tst
84 TESTCASES
+= dextrv_l.tst
85 TESTCASES
+= dextrv_r_l.tst
86 TESTCASES
+= dextrv_rs_l.tst
87 TESTCASES
+= dextrv_rs_w.tst
88 TESTCASES
+= dextrv_r_w.tst
89 TESTCASES
+= dextrv_s_h.tst
90 TESTCASES
+= dextrv_w.tst
91 TESTCASES
+= dextr_w.tst
92 TESTCASES
+= dinsv.tst
93 TESTCASES
+= dmadd.tst
94 TESTCASES
+= dmaddu.tst
95 TESTCASES
+= dmsub.tst
96 TESTCASES
+= dmsubu.tst
97 TESTCASES
+= dmthlip.tst
98 TESTCASES
+= dpaq_sa_l_pw.tst
99 TESTCASES
+= dpaq_sa_l_w.tst
100 TESTCASES
+= dpaq_s_w_ph.tst
101 TESTCASES
+= dpaq_s_w_qh.tst
102 TESTCASES
+= dpau_h_obl.tst
103 TESTCASES
+= dpau_h_obr.tst
104 TESTCASES
+= dpau_h_qbl.tst
105 TESTCASES
+= dpau_h_qbr.tst
106 TESTCASES
+= dpsq_sa_l_pw.tst
107 TESTCASES
+= dpsq_sa_l_w.tst
108 TESTCASES
+= dpsq_s_w_ph.tst
109 TESTCASES
+= dpsq_s_w_qh.tst
110 TESTCASES
+= dpsu_h_obl.tst
111 TESTCASES
+= dpsu_h_obr.tst
112 TESTCASES
+= dpsu_h_qbl.tst
113 TESTCASES
+= dpsu_h_qbr.tst
114 TESTCASES
+= dshilo.tst
115 TESTCASES
+= dshilov.tst
116 TESTCASES
+= extp.tst
117 TESTCASES
+= extpdp.tst
118 TESTCASES
+= extpdpv.tst
119 TESTCASES
+= extpv.tst
120 TESTCASES
+= extr_rs_w.tst
121 TESTCASES
+= extr_r_w.tst
122 TESTCASES
+= extr_s_h.tst
123 TESTCASES
+= extrv_rs_w.tst
124 TESTCASES
+= extrv_r_w.tst
125 TESTCASES
+= extrv_s_h.tst
126 TESTCASES
+= extrv_w.tst
127 TESTCASES
+= extr_w.tst
128 TESTCASES
+= insv.tst
129 TESTCASES
+= lbux.tst
133 TESTCASES
+= madd.tst
134 TESTCASES
+= maddu.tst
135 TESTCASES
+= maq_sa_w_phl.tst
136 TESTCASES
+= maq_sa_w_phr.tst
137 TESTCASES
+= maq_sa_w_qhll.tst
138 TESTCASES
+= maq_sa_w_qhlr.tst
139 TESTCASES
+= maq_sa_w_qhrl.tst
140 TESTCASES
+= maq_sa_w_qhrr.tst
141 TESTCASES
+= maq_s_l_pwl.tst
142 TESTCASES
+= maq_s_l_pwr.tst
143 TESTCASES
+= maq_s_w_phl.tst
144 TESTCASES
+= maq_s_w_phr.tst
145 TESTCASES
+= maq_s_w_qhll.tst
146 TESTCASES
+= maq_s_w_qhlr.tst
147 TESTCASES
+= maq_s_w_qhrl.tst
148 TESTCASES
+= maq_s_w_qhrr.tst
149 TESTCASES
+= mfhi.tst
150 TESTCASES
+= mflo.tst
151 TESTCASES
+= modsub.tst
152 TESTCASES
+= msub.tst
153 TESTCASES
+= msubu.tst
154 TESTCASES
+= mthi.tst
155 TESTCASES
+= mthlip.tst
156 TESTCASES
+= mtlo.tst
157 TESTCASES
+= muleq_s_pw_qhl.tst
158 TESTCASES
+= muleq_s_pw_qhr.tst
159 TESTCASES
+= muleq_s_w_phl.tst
160 TESTCASES
+= muleq_s_w_phr.tst
161 TESTCASES
+= muleu_s_ph_qbl.tst
162 TESTCASES
+= muleu_s_ph_qbr.tst
163 TESTCASES
+= muleu_s_qh_obl.tst
164 TESTCASES
+= muleu_s_qh_obr.tst
165 TESTCASES
+= mulq_rs_ph.tst
166 TESTCASES
+= mulq_rs_qh.tst
167 TESTCASES
+= mulsaq_s_l_pw.tst
168 TESTCASES
+= mulsaq_s_w_qh.tst
169 TESTCASES
+= mult.tst
170 TESTCASES
+= multu.tst
171 TESTCASES
+= packrl_ph.tst
172 TESTCASES
+= packrl_pw.tst
173 TESTCASES
+= pick_ob.tst
174 TESTCASES
+= pick_ph.tst
175 TESTCASES
+= pick_pw.tst
176 TESTCASES
+= pick_qb.tst
177 TESTCASES
+= pick_qh.tst
178 #TESTCASES += preceq_l_pwl.tst
179 #TESTCASES += preceq_l_pwr.tst
180 TESTCASES
+= preceq_pw_qhla.tst
181 TESTCASES
+= preceq_pw_qhl.tst
182 TESTCASES
+= preceq_pw_qhra.tst
183 TESTCASES
+= preceq_pw_qhr.tst
184 TESTCASES
+= precequ_ph_qbla.tst
185 TESTCASES
+= precequ_ph_qbl.tst
186 TESTCASES
+= precequ_ph_qbra.tst
187 TESTCASES
+= precequ_ph_qbr.tst
188 #TESTCASES += precequ_qh_obla.tst
189 #TESTCASES += precequ_qh_obl.tst
190 #TESTCASES += precequ_qh_obra.tst
191 #TESTCASES += precequ_qh_obr.tst
192 TESTCASES
+= preceq_w_phl.tst
193 TESTCASES
+= preceq_w_phr.tst
194 TESTCASES
+= preceu_ph_qbla.tst
195 TESTCASES
+= preceu_ph_qbl.tst
196 TESTCASES
+= preceu_ph_qbra.tst
197 TESTCASES
+= preceu_ph_qbr.tst
198 TESTCASES
+= preceu_qh_obla.tst
199 TESTCASES
+= preceu_qh_obl.tst
200 TESTCASES
+= preceu_qh_obra.tst
201 TESTCASES
+= preceu_qh_obr.tst
202 #TESTCASES += precr_ob_qh.tst
203 TESTCASES
+= precrq_ob_qh.tst
204 TESTCASES
+= precrq_ph_w.tst
205 TESTCASES
+= precrq_pw_l.tst
206 TESTCASES
+= precrq_qb_ph.tst
207 TESTCASES
+= precrq_qh_pw.tst
208 TESTCASES
+= precrq_rs_ph_w.tst
209 TESTCASES
+= precrq_rs_qh_pw.tst
210 TESTCASES
+= precrqu_s_ob_qh.tst
211 TESTCASES
+= precrqu_s_qb_ph.tst
212 #TESTCASES += precr_sra_qh_pw.tst
213 #TESTCASES += precr_sra_r_qh_pw.tst
214 #TESTCASES += prependd.tst
215 #TESTCASES += prependw.tst
216 #TESTCASES += raddu_l_ob.tst
217 TESTCASES
+= raddu_w_qb.tst
218 TESTCASES
+= rddsp.tst
219 TESTCASES
+= repl_ob.tst
220 TESTCASES
+= repl_ph.tst
221 TESTCASES
+= repl_pw.tst
222 TESTCASES
+= repl_qb.tst
223 TESTCASES
+= repl_qh.tst
224 TESTCASES
+= replv_ob.tst
225 TESTCASES
+= replv_ph.tst
226 TESTCASES
+= replv_pw.tst
227 TESTCASES
+= replv_qb.tst
228 TESTCASES
+= shilo.tst
229 TESTCASES
+= shilov.tst
230 TESTCASES
+= shll_ob.tst
231 TESTCASES
+= shll_ph.tst
232 TESTCASES
+= shll_pw.tst
233 TESTCASES
+= shll_qb.tst
234 TESTCASES
+= shll_qh.tst
235 TESTCASES
+= shll_s_ph.tst
236 TESTCASES
+= shll_s_pw.tst
237 TESTCASES
+= shll_s_qh.tst
238 TESTCASES
+= shll_s_w.tst
239 TESTCASES
+= shllv_ob.tst
240 TESTCASES
+= shllv_ph.tst
241 TESTCASES
+= shllv_pw.tst
242 TESTCASES
+= shllv_qb.tst
243 TESTCASES
+= shllv_qh.tst
244 TESTCASES
+= shllv_s_ph.tst
245 TESTCASES
+= shllv_s_pw.tst
246 TESTCASES
+= shllv_s_qh.tst
247 TESTCASES
+= shllv_s_w.tst
248 #TESTCASES += shra_ob.tst
249 TESTCASES
+= shra_ph.tst
250 TESTCASES
+= shra_pw.tst
251 TESTCASES
+= shra_qh.tst
252 #TESTCASES += shra_r_ob.tst
253 TESTCASES
+= shra_r_ph.tst
254 TESTCASES
+= shra_r_pw.tst
255 TESTCASES
+= shra_r_qh.tst
256 TESTCASES
+= shra_r_w.tst
257 TESTCASES
+= shrav_ph.tst
258 TESTCASES
+= shrav_pw.tst
259 TESTCASES
+= shrav_qh.tst
260 TESTCASES
+= shrav_r_ph.tst
261 TESTCASES
+= shrav_r_pw.tst
262 TESTCASES
+= shrav_r_qh.tst
263 TESTCASES
+= shrav_r_w.tst
264 TESTCASES
+= shrl_ob.tst
265 TESTCASES
+= shrl_qb.tst
266 #TESTCASES += shrl_qh.tst
267 TESTCASES
+= shrlv_ob.tst
268 TESTCASES
+= shrlv_qb.tst
269 #TESTCASES += shrlv_qh.tst
270 TESTCASES
+= subq_ph.tst
271 TESTCASES
+= subq_pw.tst
272 TESTCASES
+= subq_qh.tst
273 TESTCASES
+= subq_s_ph.tst
274 TESTCASES
+= subq_s_pw.tst
275 TESTCASES
+= subq_s_qh.tst
276 TESTCASES
+= subq_s_w.tst
277 TESTCASES
+= subu_ob.tst
278 TESTCASES
+= subu_qb.tst
279 TESTCASES
+= subu_s_ob.tst
280 TESTCASES
+= subu_s_qb.tst
281 TESTCASES
+= wrdsp.tst
286 $(Q
)$(CC
) $(HEAD_FLAGS
) -D
"STACK_TOP=0xffffffff80200000" -c
$< -o
$@
289 $(CC
) $(CFLAGS
) -c
$< -o
$@
292 $(CC
) $(CFLAGS
) -c
$< -o
$@
294 %.tst
: %.o
$(VECTORS_OBJ
)
295 $(CC
) $(VECTORS_OBJ
) $(FLAGS
) $(LDFLAGS
) $< -o
$@
297 build
: $(VECTORS_OBJ
) $(MIPSSOC_LIB
) $(TESTCASES
)
299 check: $(VECTORS_OBJ
) $(MIPSSOC_LIB
) $(TESTCASES
)
300 @for case in
$(TESTCASES
); do \
301 echo
$(SIM
) $(SIMFLAGS
) .
/$$case; \
302 $(SIM
) $(SIMFLAGS
) .
/$$case & (sleep
1; killall
$(SIM
)); \
306 $(Q
)rm -f
*.o
*.tst
*.a