Commit | Line | Data |
---|---|---|
9aab5aa3 AC |
1 | ; Fujitsu FRV opcode support, for GNU Binutils. -*- Scheme -*- |
2 | ; | |
6347aad8 | 3 | ; Copyright 2000, 2001, 2003, 2004, 2007, 2009 Free Software Foundation, Inc. |
9aab5aa3 AC |
4 | ; |
5 | ; Contributed by Red Hat Inc; developed under contract from Fujitsu. | |
6 | ; | |
7 | ; This file is part of the GNU Binutils. | |
8 | ; | |
9 | ; This program is free software; you can redistribute it and/or modify | |
10 | ; it under the terms of the GNU General Public License as published by | |
9b201bb5 | 11 | ; the Free Software Foundation; either version 3 of the License, or |
9aab5aa3 AC |
12 | ; (at your option) any later version. |
13 | ; | |
14 | ; This program is distributed in the hope that it will be useful, | |
15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ; GNU General Public License for more details. | |
18 | ; | |
19 | ; You should have received a copy of the GNU General Public License | |
20 | ; along with this program; if not, write to the Free Software | |
9b201bb5 NC |
21 | ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
22 | ; MA 02110-1301, USA. | |
9aab5aa3 AC |
23 | |
24 | (include "simplify.inc") | |
25 | ||
26 | ; define-arch must appear first | |
27 | ||
28 | (define-arch | |
29 | (name frv) ; name of cpu architecture | |
30 | (comment "Fujitsu FRV") | |
31 | (insn-lsb0? #t) | |
676a64f4 | 32 | (machs frv fr550 fr500 fr450 fr400 tomcat simple) |
9aab5aa3 AC |
33 | (isas frv) |
34 | ) | |
35 | ||
36 | (define-isa | |
37 | (name frv) | |
38 | (base-insn-bitsize 32) | |
39 | ; Initial bitnumbers to decode insns by. | |
40 | (decode-assist (24 23 22 21 20 19 18)) | |
41 | (liw-insns 1) ; The frv fetches up to 1 insns at a time. | |
ac7c07ac | 42 | (parallel-insns 8) ; The frv executes up to 8 insns at a time. |
9aab5aa3 AC |
43 | ) |
44 | ||
45 | ; Cpu family definitions. | |
46 | ; | |
47 | (define-cpu | |
48 | ; cpu names must be distinct from the architecture name and machine names. | |
49 | ; The "b" suffix stands for "base" and is the convention. | |
50 | ; The "f" suffix stands for "family" and is the convention. | |
51 | (name frvbf) | |
52 | (comment "Fujitsu FRV base family") | |
53 | (endian big) | |
54 | (word-bitsize 32) | |
55 | ) | |
56 | \f | |
57 | ; Generic FR-V machine. Supports the entire architecture | |
58 | (define-mach | |
59 | (name frv) | |
60 | (comment "Generic FRV cpu") | |
61 | (cpu frvbf) | |
62 | ) | |
63 | (define-model | |
64 | (name frv) (comment "Generic FRV model") (attrs) | |
65 | (mach frv) | |
66 | ||
67 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
68 | ||
69 | ; `state' is a list of variables for recording model state | |
70 | ; (state) | |
71 | ||
72 | (unit u-exec "Execution Unit" () | |
73 | 1 1 ; issue done | |
74 | () ; state | |
75 | () ; inputs | |
76 | () ; outputs | |
77 | () ; profile action (default) | |
78 | ) | |
79 | ) | |
80 | \f | |
ac7c07ac DB |
81 | ; FR550 machine |
82 | (define-mach | |
83 | (name fr550) | |
84 | (comment "FR550 cpu") | |
85 | (cpu frvbf) | |
86 | ) | |
87 | (define-model | |
88 | (name fr550) (comment "FR550 model") (attrs) | |
89 | (mach fr550) | |
90 | ||
91 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
92 | ||
93 | ; `state' is a list of variables for recording model state | |
94 | (state | |
95 | ; State items | |
96 | ; These are all masks with each bit representing one register. | |
97 | (prev-fr-load DI) ; Previous use of FR register was target of a load | |
98 | (prev-fr-complex-1 DI) ; Previous use of FR register has variable latency | |
99 | (prev-fr-complex-2 DI) ; Previous use of FR register has variable latency | |
100 | (prev-ccr-complex DI) ; Previous use of CCR register has variable latency | |
101 | (prev-acc-mmac DI) ; Previous use of ACC register was a MMAC category | |
102 | (cur-fr-load DI) ; Current use of FR register was target of a load | |
103 | (cur-fr-complex-1 DI) ; Current use of FR register has variable latency | |
104 | (cur-fr-complex-2 DI) ; Current use of FR register has variable latency | |
105 | (cur-ccr-complex SI) ; Current use of CCR register has variable latency | |
106 | (cur-acc-mmac DI) ; Current use of ACC register was a MMAC category | |
107 | ) | |
108 | ; Basic unit for instructions with no latency penalties | |
109 | (unit u-exec "Execution Unit" () | |
110 | 1 1 ; issue done | |
111 | () ; state | |
112 | () ; inputs | |
113 | () ; outputs | |
114 | () ; profile action (default) | |
115 | ) | |
116 | ; Basic integer insn unit | |
117 | (unit u-integer "Integer Unit" () | |
118 | 1 1 ; issue done | |
119 | () ; state | |
120 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
121 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
122 | () ; profile action (default) | |
123 | ) | |
124 | ; Integer multiplication unit | |
125 | (unit u-imul "Integer Multiplication Unit" () | |
126 | 1 1 ; issue done | |
127 | () ; state | |
128 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
129 | ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs | |
130 | () ; profile action (default) | |
131 | ) | |
132 | ; Integer division unit | |
133 | (unit u-idiv "Integer Division Unit" () | |
134 | 1 1 ; issue done | |
135 | () ; state | |
136 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
137 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
138 | () ; profile action (default) | |
139 | ) | |
140 | ; Branch unit | |
141 | (unit u-branch "Branch Unit" () | |
142 | 1 1 ; issue done | |
143 | () ; state | |
144 | ((GRi INT -1) (GRj INT -1) | |
145 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
146 | ((pc)) ; outputs | |
147 | () ; profile action (default) | |
148 | ) | |
149 | ; Trap unit | |
150 | (unit u-trap "Trap Unit" () | |
151 | 1 1 ; issue done | |
152 | () ; state | |
153 | ((GRi INT -1) (GRj INT -1) | |
154 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
155 | () ; outputs | |
156 | () ; profile action (default) | |
157 | ) | |
158 | ; Condition code check unit | |
159 | (unit u-check "Check Unit" () | |
160 | 1 1 ; issue done | |
161 | () ; state | |
162 | ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs | |
163 | () ; outputs | |
164 | () ; profile action (default) | |
165 | ) | |
166 | ; Float Arithmetic unit | |
167 | (unit u-float-arith "Float Arithmetic unit" () | |
168 | 1 1 ; issue done | |
169 | () ; state | |
170 | ((FRi INT -1) (FRj INT -1) ; inputs | |
171 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
172 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
173 | () ; profile action (default) | |
174 | ) | |
175 | ; Float Dual Arithmetic unit | |
176 | (unit u-float-dual-arith "Float Arithmetic unit" () | |
177 | ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI | |
178 | 1 3 ; issue done | |
179 | () ; state | |
180 | ((FRi INT -1) (FRj INT -1) ; inputs | |
181 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
182 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
183 | () ; profile action (default) | |
184 | ) | |
185 | ; Float Div unit | |
186 | (unit u-float-div "Float Div unit" () | |
187 | 1 1 ; issue done | |
188 | () ; state | |
189 | ((FRi INT -1) (FRj INT -1)) ; inputs | |
190 | ((FRk INT -1)) ; outputs | |
191 | () ; profile action (default) | |
192 | ) | |
193 | ; Float Square Root unit | |
194 | (unit u-float-sqrt "Float Square Root unit" () | |
195 | 1 1 ; issue done | |
196 | () ; state | |
197 | ((FRj INT -1) (FRdoublej INT -1)) ; inputs | |
198 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
199 | () ; profile action (default) | |
200 | ) | |
201 | ; Float Compare unit | |
202 | (unit u-float-compare "Float Compare unit" () | |
203 | 1 1 ; issue done | |
204 | () ; state | |
205 | ((FRi INT -1) (FRj INT -1) | |
206 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
207 | ((FCCi_2 INT -1)) ; outputs | |
208 | () ; profile action (default) | |
209 | ) | |
210 | ; Dual Float Compare unit | |
211 | (unit u-float-dual-compare "Float Dual Compare unit" () | |
212 | ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI | |
213 | 1 3 ; issue done | |
214 | () ; state | |
215 | ((FRi INT -1) (FRj INT -1)) ; inputs | |
216 | ((FCCi_2 INT -1)) ; outputs | |
217 | () ; profile action (default) | |
218 | ) | |
219 | ; FR Move to GR unit | |
220 | (unit u-fr2gr "FR Move to GR Unit" () | |
221 | 1 1 ; issue done | |
222 | () ; state | |
223 | ((FRintk INT -1)) ; inputs | |
224 | ((GRj INT -1)) ; outputs | |
225 | () ; profile action (default) | |
226 | ) | |
227 | ; GR Move to FR unit | |
228 | (unit u-gr2fr "GR Move to FR Unit" () | |
229 | 1 1 ; issue done | |
230 | () ; state | |
231 | ((GRj INT -1)) ; inputs | |
232 | ((FRintk INT -1)) ; outputs | |
233 | () ; profile action (default) | |
234 | ) | |
235 | ; SPR Move to GR unit | |
236 | (unit u-spr2gr "SPR Move to GR Unit" () | |
237 | 1 1 ; issue done | |
238 | () ; state | |
239 | ((spr INT -1)) ; inputs | |
240 | ((GRj INT -1)) ; outputs | |
241 | () ; profile action (default) | |
242 | ) | |
243 | ; GR Move to SPR unit | |
244 | (unit u-gr2spr "GR Move to SPR Unit" () | |
245 | 1 1 ; issue done | |
246 | () ; state | |
247 | ((GRj INT -1)) ; inputs | |
248 | ((spr INT -1)) ; outputs | |
249 | () ; profile action (default) | |
250 | ) | |
251 | ; GR set half unit | |
252 | (unit u-set-hilo "GR Set Half" () | |
253 | 1 1 ; issue done | |
254 | () ; state | |
255 | () ; inputs | |
256 | ((GRkhi INT -1) (GRklo INT -1)) ; outputs | |
257 | () ; profile action (default) | |
258 | ) | |
259 | ; GR load unit | |
260 | (unit u-gr-load "GR Load Unit" () | |
261 | 1 1 ; issue done | |
262 | () ; state | |
263 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
264 | ((GRk INT -1) (GRdoublek INT -1)) ; outputs | |
265 | () ; profile action (default) | |
266 | ) | |
267 | ; GR store unit | |
268 | (unit u-gr-store "GR Store Unit" () | |
269 | 1 1 ; issue done | |
270 | () ; state | |
271 | ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs | |
272 | () ; outputs | |
273 | () ; profile action (default) | |
274 | ) | |
275 | ; FR load unit | |
276 | (unit u-fr-load "FR Load Unit" () | |
277 | 1 1 ; issue done | |
278 | () ; state | |
279 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
280 | ((FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
281 | () ; profile action (default) | |
282 | ) | |
283 | ; FR store unit | |
284 | (unit u-fr-store "FR Store Unit" () | |
285 | 1 1 ; issue done | |
286 | () ; state | |
287 | ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs | |
288 | () ; outputs | |
289 | () ; profile action (default) | |
290 | ) | |
291 | ; Swap unit | |
292 | (unit u-swap "Swap Unit" () | |
293 | 1 1 ; issue done | |
294 | () ; state | |
295 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
296 | ((GRk INT -1)) ; outputs | |
297 | () ; profile action (default) | |
298 | ) | |
299 | ; FR Move to FR unit | |
300 | (unit u-fr2fr "FR Move to FR Unit" () | |
301 | 1 1 ; issue done | |
302 | () ; state | |
303 | ((FRi INT -1)) ; inputs | |
304 | ((FRk INT -1)) ; outputs | |
305 | () ; profile action (default) | |
306 | ) | |
307 | ; Clrgr unit | |
308 | (unit u-clrgr "Clrgr Unit" () | |
309 | 1 1 ; issue done | |
310 | () ; state | |
311 | ((GRk INT -1)) ; inputs | |
312 | () ; outputs | |
313 | () ; profile action (default) | |
314 | ) | |
315 | ; Clrfr unit | |
316 | (unit u-clrfr "Clrfr Unit" () | |
317 | 1 1 ; issue done | |
318 | () ; state | |
319 | ((FRk INT -1)) ; inputs | |
320 | () ; outputs | |
321 | () ; profile action (default) | |
322 | ) | |
323 | ; Insn cache invalidate unit | |
324 | (unit u-ici "Insn cache invalidate unit" () | |
325 | 1 1 ; issue done | |
326 | () ; state | |
327 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
328 | () ; outputs | |
329 | () ; profile action (default) | |
330 | ) | |
331 | ; Data cache invalidate unit | |
332 | (unit u-dci "Data cache invalidate unit" () | |
333 | 1 1 ; issue done | |
334 | () ; state | |
335 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
336 | () ; outputs | |
337 | () ; profile action (default) | |
338 | ) | |
339 | ; Data cache flush unit | |
340 | (unit u-dcf "Data cache flush unit" () | |
341 | 1 1 ; issue done | |
342 | () ; state | |
343 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
344 | () ; outputs | |
345 | () ; profile action (default) | |
346 | ) | |
347 | ; Insn cache preload unit | |
348 | (unit u-icpl "Insn cache preload unit" () | |
349 | 1 1 ; issue done | |
350 | () ; state | |
351 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
352 | () ; outputs | |
353 | () ; profile action (default) | |
354 | ) | |
355 | ; Data cache preload unit | |
356 | (unit u-dcpl "Data cache preload unit" () | |
357 | 1 1 ; issue done | |
358 | () ; state | |
359 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
360 | () ; outputs | |
361 | () ; profile action (default) | |
362 | ) | |
363 | ; Insn cache unlock unit | |
364 | (unit u-icul "Insn cache unlock unit" () | |
365 | 1 1 ; issue done | |
366 | () ; state | |
367 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
368 | () ; outputs | |
369 | () ; profile action (default) | |
370 | ) | |
371 | ; Data cache unlock unit | |
372 | (unit u-dcul "Data cache unlock unit" () | |
373 | 1 1 ; issue done | |
374 | () ; state | |
375 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
376 | () ; outputs | |
377 | () ; profile action (default) | |
378 | ) | |
379 | ; commit unit | |
380 | (unit u-commit "Commit Unit" () | |
381 | 1 1 ; issue done | |
382 | () ; state | |
383 | ((GRk INT -1) (FRk INT -1)) ; inputs | |
384 | () ; outputs | |
385 | () ; profile action (default) | |
386 | ) | |
387 | ; Float Conversion unit | |
388 | (unit u-float-convert "Float Conversion unit" () | |
389 | 1 1 ; issue done | |
390 | () ; state | |
391 | ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs | |
392 | ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
393 | () ; profile action (default) | |
394 | ) | |
395 | ; Media units | |
396 | (unit u-media "Media unit" () | |
397 | 1 1 ; issue done | |
398 | () ; state | |
399 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
400 | ((FRintk INT -1)) ; outputs | |
401 | () ; profile action (default) | |
402 | ) | |
403 | (unit u-media-quad "Media-quad unit" () | |
404 | 1 1 ; issue done | |
405 | () ; state | |
406 | ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs | |
407 | ((FRintkeven INT -1)) ; outputs | |
408 | () ; profile action (default) | |
409 | ) | |
410 | (unit u-media-dual-expand "Media Dual Expand unit" () | |
411 | 1 1 ; issue done | |
412 | () ; state | |
413 | ((FRinti INT -1)) ; inputs | |
414 | ((FRintkeven INT -1)) ; outputs | |
415 | () ; profile action (default) | |
416 | ) | |
417 | (unit u-media-3-dual "Media-3-dual unit" () | |
418 | 1 1 ; issue done | |
419 | () ; state | |
420 | ((FRinti INT -1)) ; inputs | |
421 | ((FRintk INT -1)) ; outputs | |
422 | () ; profile action (default) | |
423 | ) | |
424 | (unit u-media-3-acc "Media unit for M-3 using ACC" () | |
425 | 1 1 ; issue done | |
426 | () ; state | |
427 | ((FRintj INT -1) (ACC40Si INT -1)) ; inputs | |
428 | ((FRintk INT -1)) ; outputs | |
429 | () ; profile action (default) | |
430 | ) | |
431 | (unit u-media-3-acc-dual "Media-3-acc-dual unit" () | |
432 | 1 1 ; issue done | |
433 | () ; state | |
434 | ((ACC40Si INT -1)) ; inputs | |
435 | ((FRintkeven INT -1)) ; outputs | |
436 | () ; profile action (default) | |
437 | ) | |
438 | (unit u-media-3-wtacc "Media-3-wtacc unit" () | |
439 | 1 1 ; issue done | |
440 | () ; state | |
441 | ((FRinti INT -1) (ACC40Sk INT -1)) ; inputs | |
442 | () ; outputs | |
443 | () ; profile action (default) | |
444 | ) | |
445 | (unit u-media-3-mclracc "Media-3-mclracc unit" () | |
446 | 1 1 ; issue done | |
447 | () ; state | |
448 | () ; inputs | |
449 | () ; outputs | |
450 | () ; profile action (default) | |
451 | ) | |
452 | (unit u-media-set "Media set" () | |
453 | 1 1 ; issue done | |
454 | () ; state | |
455 | () ; inputs | |
456 | ((FRintk INT -1)) ; outputs | |
457 | () ; profile action (default) | |
458 | ) | |
459 | (unit u-media-4 "Media-4 unit" () | |
460 | 1 1 ; issue done | |
461 | () ; state | |
462 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
463 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
464 | () ; profile action (default) | |
465 | ) | |
466 | (unit u-media-4-acc "Media-4-acc unit" () | |
467 | 1 1 ; issue done | |
468 | () ; state | |
469 | ((ACC40Si INT -1)) ; inputs | |
470 | ((ACC40Sk INT -1)) ; outputs | |
471 | () ; profile action (default) | |
472 | ) | |
473 | (unit u-media-4-acc-dual "Media-4-acc-dual unit" () | |
474 | 1 1 ; issue done | |
475 | () ; state | |
476 | ((ACC40Si INT -1)) ; inputs | |
477 | ((ACC40Sk INT -1)) ; outputs | |
478 | () ; profile action (default) | |
479 | ) | |
480 | (unit u-media-4-add-sub "Media-4-add-sub unit" () | |
481 | 1 1 ; issue done | |
482 | () ; state | |
483 | ((ACC40Si INT -1)) ; inputs | |
484 | ((ACC40Sk INT -1)) ; outputs | |
485 | () ; profile action (default) | |
486 | ) | |
487 | (unit u-media-4-add-sub-dual "Media-4-add-sub-dual unit" () | |
488 | 1 1 ; issue done | |
489 | () ; state | |
490 | ((ACC40Si INT -1)) ; inputs | |
491 | ((ACC40Sk INT -1)) ; outputs | |
492 | () ; profile action (default) | |
493 | ) | |
494 | (unit u-media-4-quad "Media-4-quad unit" () | |
495 | 1 1 ; issue done | |
496 | () ; state | |
497 | ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs | |
498 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
499 | () ; profile action (default) | |
500 | ) | |
501 | ) | |
502 | ||
9aab5aa3 AC |
503 | ; FR500 machine. |
504 | (define-mach | |
505 | (name fr500) | |
506 | (comment "FR500 cpu") | |
507 | (cpu frvbf) | |
508 | ) | |
509 | (define-model | |
510 | (name fr500) (comment "FR500 model") (attrs) | |
511 | (mach fr500) | |
512 | ||
513 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
514 | ||
515 | ; `state' is a list of variables for recording model state | |
516 | (state | |
517 | ; State items | |
518 | ; These are all masks with each bit representing one register. | |
519 | (prev-fpop DI) ; Previous use of FR register was floating point insn | |
520 | (prev-media DI) ; Previous use of FR register was a media insn | |
521 | (prev-cc-complex DI) ; Previous use of ICC register was not simple | |
522 | (cur-fpop DI) ; Current use of FR register was floating point insn | |
523 | (cur-media DI) ; Current use of FR register was a media insn | |
524 | (cur-cc-complex DI) ; Current use of ICC register was not simple | |
525 | ) | |
526 | ; Basic unit for instructions with no latency penalties | |
527 | (unit u-exec "Execution Unit" () | |
528 | 1 1 ; issue done | |
529 | () ; state | |
530 | () ; inputs | |
531 | () ; outputs | |
532 | () ; profile action (default) | |
533 | ) | |
534 | ; Basic integer insn unit | |
535 | (unit u-integer "Integer Unit" () | |
536 | 1 1 ; issue done | |
537 | () ; state | |
538 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
539 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
540 | () ; profile action (default) | |
541 | ) | |
542 | ; Integer multiplication unit | |
543 | (unit u-imul "Integer Multiplication Unit" () | |
544 | 1 1 ; issue done | |
545 | () ; state | |
546 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
547 | ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs | |
548 | () ; profile action (default) | |
549 | ) | |
550 | ; Integer division unit | |
551 | (unit u-idiv "Integer Division Unit" () | |
552 | 1 1 ; issue done | |
553 | () ; state | |
554 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
555 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
556 | () ; profile action (default) | |
557 | ) | |
558 | ; Branch unit | |
559 | (unit u-branch "Branch Unit" () | |
560 | 1 1 ; issue done | |
561 | () ; state | |
562 | ((GRi INT -1) (GRj INT -1) | |
563 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
564 | ((pc)) ; outputs | |
565 | () ; profile action (default) | |
566 | ) | |
567 | ; Trap unit | |
568 | (unit u-trap "Trap Unit" () | |
569 | 1 1 ; issue done | |
570 | () ; state | |
571 | ((GRi INT -1) (GRj INT -1) | |
572 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
573 | () ; outputs | |
574 | () ; profile action (default) | |
575 | ) | |
576 | ; Condition code check unit | |
577 | (unit u-check "Check Unit" () | |
578 | 1 1 ; issue done | |
579 | () ; state | |
580 | ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs | |
581 | () ; outputs | |
582 | () ; profile action (default) | |
583 | ) | |
23600bb3 DB |
584 | ; Clrgr unit |
585 | (unit u-clrgr "Clrgr Unit" () | |
586 | 1 1 ; issue done | |
587 | () ; state | |
588 | ((GRk INT -1)) ; inputs | |
589 | () ; outputs | |
590 | () ; profile action (default) | |
591 | ) | |
592 | ; Clrfr unit | |
593 | (unit u-clrfr "Clrfr Unit" () | |
594 | 1 1 ; issue done | |
595 | () ; state | |
596 | ((FRk INT -1)) ; inputs | |
597 | () ; outputs | |
598 | () ; profile action (default) | |
599 | ) | |
9aab5aa3 AC |
600 | ; GR set half unit |
601 | (unit u-set-hilo "GR Set Half" () | |
602 | 1 1 ; issue done | |
603 | () ; state | |
604 | () ; inputs | |
605 | ((GRkhi INT -1) (GRklo INT -1)) ; outputs | |
606 | () ; profile action (default) | |
607 | ) | |
608 | ; GR load unit -- TODO doesn't handle quad | |
609 | (unit u-gr-load "GR Load Unit" () | |
610 | 1 1 ; issue done | |
611 | () ; state | |
612 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
613 | ((GRk INT -1) (GRdoublek INT -1)) ; outputs | |
614 | () ; profile action (default) | |
615 | ) | |
616 | ; GR store unit -- TODO doesn't handle quad | |
617 | (unit u-gr-store "GR Store Unit" () | |
618 | 1 1 ; issue done | |
619 | () ; state | |
620 | ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs | |
621 | () ; outputs | |
622 | () ; profile action (default) | |
623 | ) | |
624 | ; GR recovering store unit -- TODO doesn't handle quad | |
625 | (unit u-gr-r-store "GR Recovering Store Unit" () | |
626 | 1 1 ; issue done | |
627 | () ; state | |
628 | ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs | |
629 | () ; outputs | |
630 | () ; profile action (default) | |
631 | ) | |
632 | ; FR load unit -- TODO doesn't handle quad | |
633 | (unit u-fr-load "FR Load Unit" () | |
634 | 1 1 ; issue done | |
635 | () ; state | |
636 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
637 | ((FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
638 | () ; profile action (default) | |
639 | ) | |
640 | ; FR store unit -- TODO doesn't handle quad | |
641 | (unit u-fr-store "FR Store Unit" () | |
642 | 1 1 ; issue done | |
643 | () ; state | |
644 | ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs | |
645 | () ; outputs | |
646 | () ; profile action (default) | |
647 | ) | |
648 | ; FR recovering store unit -- TODO doesn't handle quad | |
649 | (unit u-fr-r-store "FR Recovering Store Unit" () | |
650 | 1 1 ; issue done | |
651 | () ; state | |
652 | ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs | |
653 | () ; outputs | |
654 | () ; profile action (default) | |
655 | ) | |
656 | ; Swap unit | |
657 | (unit u-swap "Swap Unit" () | |
658 | 1 1 ; issue done | |
659 | () ; state | |
660 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
661 | ((GRk INT -1)) ; outputs | |
662 | () ; profile action (default) | |
663 | ) | |
664 | ; FR Move to FR unit | |
665 | (unit u-fr2fr "FR Move to FR Unit" () | |
666 | 1 1 ; issue done | |
667 | () ; state | |
668 | ((FRi INT -1)) ; inputs | |
669 | ((FRk INT -1)) ; outputs | |
670 | () ; profile action (default) | |
671 | ) | |
672 | ; FR Move to GR unit | |
673 | (unit u-fr2gr "FR Move to GR Unit" () | |
674 | 1 1 ; issue done | |
675 | () ; state | |
676 | ((FRintk INT -1)) ; inputs | |
677 | ((GRj INT -1)) ; outputs | |
678 | () ; profile action (default) | |
679 | ) | |
680 | ; SPR Move to GR unit | |
681 | (unit u-spr2gr "SPR Move to GR Unit" () | |
682 | 1 1 ; issue done | |
683 | () ; state | |
684 | ((spr INT -1)) ; inputs | |
685 | ((GRj INT -1)) ; outputs | |
686 | () ; profile action (default) | |
687 | ) | |
688 | ; GR Move to FR unit | |
689 | (unit u-gr2fr "GR Move to FR Unit" () | |
690 | 1 1 ; issue done | |
691 | () ; state | |
692 | ((GRj INT -1)) ; inputs | |
693 | ((FRintk INT -1)) ; outputs | |
694 | () ; profile action (default) | |
695 | ) | |
696 | ; GR Move to SPR unit | |
697 | (unit u-gr2spr "GR Move to SPR Unit" () | |
698 | 1 1 ; issue done | |
699 | () ; state | |
700 | ((GRj INT -1)) ; inputs | |
701 | ((spr INT -1)) ; outputs | |
702 | () ; profile action (default) | |
703 | ) | |
704 | ; Float Arithmetic unit | |
705 | (unit u-float-arith "Float Arithmetic unit" () | |
706 | 1 1 ; issue done | |
707 | () ; state | |
708 | ((FRi INT -1) (FRj INT -1) ; inputs | |
709 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
710 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
711 | () ; profile action (default) | |
712 | ) | |
713 | ; Float Dual Arithmetic unit | |
714 | (unit u-float-dual-arith "Float Arithmetic unit" () | |
715 | 1 1 ; issue done | |
716 | () ; state | |
717 | ((FRi INT -1) (FRj INT -1) ; inputs | |
718 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
719 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
720 | () ; profile action (default) | |
721 | ) | |
722 | ; Float Div unit | |
723 | (unit u-float-div "Float Div unit" () | |
724 | 1 1 ; issue done | |
725 | () ; state | |
726 | ((FRi INT -1) (FRj INT -1)) ; inputs | |
727 | ((FRk INT -1)) ; outputs | |
728 | () ; profile action (default) | |
729 | ) | |
730 | ; Float Square Root unit | |
731 | (unit u-float-sqrt "Float Square Root unit" () | |
732 | 1 1 ; issue done | |
733 | () ; state | |
734 | ((FRj INT -1) (FRdoublej INT -1)) ; inputs | |
735 | ((FRk INT -1) (FRdoublek INT -1)) ; outputs | |
736 | () ; profile action (default) | |
737 | ) | |
738 | ; Float Dual Square Root unit | |
739 | (unit u-float-dual-sqrt "Float Dual Square Root unit" () | |
740 | 1 1 ; issue done | |
741 | () ; state | |
742 | ((FRj INT -1)) ; inputs | |
743 | ((FRk INT -1)) ; outputs | |
744 | () ; profile action (default) | |
745 | ) | |
746 | ; Float Compare unit | |
747 | (unit u-float-compare "Float Compare unit" () | |
748 | 1 1 ; issue done | |
749 | () ; state | |
750 | ((FRi INT -1) (FRj INT -1) | |
751 | (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs | |
752 | ((FCCi_2 INT -1)) ; outputs | |
753 | () ; profile action (default) | |
754 | ) | |
755 | ; Dual Float Compare unit | |
756 | (unit u-float-dual-compare "Float Dual Compare unit" () | |
757 | 1 1 ; issue done | |
758 | () ; state | |
759 | ((FRi INT -1) (FRj INT -1)) ; inputs | |
760 | ((FCCi_2 INT -1)) ; outputs | |
761 | () ; profile action (default) | |
762 | ) | |
763 | ; Float Conversion unit | |
764 | (unit u-float-convert "Float Conversion unit" () | |
765 | 1 1 ; issue done | |
766 | () ; state | |
767 | ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs | |
768 | ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
769 | () ; profile action (default) | |
770 | ) | |
771 | ; Dual Float Conversion unit | |
772 | (unit u-float-dual-convert "Float Dual Conversion unit" () | |
773 | 1 1 ; issue done | |
774 | () ; state | |
775 | ((FRj INT -1) (FRintj INT -1)) ; inputs | |
776 | ((FRk INT -1) (FRintk INT -1)) ; outputs | |
777 | () ; profile action (default) | |
778 | ) | |
779 | ; Media unit | |
780 | (unit u-media "Media unit" () | |
781 | 1 1 ; issue done | |
782 | () ; state | |
783 | ((FRinti INT -1) (FRintj INT -1) (ACC40Si INT -1) (ACCGi INT -1)) ; inputs | |
784 | ((FRintk INT -1) (ACC40Sk INT -1) (ACC40Uk INT -1) (ACCGk INT -1)) ; outputs | |
785 | () ; profile action (default) | |
786 | ) | |
787 | ; Media Quad Arithmetic unit | |
788 | (unit u-media-quad-arith "Media Quad Arithmetic unit" () | |
789 | 1 1 ; issue done | |
790 | () ; state | |
791 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
792 | ((FRintk INT -1)) ; outputs | |
793 | () ; profile action (default) | |
794 | ) | |
795 | ; Media Dual Multiplication unit | |
796 | (unit u-media-dual-mul "Media Dual Multiplication unit" () | |
797 | 1 1 ; issue done | |
798 | () ; state | |
799 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
800 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
801 | () ; profile action (default) | |
802 | ) | |
803 | ; Media Quad Multiplication unit | |
804 | (unit u-media-quad-mul "Media Quad Multiplication unit" () | |
805 | 1 1 ; issue done | |
806 | () ; state | |
807 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
808 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
809 | () ; profile action (default) | |
810 | ) | |
811 | ; Media Quad Complex unit | |
812 | (unit u-media-quad-complex "Media Quad Complex unit" () | |
813 | 1 1 ; issue done | |
814 | () ; state | |
815 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
816 | ((ACC40Sk INT -1)) ; outputs | |
817 | () ; profile action (default) | |
818 | ) | |
819 | ; Media Dual Expand unit | |
820 | (unit u-media-dual-expand "Media Dual Expand unit" () | |
821 | 1 1 ; issue done | |
822 | () ; state | |
823 | ((FRinti INT -1)) ; inputs | |
824 | ((FRintk INT -1)) ; outputs | |
825 | () ; profile action (default) | |
826 | ) | |
827 | ; Media Dual Unpack unit | |
828 | (unit u-media-dual-unpack "Media Dual Unpack unit" () | |
829 | 1 1 ; issue done | |
830 | () ; state | |
831 | ((FRinti INT -1)) ; inputs | |
832 | ((FRintk INT -1)) ; outputs | |
833 | () ; profile action (default) | |
834 | ) | |
835 | ; Media Dual byte to half unit | |
836 | (unit u-media-dual-btoh "Media Byte to byte" () | |
837 | 1 1 ; issue done | |
838 | () ; state | |
839 | ((FRintj INT -1)) ; inputs | |
840 | ((FRintk INT -1)) ; outputs | |
841 | () ; profile action (default) | |
842 | ) | |
843 | ; Media Dual half to byte unit | |
844 | (unit u-media-dual-htob "Media Half to byte" () | |
845 | 1 1 ; issue done | |
846 | () ; state | |
847 | ((FRintj INT -1)) ; inputs | |
848 | ((FRintk INT -1)) ; outputs | |
849 | () ; profile action (default) | |
850 | ) | |
851 | ; Media Dual byte to half unit extended | |
852 | (unit u-media-dual-btohe "Media Byte to byte extended" () | |
853 | 1 1 ; issue done | |
854 | () ; state | |
855 | ((FRintj INT -1)) ; inputs | |
856 | ((FRintk INT -1)) ; outputs | |
857 | () ; profile action (default) | |
858 | ) | |
859 | ; Barrier unit | |
860 | (unit u-barrier "Barrier unit" () | |
861 | 1 1 ; issue done | |
862 | () ; state | |
863 | () ; inputs | |
864 | () ; outputs | |
865 | () ; profile action (default) | |
866 | ) | |
867 | ; Memory Barrier unit | |
868 | (unit u-membar "Memory Barrier unit" () | |
869 | 1 1 ; issue done | |
870 | () ; state | |
871 | () ; inputs | |
872 | () ; outputs | |
873 | () ; profile action (default) | |
874 | ) | |
875 | ; Insn cache invalidate unit | |
876 | (unit u-ici "Insn cache invalidate unit" () | |
877 | 1 1 ; issue done | |
878 | () ; state | |
879 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
880 | () ; outputs | |
881 | () ; profile action (default) | |
882 | ) | |
883 | ; Data cache invalidate unit | |
884 | (unit u-dci "Data cache invalidate unit" () | |
885 | 1 1 ; issue done | |
886 | () ; state | |
887 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
888 | () ; outputs | |
889 | () ; profile action (default) | |
890 | ) | |
891 | ; Data cache flush unit | |
892 | (unit u-dcf "Data cache flush unit" () | |
893 | 1 1 ; issue done | |
894 | () ; state | |
895 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
896 | () ; outputs | |
897 | () ; profile action (default) | |
898 | ) | |
899 | ; Insn cache preload unit | |
900 | (unit u-icpl "Insn cache preload unit" () | |
901 | 1 1 ; issue done | |
902 | () ; state | |
903 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
904 | () ; outputs | |
905 | () ; profile action (default) | |
906 | ) | |
907 | ; Data cache preload unit | |
908 | (unit u-dcpl "Data cache preload unit" () | |
909 | 1 1 ; issue done | |
910 | () ; state | |
911 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
912 | () ; outputs | |
913 | () ; profile action (default) | |
914 | ) | |
915 | ; Insn cache unlock unit | |
916 | (unit u-icul "Insn cache unlock unit" () | |
917 | 1 1 ; issue done | |
918 | () ; state | |
919 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
920 | () ; outputs | |
921 | () ; profile action (default) | |
922 | ) | |
923 | ; Data cache unlock unit | |
924 | (unit u-dcul "Data cache unlock unit" () | |
925 | 1 1 ; issue done | |
926 | () ; state | |
927 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
928 | () ; outputs | |
929 | () ; profile action (default) | |
930 | ) | |
d0312406 DB |
931 | ; commit unit |
932 | (unit u-commit "Commit Unit" () | |
933 | 1 1 ; issue done | |
934 | () ; state | |
935 | ((GRk INT -1) (FRk INT -1)) ; inputs | |
936 | () ; outputs | |
937 | () ; profile action (default) | |
938 | ) | |
9aab5aa3 AC |
939 | ) |
940 | \f | |
941 | ; Tomcat machine. Early version of fr500 machine | |
942 | (define-mach | |
943 | (name tomcat) | |
944 | (comment "Tomcat -- early version of fr500") | |
945 | (cpu frvbf) | |
946 | ) | |
947 | (define-model | |
948 | (name tomcat) (comment "Tomcat model") (attrs) | |
949 | (mach tomcat) | |
950 | ||
951 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
952 | ||
953 | ; `state' is a list of variables for recording model state | |
954 | ; (state) | |
955 | ||
956 | (unit u-exec "Execution Unit" () | |
957 | 1 1 ; issue done | |
958 | () ; state | |
959 | () ; inputs | |
960 | () ; outputs | |
961 | () ; profile action (default) | |
962 | ) | |
963 | ) | |
964 | \f | |
965 | ; FR400 machine | |
966 | (define-mach | |
967 | (name fr400) | |
968 | (comment "FR400 cpu") | |
969 | (cpu frvbf) | |
970 | ) | |
971 | (define-model | |
972 | (name fr400) (comment "FR400 model") (attrs) | |
973 | (mach fr400) | |
974 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
975 | ; `state' is a list of variables for recording model state | |
976 | (state | |
977 | ; State items | |
978 | ; These are all masks with each bit representing one register. | |
979 | (prev-fp-load DI) ; Previous use of FR register was floating point load | |
980 | (prev-fr-p4 DI) ; Previous use of FR register was media unit 4 | |
981 | (prev-fr-p6 DI) ; Previous use of FR register was media unit 6 | |
982 | (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2 | |
983 | (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4 | |
984 | (cur-fp-load DI) ; Current use of FR register is floating point load | |
985 | (cur-fr-p4 DI) ; Current use of FR register is media unit 4 | |
986 | (cur-fr-p6 DI) ; Current use of FR register is media unit 6 | |
987 | (cur-acc-p2 DI) ; Current use of ACC register is media unit 2 | |
988 | (cur-acc-p4 DI) ; Current use of ACC register is media unit 4 | |
989 | ) | |
990 | (unit u-exec "Execution Unit" () | |
991 | 1 1 ; issue done | |
992 | () ; state | |
993 | () ; inputs | |
994 | () ; outputs | |
995 | () ; profile action (default) | |
996 | ) | |
997 | ; Basic integer insn unit | |
998 | (unit u-integer "Integer Unit" () | |
999 | 1 1 ; issue done | |
1000 | () ; state | |
1001 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1002 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
1003 | () ; profile action (default) | |
1004 | ) | |
1005 | ; Integer multiplication unit | |
1006 | (unit u-imul "Integer Multiplication Unit" () | |
1007 | 1 1 ; issue done | |
1008 | () ; state | |
1009 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1010 | ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs | |
1011 | () ; profile action (default) | |
1012 | ) | |
1013 | ; Integer division unit | |
1014 | (unit u-idiv "Integer Division Unit" () | |
1015 | 1 1 ; issue done | |
1016 | () ; state | |
1017 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1018 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
1019 | () ; profile action (default) | |
1020 | ) | |
1021 | ; Branch unit | |
1022 | (unit u-branch "Branch Unit" () | |
1023 | 1 1 ; issue done | |
1024 | () ; state | |
1025 | ((GRi INT -1) (GRj INT -1) | |
1026 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
1027 | ((pc)) ; outputs | |
1028 | () ; profile action (default) | |
1029 | ) | |
1030 | ; Trap unit | |
1031 | (unit u-trap "Trap Unit" () | |
1032 | 1 1 ; issue done | |
1033 | () ; state | |
1034 | ((GRi INT -1) (GRj INT -1) | |
1035 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
1036 | () ; outputs | |
1037 | () ; profile action (default) | |
1038 | ) | |
1039 | ; Condition code check unit | |
1040 | (unit u-check "Check Unit" () | |
1041 | 1 1 ; issue done | |
1042 | () ; state | |
1043 | ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs | |
1044 | () ; outputs | |
1045 | () ; profile action (default) | |
1046 | ) | |
1047 | ; GR set half unit | |
1048 | (unit u-set-hilo "GR Set Half" () | |
1049 | 1 1 ; issue done | |
1050 | () ; state | |
1051 | () ; inputs | |
1052 | ((GRkhi INT -1) (GRklo INT -1)) ; outputs | |
1053 | () ; profile action (default) | |
1054 | ) | |
1055 | ; GR load unit -- TODO doesn't handle quad | |
1056 | (unit u-gr-load "GR Load Unit" () | |
1057 | 1 1 ; issue done | |
1058 | () ; state | |
1059 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1060 | ((GRk INT -1) (GRdoublek INT -1)) ; outputs | |
1061 | () ; profile action (default) | |
1062 | ) | |
1063 | ; GR store unit -- TODO doesn't handle quad | |
1064 | (unit u-gr-store "GR Store Unit" () | |
1065 | 1 1 ; issue done | |
1066 | () ; state | |
1067 | ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs | |
1068 | () ; outputs | |
1069 | () ; profile action (default) | |
1070 | ) | |
1071 | ; FR load unit -- TODO doesn't handle quad | |
1072 | (unit u-fr-load "FR Load Unit" () | |
1073 | 1 1 ; issue done | |
1074 | () ; state | |
1075 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1076 | ((FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
1077 | () ; profile action (default) | |
1078 | ) | |
1079 | ; FR store unit -- TODO doesn't handle quad | |
1080 | (unit u-fr-store "FR Store Unit" () | |
1081 | 1 1 ; issue done | |
1082 | () ; state | |
1083 | ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs | |
1084 | () ; outputs | |
1085 | () ; profile action (default) | |
1086 | ) | |
1087 | ; Swap unit | |
1088 | (unit u-swap "Swap Unit" () | |
1089 | 1 1 ; issue done | |
1090 | () ; state | |
1091 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1092 | ((GRk INT -1)) ; outputs | |
1093 | () ; profile action (default) | |
1094 | ) | |
1095 | ; FR Move to GR unit | |
1096 | (unit u-fr2gr "FR Move to GR Unit" () | |
1097 | 1 1 ; issue done | |
1098 | () ; state | |
1099 | ((FRintk INT -1)) ; inputs | |
1100 | ((GRj INT -1)) ; outputs | |
1101 | () ; profile action (default) | |
1102 | ) | |
1103 | ; SPR Move to GR unit | |
1104 | (unit u-spr2gr "SPR Move to GR Unit" () | |
1105 | 1 1 ; issue done | |
1106 | () ; state | |
1107 | ((spr INT -1)) ; inputs | |
1108 | ((GRj INT -1)) ; outputs | |
1109 | () ; profile action (default) | |
1110 | ) | |
1111 | ; GR Move to FR unit | |
1112 | (unit u-gr2fr "GR Move to FR Unit" () | |
1113 | 1 1 ; issue done | |
1114 | () ; state | |
1115 | ((GRj INT -1)) ; inputs | |
1116 | ((FRintk INT -1)) ; outputs | |
1117 | () ; profile action (default) | |
1118 | ) | |
1119 | ; GR Move to SPR unit | |
1120 | (unit u-gr2spr "GR Move to SPR Unit" () | |
1121 | 1 1 ; issue done | |
1122 | () ; state | |
1123 | ((GRj INT -1)) ; inputs | |
1124 | ((spr INT -1)) ; outputs | |
1125 | () ; profile action (default) | |
1126 | ) | |
1127 | ; Media unit M1 -- see table 13-8 in the fr400 LSI | |
1128 | (unit u-media-1 "Media-1 unit" () | |
1129 | 1 1 ; issue done | |
1130 | () ; state | |
1131 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1132 | ((FRintk INT -1)) ; outputs | |
1133 | () ; profile action (default) | |
1134 | ) | |
1135 | (unit u-media-1-quad "Media-1-quad unit" () | |
1136 | 1 1 ; issue done | |
1137 | () ; state | |
1138 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1139 | ((FRintk INT -1)) ; outputs | |
1140 | () ; profile action (default) | |
1141 | ) | |
1142 | (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" () | |
1143 | 1 1 ; issue done | |
1144 | () ; state | |
1145 | () ; inputs | |
1146 | ((FRkhi INT -1) (FRklo INT -1)) ; outputs | |
1147 | () ; profile action (default) | |
1148 | ) | |
1149 | ; Media unit M2 -- see table 13-8 in the fr400 LSI | |
1150 | (unit u-media-2 "Media-2 unit" () | |
1151 | 1 1 ; issue done | |
1152 | () ; state | |
1153 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1154 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
1155 | () ; profile action (default) | |
1156 | ) | |
1157 | (unit u-media-2-quad "Media-2-quad unit" () | |
1158 | 1 1 ; issue done | |
1159 | () ; state | |
1160 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1161 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
1162 | () ; profile action (default) | |
1163 | ) | |
1164 | (unit u-media-2-acc "Media-2-acc unit" () | |
1165 | 1 1 ; issue done | |
1166 | () ; state | |
1167 | ((ACC40Si INT -1)) ; inputs | |
1168 | ((ACC40Sk INT -1)) ; outputs | |
1169 | () ; profile action (default) | |
1170 | ) | |
1171 | (unit u-media-2-acc-dual "Media-2-acc-dual unit" () | |
1172 | 1 1 ; issue done | |
1173 | () ; state | |
1174 | ((ACC40Si INT -1)) ; inputs | |
1175 | ((ACC40Sk INT -1)) ; outputs | |
1176 | () ; profile action (default) | |
1177 | ) | |
1178 | (unit u-media-2-add-sub "Media-2-add-sub unit" () | |
1179 | 1 1 ; issue done | |
1180 | () ; state | |
1181 | ((ACC40Si INT -1)) ; inputs | |
1182 | ((ACC40Sk INT -1)) ; outputs | |
1183 | () ; profile action (default) | |
1184 | ) | |
1185 | (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" () | |
1186 | 1 1 ; issue done | |
1187 | () ; state | |
1188 | ((ACC40Si INT -1)) ; inputs | |
1189 | ((ACC40Sk INT -1)) ; outputs | |
1190 | () ; profile action (default) | |
1191 | ) | |
1192 | ; Media unit M3 -- see table 13-8 in the fr400 LSI | |
1193 | (unit u-media-3 "Media-3 unit" () | |
1194 | 1 1 ; issue done | |
1195 | () ; state | |
1196 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1197 | ((FRintk INT -1)) ; outputs | |
1198 | () ; profile action (default) | |
1199 | ) | |
1200 | (unit u-media-3-dual "Media-3-dual unit" () | |
1201 | 1 1 ; issue done | |
1202 | () ; state | |
1203 | ((FRinti INT -1)) ; inputs | |
1204 | ((FRintk INT -1)) ; outputs | |
1205 | () ; profile action (default) | |
1206 | ) | |
1207 | (unit u-media-3-quad "Media-3-quad unit" () | |
1208 | 1 1 ; issue done | |
1209 | () ; state | |
1210 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1211 | ((FRintk INT -1)) ; outputs | |
1212 | () ; profile action (default) | |
1213 | ) | |
1214 | ; Media unit M4 -- see table 13-8 in the fr400 LSI | |
1215 | (unit u-media-4 "Media-4 unit" () | |
1216 | 1 1 ; issue done | |
1217 | () ; state | |
1218 | ((ACC40Si INT -1) (FRintj INT -1)) ; inputs | |
1219 | ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs | |
1220 | () ; profile action (default) | |
1221 | ) | |
1222 | (unit u-media-4-accg "Media-4-accg unit" () | |
1223 | 1 1 ; issue done | |
1224 | () ; state | |
1225 | ((ACCGi INT -1) (FRinti INT -1)) ; inputs | |
1226 | ((ACCGk INT -1) (FRintk INT -1)) ; outputs | |
1227 | () ; profile action (default) | |
1228 | ) | |
1229 | (unit u-media-4-acc-dual "Media-4-acc-dual unit" () | |
1230 | 1 1 ; issue done | |
1231 | () ; state | |
1232 | ((ACC40Si INT -1)) ; inputs | |
1233 | ((FRintk INT -1)) ; outputs | |
1234 | () ; profile action (default) | |
1235 | ) | |
1236 | ; Media unit M6 -- see table 13-8 in the fr400 LSI | |
1237 | (unit u-media-6 "Media-6 unit" () | |
1238 | 1 1 ; issue done | |
1239 | () ; state | |
1240 | ((FRinti INT -1)) ; inputs | |
1241 | ((FRintk INT -1)) ; outputs | |
1242 | () ; profile action (default) | |
1243 | ) | |
1244 | ; Media unit M7 -- see table 13-8 in the fr400 LSI | |
1245 | (unit u-media-7 "Media-1 unit" () | |
1246 | 1 1 ; issue done | |
1247 | () ; state | |
1248 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1249 | ((FCCk INT -1)) ; outputs | |
1250 | () ; profile action (default) | |
1251 | ) | |
1252 | ; Media Dual Expand unit | |
1253 | (unit u-media-dual-expand "Media Dual Expand unit" () | |
1254 | 1 1 ; issue done | |
1255 | () ; state | |
1256 | ((FRinti INT -1)) ; inputs | |
1257 | ((FRintk INT -1)) ; outputs | |
1258 | () ; profile action (default) | |
1259 | ) | |
1260 | ; Media Dual half to byte unit | |
1261 | (unit u-media-dual-htob "Media Half to byte" () | |
1262 | 1 1 ; issue done | |
1263 | () ; state | |
1264 | ((FRintj INT -1)) ; inputs | |
1265 | ((FRintk INT -1)) ; outputs | |
1266 | () ; profile action (default) | |
1267 | ) | |
1268 | ; Barrier unit | |
1269 | (unit u-barrier "Barrier unit" () | |
1270 | 1 1 ; issue done | |
1271 | () ; state | |
1272 | () ; inputs | |
1273 | () ; outputs | |
1274 | () ; profile action (default) | |
1275 | ) | |
1276 | ; Memory Barrier unit | |
1277 | (unit u-membar "Memory Barrier unit" () | |
1278 | 1 1 ; issue done | |
1279 | () ; state | |
1280 | () ; inputs | |
1281 | () ; outputs | |
1282 | () ; profile action (default) | |
1283 | ) | |
1284 | ; Insn cache invalidate unit | |
1285 | (unit u-ici "Insn cache invalidate unit" () | |
1286 | 1 1 ; issue done | |
1287 | () ; state | |
1288 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1289 | () ; outputs | |
1290 | () ; profile action (default) | |
1291 | ) | |
1292 | ; Data cache invalidate unit | |
1293 | (unit u-dci "Data cache invalidate unit" () | |
1294 | 1 1 ; issue done | |
1295 | () ; state | |
1296 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1297 | () ; outputs | |
1298 | () ; profile action (default) | |
1299 | ) | |
1300 | ; Data cache flush unit | |
1301 | (unit u-dcf "Data cache flush unit" () | |
1302 | 1 1 ; issue done | |
1303 | () ; state | |
1304 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1305 | () ; outputs | |
1306 | () ; profile action (default) | |
1307 | ) | |
1308 | ; Insn cache preload unit | |
1309 | (unit u-icpl "Insn cache preload unit" () | |
1310 | 1 1 ; issue done | |
1311 | () ; state | |
1312 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1313 | () ; outputs | |
1314 | () ; profile action (default) | |
1315 | ) | |
1316 | ; Data cache preload unit | |
1317 | (unit u-dcpl "Data cache preload unit" () | |
1318 | 1 1 ; issue done | |
1319 | () ; state | |
1320 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1321 | () ; outputs | |
1322 | () ; profile action (default) | |
1323 | ) | |
1324 | ; Insn cache unlock unit | |
1325 | (unit u-icul "Insn cache unlock unit" () | |
1326 | 1 1 ; issue done | |
1327 | () ; state | |
1328 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1329 | () ; outputs | |
1330 | () ; profile action (default) | |
1331 | ) | |
1332 | ; Data cache unlock unit | |
1333 | (unit u-dcul "Data cache unlock unit" () | |
1334 | 1 1 ; issue done | |
1335 | () ; state | |
1336 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1337 | () ; outputs | |
1338 | () ; profile action (default) | |
1339 | ) | |
1340 | ) | |
1341 | \f | |
676a64f4 RS |
1342 | ; FR450 machine |
1343 | (define-mach | |
1344 | (name fr450) | |
1345 | (comment "FR450 cpu") | |
1346 | (cpu frvbf) | |
1347 | ) | |
1348 | (define-model | |
1349 | (name fr450) (comment "FR450 model") (attrs) | |
1350 | (mach fr450) | |
1351 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
1352 | ; `state' is a list of variables for recording model state | |
1353 | (state | |
1354 | ; State items | |
1355 | ; These are all masks with each bit representing one register. | |
1356 | (prev-fp-load DI) ; Previous use of FR register was floating point load | |
1357 | (prev-fr-p4 DI) ; Previous use of FR register was media unit 4 | |
1358 | (prev-fr-p6 DI) ; Previous use of FR register was media unit 6 | |
1359 | (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2 | |
1360 | (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4 | |
1361 | (cur-fp-load DI) ; Current use of FR register is floating point load | |
1362 | (cur-fr-p4 DI) ; Current use of FR register is media unit 4 | |
1363 | (cur-fr-p6 DI) ; Current use of FR register is media unit 6 | |
1364 | (cur-acc-p2 DI) ; Current use of ACC register is media unit 2 | |
1365 | (cur-acc-p4 DI) ; Current use of ACC register is media unit 4 | |
1366 | ) | |
1367 | (unit u-exec "Execution Unit" () | |
1368 | 1 1 ; issue done | |
1369 | () ; state | |
1370 | () ; inputs | |
1371 | () ; outputs | |
1372 | () ; profile action (default) | |
1373 | ) | |
1374 | ; Basic integer insn unit | |
1375 | (unit u-integer "Integer Unit" () | |
1376 | 1 1 ; issue done | |
1377 | () ; state | |
1378 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1379 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
1380 | () ; profile action (default) | |
1381 | ) | |
1382 | ; Integer multiplication unit | |
1383 | (unit u-imul "Integer Multiplication Unit" () | |
1384 | 1 1 ; issue done | |
1385 | () ; state | |
1386 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1387 | ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs | |
1388 | () ; profile action (default) | |
1389 | ) | |
1390 | ; Integer division unit | |
1391 | (unit u-idiv "Integer Division Unit" () | |
1392 | 1 1 ; issue done | |
1393 | () ; state | |
1394 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1395 | ((GRk INT -1) (ICCi_1 INT -1)) ; outputs | |
1396 | () ; profile action (default) | |
1397 | ) | |
1398 | ; Branch unit | |
1399 | (unit u-branch "Branch Unit" () | |
1400 | 1 1 ; issue done | |
1401 | () ; state | |
1402 | ((GRi INT -1) (GRj INT -1) | |
1403 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
1404 | ((pc)) ; outputs | |
1405 | () ; profile action (default) | |
1406 | ) | |
1407 | ; Trap unit | |
1408 | (unit u-trap "Trap Unit" () | |
1409 | 1 1 ; issue done | |
1410 | () ; state | |
1411 | ((GRi INT -1) (GRj INT -1) | |
1412 | (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs | |
1413 | () ; outputs | |
1414 | () ; profile action (default) | |
1415 | ) | |
1416 | ; Condition code check unit | |
1417 | (unit u-check "Check Unit" () | |
1418 | 1 1 ; issue done | |
1419 | () ; state | |
1420 | ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs | |
1421 | () ; outputs | |
1422 | () ; profile action (default) | |
1423 | ) | |
1424 | ; GR set half unit | |
1425 | (unit u-set-hilo "GR Set Half" () | |
1426 | 1 1 ; issue done | |
1427 | () ; state | |
1428 | () ; inputs | |
1429 | ((GRkhi INT -1) (GRklo INT -1)) ; outputs | |
1430 | () ; profile action (default) | |
1431 | ) | |
1432 | ; GR load unit -- TODO doesn't handle quad | |
1433 | (unit u-gr-load "GR Load Unit" () | |
1434 | 1 1 ; issue done | |
1435 | () ; state | |
1436 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1437 | ((GRk INT -1) (GRdoublek INT -1)) ; outputs | |
1438 | () ; profile action (default) | |
1439 | ) | |
1440 | ; GR store unit -- TODO doesn't handle quad | |
1441 | (unit u-gr-store "GR Store Unit" () | |
1442 | 1 1 ; issue done | |
1443 | () ; state | |
1444 | ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs | |
1445 | () ; outputs | |
1446 | () ; profile action (default) | |
1447 | ) | |
1448 | ; FR load unit -- TODO doesn't handle quad | |
1449 | (unit u-fr-load "FR Load Unit" () | |
1450 | 1 1 ; issue done | |
1451 | () ; state | |
1452 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1453 | ((FRintk INT -1) (FRdoublek INT -1)) ; outputs | |
1454 | () ; profile action (default) | |
1455 | ) | |
1456 | ; FR store unit -- TODO doesn't handle quad | |
1457 | (unit u-fr-store "FR Store Unit" () | |
1458 | 1 1 ; issue done | |
1459 | () ; state | |
1460 | ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs | |
1461 | () ; outputs | |
1462 | () ; profile action (default) | |
1463 | ) | |
1464 | ; Swap unit | |
1465 | (unit u-swap "Swap Unit" () | |
1466 | 1 1 ; issue done | |
1467 | () ; state | |
1468 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1469 | ((GRk INT -1)) ; outputs | |
1470 | () ; profile action (default) | |
1471 | ) | |
1472 | ; FR Move to GR unit | |
1473 | (unit u-fr2gr "FR Move to GR Unit" () | |
1474 | 1 1 ; issue done | |
1475 | () ; state | |
1476 | ((FRintk INT -1)) ; inputs | |
1477 | ((GRj INT -1)) ; outputs | |
1478 | () ; profile action (default) | |
1479 | ) | |
1480 | ; SPR Move to GR unit | |
1481 | (unit u-spr2gr "SPR Move to GR Unit" () | |
1482 | 1 1 ; issue done | |
1483 | () ; state | |
1484 | ((spr INT -1)) ; inputs | |
1485 | ((GRj INT -1)) ; outputs | |
1486 | () ; profile action (default) | |
1487 | ) | |
1488 | ; GR Move to FR unit | |
1489 | (unit u-gr2fr "GR Move to FR Unit" () | |
1490 | 1 1 ; issue done | |
1491 | () ; state | |
1492 | ((GRj INT -1)) ; inputs | |
1493 | ((FRintk INT -1)) ; outputs | |
1494 | () ; profile action (default) | |
1495 | ) | |
1496 | ; GR Move to SPR unit | |
1497 | (unit u-gr2spr "GR Move to SPR Unit" () | |
1498 | 1 1 ; issue done | |
1499 | () ; state | |
1500 | ((GRj INT -1)) ; inputs | |
1501 | ((spr INT -1)) ; outputs | |
1502 | () ; profile action (default) | |
1503 | ) | |
1504 | ; Media unit M1 -- see table 14-8 in the fr450 LSI | |
1505 | (unit u-media-1 "Media-1 unit" () | |
1506 | 1 1 ; issue done | |
1507 | () ; state | |
1508 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1509 | ((FRintk INT -1)) ; outputs | |
1510 | () ; profile action (default) | |
1511 | ) | |
1512 | (unit u-media-1-quad "Media-1-quad unit" () | |
1513 | 1 1 ; issue done | |
1514 | () ; state | |
1515 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1516 | ((FRintk INT -1)) ; outputs | |
1517 | () ; profile action (default) | |
1518 | ) | |
1519 | (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" () | |
1520 | 1 1 ; issue done | |
1521 | () ; state | |
1522 | () ; inputs | |
1523 | ((FRkhi INT -1) (FRklo INT -1)) ; outputs | |
1524 | () ; profile action (default) | |
1525 | ) | |
1526 | ; Media unit M2 -- see table 14-8 in the fr450 LSI | |
1527 | (unit u-media-2 "Media-2 unit" () | |
1528 | 1 1 ; issue done | |
1529 | () ; state | |
1530 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1531 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
1532 | () ; profile action (default) | |
1533 | ) | |
1534 | (unit u-media-2-quad "Media-2-quad unit" () | |
1535 | 1 1 ; issue done | |
1536 | () ; state | |
1537 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1538 | ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs | |
1539 | () ; profile action (default) | |
1540 | ) | |
1541 | (unit u-media-2-acc "Media-2-acc unit" () | |
1542 | 1 1 ; issue done | |
1543 | () ; state | |
1544 | ((ACC40Si INT -1)) ; inputs | |
1545 | ((ACC40Sk INT -1)) ; outputs | |
1546 | () ; profile action (default) | |
1547 | ) | |
1548 | (unit u-media-2-acc-dual "Media-2-acc-dual unit" () | |
1549 | 1 1 ; issue done | |
1550 | () ; state | |
1551 | ((ACC40Si INT -1)) ; inputs | |
1552 | ((ACC40Sk INT -1)) ; outputs | |
1553 | () ; profile action (default) | |
1554 | ) | |
1555 | (unit u-media-2-add-sub "Media-2-add-sub unit" () | |
1556 | 1 1 ; issue done | |
1557 | () ; state | |
1558 | ((ACC40Si INT -1)) ; inputs | |
1559 | ((ACC40Sk INT -1)) ; outputs | |
1560 | () ; profile action (default) | |
1561 | ) | |
1562 | (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" () | |
1563 | 1 1 ; issue done | |
1564 | () ; state | |
1565 | ((ACC40Si INT -1)) ; inputs | |
1566 | ((ACC40Sk INT -1)) ; outputs | |
1567 | () ; profile action (default) | |
1568 | ) | |
1569 | ; Media unit M3 -- see table 14-8 in the fr450 LSI | |
1570 | (unit u-media-3 "Media-3 unit" () | |
1571 | 1 1 ; issue done | |
1572 | () ; state | |
1573 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1574 | ((FRintk INT -1)) ; outputs | |
1575 | () ; profile action (default) | |
1576 | ) | |
1577 | (unit u-media-3-dual "Media-3-dual unit" () | |
1578 | 1 1 ; issue done | |
1579 | () ; state | |
1580 | ((FRinti INT -1)) ; inputs | |
1581 | ((FRintk INT -1)) ; outputs | |
1582 | () ; profile action (default) | |
1583 | ) | |
1584 | (unit u-media-3-quad "Media-3-quad unit" () | |
1585 | 1 1 ; issue done | |
1586 | () ; state | |
1587 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1588 | ((FRintk INT -1)) ; outputs | |
1589 | () ; profile action (default) | |
1590 | ) | |
1591 | ; Media unit M4 -- see table 14-8 in the fr450 LSI | |
1592 | (unit u-media-4 "Media-4 unit" () | |
1593 | 1 1 ; issue done | |
1594 | () ; state | |
1595 | ((ACC40Si INT -1) (FRintj INT -1)) ; inputs | |
1596 | ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs | |
1597 | () ; profile action (default) | |
1598 | ) | |
1599 | (unit u-media-4-accg "Media-4-accg unit" () | |
1600 | 1 1 ; issue done | |
1601 | () ; state | |
1602 | ((ACCGi INT -1) (FRinti INT -1)) ; inputs | |
1603 | ((ACCGk INT -1) (FRintk INT -1)) ; outputs | |
1604 | () ; profile action (default) | |
1605 | ) | |
1606 | (unit u-media-4-acc-dual "Media-4-acc-dual unit" () | |
1607 | 1 1 ; issue done | |
1608 | () ; state | |
1609 | ((ACC40Si INT -1)) ; inputs | |
1610 | ((FRintk INT -1)) ; outputs | |
1611 | () ; profile action (default) | |
1612 | ) | |
1613 | (unit u-media-4-mclracca "Media-4 unit for MCLRACC with #A=1" () | |
1614 | 1 1 ; issue done | |
1615 | () ; state | |
1616 | () ; inputs | |
1617 | () ; outputs | |
1618 | () ; profile action (default) | |
1619 | ) | |
1620 | ; Media unit M6 -- see table 14-8 in the fr450 LSI | |
1621 | (unit u-media-6 "Media-6 unit" () | |
1622 | 1 1 ; issue done | |
1623 | () ; state | |
1624 | ((FRinti INT -1)) ; inputs | |
1625 | ((FRintk INT -1)) ; outputs | |
1626 | () ; profile action (default) | |
1627 | ) | |
1628 | ; Media unit M7 -- see table 14-8 in the fr450 LSI | |
1629 | (unit u-media-7 "Media-1 unit" () | |
1630 | 1 1 ; issue done | |
1631 | () ; state | |
1632 | ((FRinti INT -1) (FRintj INT -1)) ; inputs | |
1633 | ((FCCk INT -1)) ; outputs | |
1634 | () ; profile action (default) | |
1635 | ) | |
1636 | ; Media Dual Expand unit | |
1637 | (unit u-media-dual-expand "Media Dual Expand unit" () | |
1638 | 1 1 ; issue done | |
1639 | () ; state | |
1640 | ((FRinti INT -1)) ; inputs | |
1641 | ((FRintk INT -1)) ; outputs | |
1642 | () ; profile action (default) | |
1643 | ) | |
1644 | ; Media Dual half to byte unit | |
1645 | (unit u-media-dual-htob "Media Half to byte" () | |
1646 | 1 1 ; issue done | |
1647 | () ; state | |
1648 | ((FRintj INT -1)) ; inputs | |
1649 | ((FRintk INT -1)) ; outputs | |
1650 | () ; profile action (default) | |
1651 | ) | |
1652 | ; Barrier unit | |
1653 | (unit u-barrier "Barrier unit" () | |
1654 | 1 1 ; issue done | |
1655 | () ; state | |
1656 | () ; inputs | |
1657 | () ; outputs | |
1658 | () ; profile action (default) | |
1659 | ) | |
1660 | ; Memory Barrier unit | |
1661 | (unit u-membar "Memory Barrier unit" () | |
1662 | 1 1 ; issue done | |
1663 | () ; state | |
1664 | () ; inputs | |
1665 | () ; outputs | |
1666 | () ; profile action (default) | |
1667 | ) | |
1668 | ; Insn cache invalidate unit | |
1669 | (unit u-ici "Insn cache invalidate unit" () | |
1670 | 1 1 ; issue done | |
1671 | () ; state | |
1672 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1673 | () ; outputs | |
1674 | () ; profile action (default) | |
1675 | ) | |
1676 | ; Data cache invalidate unit | |
1677 | (unit u-dci "Data cache invalidate unit" () | |
1678 | 1 1 ; issue done | |
1679 | () ; state | |
1680 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1681 | () ; outputs | |
1682 | () ; profile action (default) | |
1683 | ) | |
1684 | ; Data cache flush unit | |
1685 | (unit u-dcf "Data cache flush unit" () | |
1686 | 1 1 ; issue done | |
1687 | () ; state | |
1688 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1689 | () ; outputs | |
1690 | () ; profile action (default) | |
1691 | ) | |
1692 | ; Insn cache preload unit | |
1693 | (unit u-icpl "Insn cache preload unit" () | |
1694 | 1 1 ; issue done | |
1695 | () ; state | |
1696 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1697 | () ; outputs | |
1698 | () ; profile action (default) | |
1699 | ) | |
1700 | ; Data cache preload unit | |
1701 | (unit u-dcpl "Data cache preload unit" () | |
1702 | 1 1 ; issue done | |
1703 | () ; state | |
1704 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1705 | () ; outputs | |
1706 | () ; profile action (default) | |
1707 | ) | |
1708 | ; Insn cache unlock unit | |
1709 | (unit u-icul "Insn cache unlock unit" () | |
1710 | 1 1 ; issue done | |
1711 | () ; state | |
1712 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1713 | () ; outputs | |
1714 | () ; profile action (default) | |
1715 | ) | |
1716 | ; Data cache unlock unit | |
1717 | (unit u-dcul "Data cache unlock unit" () | |
1718 | 1 1 ; issue done | |
1719 | () ; state | |
1720 | ((GRi INT -1) (GRj INT -1)) ; inputs | |
1721 | () ; outputs | |
1722 | () ; profile action (default) | |
1723 | ) | |
1724 | ) | |
1725 | \f | |
9aab5aa3 AC |
1726 | ; Simple machine - single issue integer machine |
1727 | (define-mach | |
1728 | (name simple) | |
1729 | (comment "Simple single issue integer cpu") | |
1730 | (cpu frvbf) | |
1731 | ) | |
1732 | (define-model | |
1733 | (name simple) (comment "Simple model") (attrs) | |
1734 | (mach simple) | |
1735 | (pipeline all "" () ((fetch) (decode) (execute) (writeback))) | |
1736 | ; `state' is a list of variables for recording model state | |
1737 | (state) | |
1738 | (unit u-exec "Execution Unit" () | |
1739 | 1 1 ; issue done | |
1740 | () ; state | |
1741 | () ; inputs | |
1742 | () ; outputs | |
1743 | () ; profile action (default) | |
1744 | ) | |
1745 | ) | |
1746 | \f | |
1747 | ; The instruction fetch/execute cycle. | |
1748 | ; | |
1749 | ; This is how to fetch and decode an instruction. | |
1750 | ; Leave it out for now | |
1751 | ||
1752 | ; (define-extract (const SI 0)) | |
1753 | ||
1754 | ; This is how to execute a decoded instruction. | |
1755 | ; Leave it out for now | |
1756 | ||
1757 | ; (define-execute (const SI 0)) | |
1758 | \f | |
1759 | ; An attribute to describe which unit an insn runs in. | |
1760 | (define-attr | |
1761 | (for insn) | |
1762 | (type enum) | |
1763 | (name UNIT) | |
1764 | (comment "parallel execution pipeline selection") | |
8caa9169 DB |
1765 | ; The order of declaration is significant. |
1766 | ; See the *_unit_mapping tables in frv.opc | |
1767 | ; Keep variations on the same unit together. | |
1768 | ; Keep the '01' variant immediately after the '1' variant in each unit. | |
1769 | ; Keep the 'ALL' variations immediately after the last numbered variant in each unit. | |
9aab5aa3 | 1770 | (values NIL |
ac7c07ac DB |
1771 | I0 I1 I01 I2 I3 IALL |
1772 | FM0 FM1 FM01 FM2 FM3 FMALL FMLOW | |
9aab5aa3 AC |
1773 | B0 B1 B01 |
1774 | C | |
1775 | MULT-DIV ; multiply/division slotted differently on different machines | |
cb10e79a | 1776 | IACC ; iacc multiply slotted differently on different machines |
9aab5aa3 | 1777 | LOAD ; loads slotted differently on different machines |
8caa9169 DB |
1778 | STORE ; store slotted differently on different machines |
1779 | SCAN ; scan, scani slotted differently on different machines | |
1780 | DCPL ; dcpl slotted differently on different machines | |
1781 | MDUALACC ; media dual acc slotted differently on different machines | |
676a64f4 | 1782 | MDCUTSSI ; mdcutssi insn slotted differently on different machines |
8caa9169 | 1783 | MCLRACC-1; mclracc A==1 slotted differently on different machines |
9aab5aa3 AC |
1784 | NUM_UNITS |
1785 | ) | |
1786 | ) | |
1787 | ; Attributes to describe major categories of insns | |
1788 | (define-attr | |
1789 | (for insn) | |
1790 | (type enum) | |
1791 | (name FR400-MAJOR) | |
1792 | (comment "fr400 major insn categories") | |
1793 | ; The order of declaration is significant. Keep variations on the same major | |
1794 | ; together. | |
1795 | (values NONE | |
1796 | I-1 I-2 I-3 I-4 I-5 | |
1797 | B-1 B-2 B-3 B-4 B-5 B-6 | |
1798 | C-1 C-2 | |
1799 | M-1 M-2 | |
1800 | ) | |
1801 | ) | |
676a64f4 RS |
1802 | (define-attr |
1803 | (for insn) | |
1804 | (type enum) | |
1805 | (name FR450-MAJOR) | |
1806 | (comment "fr450 major insn categories") | |
1807 | ; The order of declaration is significant. Keep variations on the same major | |
1808 | ; together. | |
1809 | (values NONE | |
1810 | I-1 I-2 I-3 I-4 I-5 | |
1811 | B-1 B-2 B-3 B-4 B-5 B-6 | |
1812 | C-1 C-2 | |
1813 | M-1 M-2 M-3 M-4 M-5 M-6 | |
1814 | ) | |
1815 | ) | |
9aab5aa3 AC |
1816 | (define-attr |
1817 | (for insn) | |
1818 | (type enum) | |
1819 | (name FR500-MAJOR) | |
1820 | (comment "fr500 major insn categories") | |
1821 | ; The order of declaration is significant. Keep variations on the same major | |
1822 | ; together. | |
1823 | (values NONE | |
1824 | I-1 I-2 I-3 I-4 I-5 I-6 | |
1825 | B-1 B-2 B-3 B-4 B-5 B-6 | |
1826 | C-1 C-2 | |
1827 | F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8 | |
1828 | M-1 M-2 M-3 M-4 M-5 M-6 M-7 M-8 | |
1829 | ) | |
1830 | ) | |
ac7c07ac DB |
1831 | (define-attr |
1832 | (for insn) | |
1833 | (type enum) | |
1834 | (name FR550-MAJOR) | |
1835 | (comment "fr550 major insn categories") | |
1836 | ; The order of declaration is significant. Keep variations on the same major | |
1837 | ; together. | |
1838 | (values NONE | |
1839 | I-1 I-2 I-3 I-4 I-5 I-6 I-7 I-8 | |
1840 | B-1 B-2 B-3 B-4 B-5 B-6 | |
1841 | C-1 C-2 | |
1842 | F-1 F-2 F-3 F-4 | |
1843 | M-1 M-2 M-3 M-4 M-5 | |
1844 | ) | |
1845 | ) | |
9aab5aa3 AC |
1846 | ; Privileged insn |
1847 | (define-attr | |
1848 | (for insn) | |
1849 | (type boolean) | |
1850 | (name PRIVILEGED) | |
1851 | (comment "insn only allowed in supervisor mode") | |
1852 | ) | |
1853 | ; Non-Excepting insn | |
1854 | (define-attr | |
1855 | (for insn) | |
1856 | (type boolean) | |
1857 | (name NON-EXCEPTING) | |
1858 | (comment "non-excepting insn") | |
1859 | ) | |
1860 | ; Conditional insn | |
1861 | (define-attr | |
1862 | (for insn) | |
1863 | (type boolean) | |
1864 | (name CONDITIONAL) | |
1865 | (comment "conditional insn") | |
1866 | ) | |
1867 | ; insn accesses FR registers | |
1868 | (define-attr | |
1869 | (for insn) | |
1870 | (type boolean) | |
1871 | (name FR-ACCESS) | |
1872 | (comment "insn accesses FR registers") | |
1873 | ) | |
1874 | ; insn preserves MSR.OVF | |
1875 | (define-attr | |
1876 | (for insn) | |
1877 | (type boolean) | |
1878 | (name PRESERVE-OVF) | |
1879 | (comment "Preserve value of MSR.OVF") | |
1880 | ) | |
676a64f4 RS |
1881 | ; "Audio" instruction provided by the fr405 but not the original fr400 core. |
1882 | (define-attr | |
1883 | (for insn) | |
1884 | (type boolean) | |
1885 | (name AUDIO) | |
1886 | (comment "Audio instruction added with FR405") | |
1887 | ) | |
6f18ad70 | 1888 | ; null attribute -- used as a place holder for where an attribue is required. |
9aab5aa3 AC |
1889 | (define-attr |
1890 | (for insn) | |
1891 | (type boolean) | |
1892 | (name NA) | |
1893 | (comment "placeholder attribute") | |
1894 | (attrs META) ; do not define in any generated file for now | |
1895 | ) | |
5b5b78da DE |
1896 | |
1897 | ; IDOC attribute for instruction documentation. | |
1898 | ||
1899 | (define-attr | |
1900 | (for insn) | |
1901 | (type enum) | |
1902 | (name IDOC) | |
1903 | (comment "insn kind for documentation") | |
1904 | (attrs META) | |
1905 | (values | |
1906 | (MEM - () "Memory") | |
1907 | (ALU - () "ALU") | |
1908 | (FPU - () "FPU") | |
1909 | (BR - () "Branch") | |
1910 | (PRIV - () "Priviledged") | |
1911 | (MISC - () "Miscellaneous") | |
1912 | ) | |
1913 | ) | |
9aab5aa3 AC |
1914 | \f |
1915 | ; Instruction fields. | |
1916 | ; | |
1917 | ; Attributes: | |
1918 | ; PCREL-ADDR: pc relative value (for reloc and disassembly purposes) | |
1919 | ; ABS-ADDR: absolute address (for reloc and disassembly purposes?) | |
1920 | ; RESERVED: bits are not used to decode insn, must be all 0 | |
1921 | (dnf f-pack "packing bit" () 31 1) | |
1922 | (dnf f-op "primary opcode" () 24 7) | |
1923 | (dnf f-ope1 "extended opcode" () 11 6) | |
1924 | (dnf f-ope2 "extended opcode" () 9 4) | |
1925 | (dnf f-ope3 "extended opcode" () 15 3) | |
1926 | (dnf f-ope4 "extended opcode" () 7 2) | |
1927 | ||
1928 | (dnf f-GRi "source register 1" () 17 6) | |
1929 | (dnf f-GRj "source register 2" () 5 6) | |
1930 | (dnf f-GRk "destination register" () 30 6) | |
1931 | ||
1932 | (dnf f-FRi "source register 1" () 17 6) | |
1933 | (dnf f-FRj "source register 2" () 5 6) | |
1934 | (dnf f-FRk "destination register" () 30 6) | |
1935 | ||
1936 | (dnf f-CPRi "source register 1" () 17 6) | |
1937 | (dnf f-CPRj "source register 2" () 5 6) | |
1938 | (dnf f-CPRk "destination register" () 30 6) | |
1939 | ||
1940 | (dnf f-ACCGi "source register" () 17 6) | |
1941 | (dnf f-ACCGk "destination register" () 30 6) | |
1942 | ||
1943 | (dnf f-ACC40Si "40 bit signed accumulator" () 17 6) | |
1944 | (dnf f-ACC40Ui "40 bit unsigned accumulator" () 17 6) | |
1945 | (dnf f-ACC40Sk "40 bit accumulator" () 30 6) | |
1946 | (dnf f-ACC40Uk "40 bit accumulator" () 30 6) | |
1947 | ||
1948 | (dnf f-CRi "source register" () 14 3) | |
1949 | (dnf f-CRj "source register" () 2 3) | |
1950 | (dnf f-CRk "destination register" () 27 3) | |
1951 | (dnf f-CCi "condition register" () 11 3) | |
1952 | ||
1953 | (df f-CRj_int "target cr for ck insns" () 26 2 UINT | |
1954 | ((value pc) (sub WI value 4)) | |
1955 | ((value pc) (add WI value 4)) | |
1956 | ) | |
1957 | (dnf f-CRj_float "target cr for fck insns" () 26 2) | |
1958 | ||
1959 | (dnf f-ICCi_1 "condition register" () 11 2) | |
1960 | (dnf f-ICCi_2 "condition register" () 26 2) | |
1961 | (dnf f-ICCi_3 "condition register" () 1 2) | |
1962 | (dnf f-FCCi_1 "condition register" () 11 2) | |
1963 | (dnf f-FCCi_2 "condition register" () 26 2) | |
1964 | (dnf f-FCCi_3 "condition register" () 1 2) | |
1965 | (dnf f-FCCk "condition register" () 26 2) | |
1966 | (dnf f-eir "exception insn register" () 17 6) | |
1967 | ||
1968 | (df f-s10 "10 bit sign extended" () 9 10 INT #f #f) | |
1969 | (df f-s12 "12 bit sign extended" () 11 12 INT #f #f) | |
1970 | (df f-d12 "12 bit sign extended" () 11 12 INT #f #f) | |
1971 | (df f-u16 "16 bit unsigned" () 15 16 UINT #f #f) | |
1972 | (df f-s16 "16 bit sign extended" () 15 16 INT #f #f) | |
1973 | (df f-s6 "6 bit signed" () 5 6 INT #f #f) | |
1974 | (df f-s6_1 "6 bit signed" () 11 6 INT #f #f) | |
1975 | (df f-u6 "6 bit unsigned" () 5 6 UINT #f #f) | |
1976 | (df f-s5 "5 bit signed" () 4 5 INT #f #f) | |
1977 | ||
1978 | (df f-u12-h "upper 6 bits of u12" () 17 6 INT #f #f) | |
1979 | (df f-u12-l "lower 6 bits of u12" () 5 6 UINT #f #f) | |
1980 | (dnmf f-u12 "12 bit signed immediate" () INT | |
1981 | (f-u12-h f-u12-l) | |
1982 | (sequence () ; insert | |
1983 | (set (ifield f-u12-h) (sra SI (ifield f-u12) 6)) | |
1984 | (set (ifield f-u12-l) (and (ifield f-u12) #x3f)) | |
1985 | ) | |
1986 | (sequence () ; extract | |
1987 | (set (ifield f-u12) (or (sll (ifield f-u12-h) 6) | |
1988 | (ifield f-u12-l))) | |
1989 | ) | |
1990 | ) | |
1991 | ||
1992 | (dnf f-int-cc "integer branch conditions" () 30 4) | |
1993 | (dnf f-flt-cc "floating branch conditions" () 30 4) | |
1994 | (df f-cond "conditional arithmetic" () 8 1 UINT #f #f) | |
1995 | (df f-ccond "lr branch condition" () 12 1 UINT #f #f) | |
1996 | (df f-hint "2 bit branch prediction hint" () 17 2 UINT #f #f) | |
1997 | (df f-LI "link indicator" () 25 1 UINT #f #f) | |
1998 | (df f-lock "cache lock indicator" () 25 1 UINT #f #f) | |
1999 | (df f-debug "debug mode indicator" () 25 1 UINT #f #f) | |
2000 | (df f-A "all accumulator bit" () 17 1 UINT #f #f) | |
2001 | (df f-ae "cache all entries indicator" () 25 1 UINT #f #f) | |
2002 | ||
2003 | (dnf f-spr-h "upper 6 bits of spr" () 30 6) | |
2004 | (dnf f-spr-l "lower 6 bits of spr" () 17 6) | |
2005 | (dnmf f-spr "special purpose register" () UINT | |
2006 | (f-spr-h f-spr-l) | |
2007 | (sequence () ; insert | |
2008 | (set (ifield f-spr-h) (srl (ifield f-spr) (const 6))) | |
2009 | (set (ifield f-spr-l) (and (ifield f-spr) (const #x3f))) | |
2010 | ) | |
2011 | (sequence () ; extract | |
2012 | (set (ifield f-spr) (or (sll (ifield f-spr-h) (const 6)) | |
2013 | (ifield f-spr-l))) | |
2014 | ) | |
2015 | ) | |
2016 | ||
2017 | (df f-label16 "18 bit pc relative signed offset" (PCREL-ADDR) 15 16 INT | |
2018 | ((value pc) (sra WI (sub WI value pc) (const 2))) | |
2019 | ((value pc) (add WI (sll WI value (const 2)) pc)) | |
2020 | ) | |
2021 | ||
2022 | (df f-labelH6 "upper 6 bits of label24" () 30 6 INT #f #f) | |
2023 | (dnf f-labelL18 "lower 18 bits of label24" () 17 18) | |
2024 | (dnmf f-label24 "26 bit signed offset" (PCREL-ADDR) INT | |
2025 | (f-labelH6 f-labelL18) | |
2026 | ; insert | |
2027 | (sequence () | |
2028 | (set (ifield f-labelH6) | |
2029 | (sra WI (sub (ifield f-label24) pc) (const 20))) | |
2030 | (set (ifield f-labelL18) | |
2031 | (and (srl (sub (ifield f-label24) pc) (const 2)) | |
2032 | (const #x3ffff))) | |
2033 | ) | |
2034 | ; extract | |
2035 | (sequence () | |
2036 | (set (ifield f-label24) | |
2037 | (add (sll (or (sll (ifield f-labelH6) (const 18)) | |
2038 | (ifield f-labelL18)) | |
2039 | (const 2)) | |
2040 | pc))) | |
2041 | ) | |
2042 | ||
676a64f4 RS |
2043 | (dnf f-LRAE "Load Real Address E flag" () 5 1) |
2044 | (dnf f-LRAD "Load Real Address D flag" () 4 1) | |
2045 | (dnf f-LRAS "Load Real Address S flag" () 3 1) | |
2046 | ||
2047 | (dnf f-TLBPRopx "TLB Probe operation number" () 28 3) | |
2048 | (dnf f-TLBPRL "TLB Probe L flag" () 25 1) | |
2049 | ||
9aab5aa3 AC |
2050 | (dnf f-ICCi_1-null "null field" (RESERVED) 11 2) |
2051 | (dnf f-ICCi_2-null "null field" (RESERVED) 26 2) | |
2052 | (dnf f-ICCi_3-null "null field" (RESERVED) 1 2) | |
2053 | (dnf f-FCCi_1-null "null field" (RESERVED) 11 2) | |
2054 | (dnf f-FCCi_2-null "null field" (RESERVED) 26 2) | |
2055 | (dnf f-FCCi_3-null "null field" (RESERVED) 1 2) | |
2056 | (dnf f-rs-null "null field" (RESERVED) 17 6) | |
2057 | (dnf f-GRi-null "null field" (RESERVED) 17 6) | |
2058 | (dnf f-GRj-null "null field" (RESERVED) 5 6) | |
2059 | (dnf f-GRk-null "null field" (RESERVED) 30 6) | |
2060 | (dnf f-FRi-null "null field" (RESERVED) 17 6) | |
2061 | (dnf f-FRj-null "null field" (RESERVED) 5 6) | |
2062 | (dnf f-ACCj-null "null field" (RESERVED) 5 6) | |
2063 | (dnf f-rd-null "null field" (RESERVED) 30 6) | |
2064 | (dnf f-cond-null "null field" (RESERVED) 30 4) | |
2065 | (dnf f-ccond-null "null field" (RESERVED) 12 1) | |
2066 | (dnf f-s12-null "null field" (RESERVED) 11 12) | |
2067 | (dnf f-label16-null "null field" (RESERVED) 15 16) | |
2068 | (dnf f-misc-null-1 "null field" (RESERVED) 30 5) | |
2069 | (dnf f-misc-null-2 "null field" (RESERVED) 11 6) | |
2070 | (dnf f-misc-null-3 "null field" (RESERVED) 11 4) | |
2071 | (dnf f-misc-null-4 "null field" (RESERVED) 17 2) | |
2072 | (dnf f-misc-null-5 "null field" (RESERVED) 17 16) | |
2073 | (dnf f-misc-null-6 "null field" (RESERVED) 30 3) | |
2074 | (dnf f-misc-null-7 "null field" (RESERVED) 17 3) | |
2075 | (dnf f-misc-null-8 "null field" (RESERVED) 5 3) | |
2076 | (dnf f-misc-null-9 "null field" (RESERVED) 5 4) | |
2077 | (dnf f-misc-null-10 "null field" (RESERVED) 16 5) | |
2078 | (dnf f-misc-null-11 "null field" (RESERVED) 5 1) | |
2079 | ||
676a64f4 RS |
2080 | (dnf f-LRA-null "null field" (RESERVED) 2 3) |
2081 | (dnf f-TLBPR-null "null field" (RESERVED) 30 2) | |
2082 | ||
9aab5aa3 AC |
2083 | (dnf f-LI-off "null field" (RESERVED) 25 1) |
2084 | (dnf f-LI-on "null field" (RESERVED) 25 1) | |
90219bd0 AO |
2085 | |
2086 | ; Relocation annotations. | |
2087 | (dsh h-reloc-ann "relocation annotation" () (register BI)) | |
2088 | (dnf f-reloc-ann "relocation annotation" () 0 0) | |
2089 | ||
2090 | (define-pmacro (dann xname xcomment xmode xparse xprint) | |
2091 | (define-operand | |
2092 | (name xname) | |
2093 | (comment xcomment) | |
2094 | (type h-reloc-ann) | |
2095 | (index f-reloc-ann) | |
2096 | (mode xmode) | |
2097 | (handlers (parse xparse) (print xprint)) | |
2098 | ) | |
2099 | ) | |
2100 | ||
9aab5aa3 AC |
2101 | \f |
2102 | ; Enums. | |
2103 | ||
2104 | ; insn-op: | |
2105 | ; FIXME: should use die macro or some such | |
2106 | (define-normal-insn-enum insn-op "insn op enums" () OP_ f-op | |
2107 | ( | |
2108 | "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" | |
2109 | "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" | |
2110 | "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" | |
2111 | "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" | |
2112 | "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F" | |
2113 | "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "5A" "5B" "5C" "5D" "5E" "5F" | |
2114 | "60" "61" "62" "63" "64" "65" "66" "67" "68" "69" "6A" "6B" "6C" "6D" "6E" "6F" | |
2115 | "70" "71" "72" "73" "74" "75" "76" "77" "78" "79" "7A" "7B" "7C" "7D" "7E" "7F" | |
2116 | ) | |
2117 | ) | |
2118 | ||
2119 | (define-normal-insn-enum insn-ope1 "insn ope enums" () OPE1_ f-ope1 | |
2120 | ( | |
2121 | "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" | |
2122 | "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" | |
2123 | "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" | |
2124 | "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" | |
2125 | ) | |
2126 | ) | |
2127 | ||
2128 | (define-normal-insn-enum insn-ope2 "insn ope enums" () OPE2_ f-ope2 | |
2129 | ( | |
2130 | "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" | |
2131 | ) | |
2132 | ) | |
2133 | ||
2134 | (define-normal-insn-enum insn-ope3 "insn ope enums" () OPE3_ f-ope3 | |
2135 | ( | |
2136 | "00" "01" "02" "03" "04" "05" "06" "07" | |
2137 | ) | |
2138 | ) | |
2139 | ||
2140 | (define-normal-insn-enum insn-ope4 "insn ope enums" () OPE4_ f-ope4 | |
2141 | ( | |
2142 | "0" "1" "2" "3" | |
2143 | ) | |
2144 | ) | |
2145 | ||
2146 | ; int-cc: integer branch conditions | |
2147 | ; FIXME: should use die macro or some such | |
2148 | (define-normal-insn-enum int-cc "integer branch cond enums" () ICC_ f-int-cc | |
2149 | ( | |
2150 | "nev" "c" "v" "lt" "eq" "ls" "n" "le" | |
2151 | "ra" "nc" "nv" "ge" "ne" "hi" "p" "gt" | |
2152 | ) | |
2153 | ) | |
2154 | ||
2155 | ; flt-cc: floating-point/media branch conditions | |
2156 | ; FIXME: should use die macro or some such | |
2157 | (define-normal-insn-enum flt-cc "float branch cond enums" () FCC_ f-flt-cc | |
2158 | ("nev" "u" "gt" "ug" "lt" "ul" "lg" "ne" | |
2159 | "eq" "ue" "ge" "uge" "le" "ule" "o" "ra") | |
2160 | ) | |
2161 | \f | |
2162 | ; Hardware pieces. | |
2163 | ; These entries list the elements of the raw hardware. | |
2164 | ; They're also used to provide tables and other elements of the assembly | |
2165 | ; language. | |
2166 | (dnh h-pc "program counter" (PC PROFILE) (pc) () () ()) | |
2167 | ||
2168 | ; The PSR. The individual fields are referenced more than the entire | |
2169 | ; register, so reference them directly. We can assemble the | |
2170 | ; entire register contents when necessary. | |
2171 | ; | |
2172 | (dsh h-psr_imple "PSR.IMPLE" () (register UQI)) | |
2173 | (dsh h-psr_ver "PSR.VER" () (register UQI)) | |
2174 | (dsh h-psr_ice "PSR.ICE bit" () (register BI)) | |
2175 | (dsh h-psr_nem "PSR.NEM bit" () (register BI)) | |
2176 | (dsh h-psr_cm "PSR.CM bit" () (register BI)) | |
2177 | (dsh h-psr_be "PSR.BE bit" () (register BI)) | |
2178 | (dsh h-psr_esr "PSR.ESR bit" () (register BI)) | |
2179 | (dsh h-psr_ef "PSR.EF bit" () (register BI)) | |
2180 | (dsh h-psr_em "PSR.EM bit" () (register BI)) | |
2181 | (dsh h-psr_pil "PSR.PIL " () (register UQI)) | |
2182 | (dsh h-psr_ps "PSR.PS bit" () (register BI)) | |
2183 | (dsh h-psr_et "PSR.ET bit" () (register BI)) | |
2184 | ||
2185 | ; PSR.S requires special handling because the shadow registers (SR0-SR4) must | |
2186 | ; be switched with GR4-GR7 when changing from user to supervisor mode or | |
2187 | ; vice-versa. | |
2188 | (define-hardware | |
2189 | (name h-psr_s) | |
2190 | (comment "PSR.S bit") | |
2191 | (attrs) | |
2192 | (type register BI) | |
2193 | (get) | |
2194 | (set (newval) (c-call VOID "@cpu@_h_psr_s_set_handler" newval)) | |
2195 | ) | |
2196 | ||
2197 | ; The TBR. The individual bits are referenced more than the entire | |
2198 | ; register, so reference them directly. We can assemble the | |
2199 | ; entire register contents when necessary. | |
2200 | ; | |
2201 | (dsh h-tbr_tba "TBR.TBA" () (register UWI)) | |
2202 | (dsh h-tbr_tt "TBR.TT" () (register UQI)) | |
2203 | ||
2204 | ; The BPSR. The individual bits are referenced more than the entire | |
2205 | ; register, so reference them directly. We can assemble the | |
2206 | ; entire register contents when necessary. | |
2207 | ; | |
2208 | (dsh h-bpsr_bs "PSR.S bit" () (register BI)) | |
2209 | (dsh h-bpsr_bet "PSR.ET bit" () (register BI)) | |
2210 | ||
2211 | ; General registers | |
2212 | ; | |
2213 | (define-keyword | |
2214 | (name gr-names) | |
2215 | (print-name h-gr) | |
2216 | (prefix "") | |
2217 | (values | |
2218 | (sp 1) (fp 2) | |
2219 | (gr0 0)(gr1 1)(gr2 2)(gr3 3)(gr4 4)(gr5 5)(gr6 6)(gr7 7) | |
2220 | (gr8 8)(gr9 9)(gr10 10)(gr11 11)(gr12 12)(gr13 13)(gr14 14)(gr15 15) | |
2221 | (gr16 16)(gr17 17)(gr18 18)(gr19 19)(gr20 20)(gr21 21)(gr22 22)(gr23 23) | |
2222 | (gr24 24)(gr25 25)(gr26 26)(gr27 27)(gr28 28)(gr29 29)(gr30 30)(gr31 31) | |
2223 | (gr32 32)(gr33 33)(gr34 34)(gr35 35)(gr36 36)(gr37 37)(gr38 38)(gr39 39) | |
2224 | (gr40 40)(gr41 41)(gr42 42)(gr43 43)(gr44 44)(gr45 45)(gr46 46)(gr47 47) | |
2225 | (gr48 48)(gr49 49)(gr50 50)(gr51 51)(gr52 52)(gr53 53)(gr54 54)(gr55 55) | |
2226 | (gr56 56)(gr57 57)(gr58 58)(gr59 59)(gr60 60)(gr61 61)(gr62 62)(gr63 63) | |
2227 | ) | |
2228 | ) | |
2229 | ||
2230 | (define-hardware | |
2231 | (name h-gr) | |
2232 | (comment "general registers") | |
2233 | (attrs PROFILE) | |
2234 | (type register USI (64)) | |
2235 | (indices extern-keyword gr-names) | |
2236 | (get (index) (c-call WI "@cpu@_h_gr_get_handler" index)) | |
2237 | (set (index newval) (c-call VOID "@cpu@_h_gr_set_handler" index newval)) | |
2238 | ) | |
2239 | ||
2240 | ; General Registers as double words | |
2241 | ; These registers are shadowed onto h-gr | |
2242 | (define-hardware | |
2243 | (name h-gr_double) | |
2244 | (comment "general registers as double words") | |
2245 | (attrs PROFILE VIRTUAL) | |
2246 | (type register DI (32)) | |
2247 | ; FIXME: Need constraint to prohibit odd numbers. | |
2248 | (indices extern-keyword gr-names) | |
2249 | (get (index) | |
2250 | (c-call DI "@cpu@_h_gr_double_get_handler" index)) | |
2251 | (set (index newval) | |
2252 | (c-call VOID "@cpu@_h_gr_double_set_handler" index newval)) | |
2253 | ) | |
2254 | ||
2255 | ; General Registers as high and low half words | |
2256 | ; These registers are shadowed onto h-gr | |
2257 | (define-hardware | |
2258 | (name h-gr_hi) | |
2259 | (comment "general registers as high half word") | |
2260 | (attrs PROFILE VIRTUAL) | |
2261 | (type register UHI (64)) | |
2262 | (indices extern-keyword gr-names) | |
2263 | (get (index) (c-call UHI "@cpu@_h_gr_hi_get_handler" index)) | |
2264 | (set (index newval) (c-call VOID "@cpu@_h_gr_hi_set_handler" index newval)) | |
2265 | ) | |
2266 | (define-hardware | |
2267 | (name h-gr_lo) | |
2268 | (comment "general registers as low half word") | |
2269 | (attrs PROFILE VIRTUAL) | |
2270 | (type register UHI (64)) | |
2271 | (indices extern-keyword gr-names) | |
2272 | (get (index) (c-call UHI "@cpu@_h_gr_lo_get_handler" index)) | |
2273 | (set (index newval) (c-call VOID "@cpu@_h_gr_lo_set_handler" index newval)) | |
2274 | ) | |
2275 | ||
2276 | ; Floating Point Registers | |
2277 | (define-keyword | |
2278 | (name fr-names) | |
2279 | (print-name h-fr) | |
2280 | (prefix "") | |
2281 | (values | |
2282 | (fr0 0)(fr1 1)(fr2 2)(fr3 3)(fr4 4)(fr5 5)(fr6 6)(fr7 7) | |
2283 | (fr8 8)(fr9 9)(fr10 10)(fr11 11)(fr12 12)(fr13 13)(fr14 14)(fr15 15) | |
2284 | (fr16 16)(fr17 17)(fr18 18)(fr19 19)(fr20 20)(fr21 21)(fr22 22)(fr23 23) | |
2285 | (fr24 24)(fr25 25)(fr26 26)(fr27 27)(fr28 28)(fr29 29)(fr30 30)(fr31 31) | |
2286 | (fr32 32)(fr33 33)(fr34 34)(fr35 35)(fr36 36)(fr37 37)(fr38 38)(fr39 39) | |
2287 | (fr40 40)(fr41 41)(fr42 42)(fr43 43)(fr44 44)(fr45 45)(fr46 46)(fr47 47) | |
2288 | (fr48 48)(fr49 49)(fr50 50)(fr51 51)(fr52 52)(fr53 53)(fr54 54)(fr55 55) | |
2289 | (fr56 56)(fr57 57)(fr58 58)(fr59 59)(fr60 60)(fr61 61)(fr62 62)(fr63 63) | |
2290 | ) | |
2291 | ) | |
2292 | ||
2293 | (define-hardware | |
2294 | (name h-fr) | |
2295 | (comment "floating point registers") | |
2296 | (attrs PROFILE) | |
2297 | (type register SF (64)) | |
2298 | (indices extern-keyword fr-names) | |
2299 | (get (index) (c-call SF "@cpu@_h_fr_get_handler" index)) | |
2300 | (set (index newval) (c-call VOID "@cpu@_h_fr_set_handler" index newval)) | |
2301 | ) | |
2302 | ||
2303 | ; Floating Point Registers as double precision | |
2304 | ; These registers are shadowed onto h-fr | |
2305 | ||
2306 | (define-hardware | |
2307 | (name h-fr_double) | |
2308 | (comment "floating point registers as double precision") | |
2309 | (attrs PROFILE VIRTUAL) | |
2310 | (type register DF (32)) | |
2311 | ; FIXME: Need constraint to prohibit odd numbers. | |
2312 | (indices extern-keyword fr-names) | |
2313 | (get (index) | |
2314 | (c-call DF "@cpu@_h_fr_double_get_handler" index)) | |
2315 | (set (index newval) | |
2316 | (c-call VOID "@cpu@_h_fr_double_set_handler" index newval)) | |
2317 | ) | |
2318 | ||
2319 | ; Floating Point Registers as integer words. | |
2320 | ; These registers are shadowed onto h-fr | |
2321 | ||
2322 | (define-hardware | |
2323 | (name h-fr_int) | |
2324 | (comment "floating point registers as integers") | |
2325 | (attrs PROFILE VIRTUAL) | |
2326 | (type register USI (64)) | |
2327 | (indices extern-keyword fr-names) | |
2328 | (get (index) | |
2329 | (c-call USI "@cpu@_h_fr_int_get_handler" index)) | |
2330 | (set (index newval) | |
2331 | (c-call VOID "@cpu@_h_fr_int_set_handler" index newval)) | |
2332 | ) | |
2333 | ||
2334 | ; Floating Point Registers as high and low half words | |
2335 | ; These registers are shadowed onto h-fr | |
2336 | (define-hardware | |
2337 | (name h-fr_hi) | |
2338 | (comment "floating point registers as unsigned high half word") | |
2339 | (attrs PROFILE VIRTUAL) | |
2340 | (type register UHI (64)) | |
2341 | (indices extern-keyword fr-names) | |
2342 | (get (regno) (srl (reg h-fr_int regno) 16)) | |
2343 | (set (regno newval) (set (reg h-fr_int regno) | |
2344 | (or (and (reg h-fr_int regno) #xffff) | |
2345 | (sll newval 16)))) | |
2346 | ) | |
2347 | (define-hardware | |
2348 | (name h-fr_lo) | |
2349 | (comment "floating point registers as unsigned low half word") | |
2350 | (attrs PROFILE VIRTUAL) | |
2351 | (type register UHI (64)) | |
2352 | (indices extern-keyword fr-names) | |
2353 | (get (regno) (and (reg h-fr_int regno) #xffff)) | |
2354 | (set (regno newval) (set (reg h-fr_int regno) | |
2355 | (or (and (reg h-fr_int regno) #xffff0000) | |
2356 | (and newval #xffff)))) | |
2357 | ) | |
2358 | ||
2359 | ; Floating Point Registers as unsigned bytes | |
2360 | ; These registers are shadowed onto h-fr | |
2361 | (define-hardware | |
2362 | (name h-fr_0) | |
2363 | (comment "floating point registers as unsigned byte 0") | |
2364 | (attrs PROFILE VIRTUAL) | |
2365 | (type register UHI (64)) | |
2366 | (indices extern-keyword fr-names) | |
2367 | (get (regno) (and (reg h-fr_int regno) #xff)) | |
2368 | (set (regno newval) | |
2369 | (sequence () | |
2370 | (if (gt USI newval #xff) | |
2371 | (set newval #xff)) | |
2372 | (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffffff00) | |
2373 | newval)))) | |
2374 | ) | |
2375 | (define-hardware | |
2376 | (name h-fr_1) | |
2377 | (comment "floating point registers as unsigned byte 1") | |
2378 | (attrs PROFILE VIRTUAL) | |
2379 | (type register UHI (64)) | |
2380 | (indices extern-keyword fr-names) | |
2381 | (get (regno) (and (srl (reg h-fr_int regno) 8) #xff)) | |
2382 | (set (regno newval) | |
2383 | (sequence () | |
2384 | (if (gt USI newval #xff) | |
2385 | (set newval #xff)) | |
2386 | (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffff00ff) | |
2387 | (sll newval 8))))) | |
2388 | ) | |
2389 | (define-hardware | |
2390 | (name h-fr_2) | |
2391 | (comment "floating point registers as unsigned byte 2") | |
2392 | (attrs PROFILE VIRTUAL) | |
2393 | (type register UHI (64)) | |
2394 | (indices extern-keyword fr-names) | |
2395 | (get (regno) (and (srl (reg h-fr_int regno) 16) #xff)) | |
2396 | (set (regno newval) | |
2397 | (sequence () | |
2398 | (if (gt USI newval #xff) | |
2399 | (set newval #xff)) | |
2400 | (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xff00ffff) | |
2401 | (sll newval 16))))) | |
2402 | ) | |
2403 | (define-hardware | |
2404 | (name h-fr_3) | |
2405 | (comment "floating point registers as unsigned byte 3") | |
2406 | (attrs PROFILE VIRTUAL) | |
2407 | (type register UHI (64)) | |
2408 | (indices extern-keyword fr-names) | |
2409 | (get (regno) (and (srl (reg h-fr_int regno) 24) #xff)) | |
2410 | (set (regno newval) | |
2411 | (sequence () | |
2412 | (if (gt USI newval #xff) | |
2413 | (set newval #xff)) | |
2414 | (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #x00ffffff) | |
2415 | (sll newval 24))))) | |
2416 | ) | |
2417 | ; Coprocessor Registers | |
2418 | ; | |
2419 | (define-keyword | |
2420 | (name cpr-names) | |
2421 | (print-name h-cpr) | |
2422 | (prefix "") | |
2423 | (values | |
2424 | (cpr0 0)(cpr1 1)(cpr2 2)(cpr3 3)(cpr4 4)(cpr5 5)(cpr6 6)(cpr7 7) | |
2425 | (cpr8 8)(cpr9 9)(cpr10 10)(cpr11 11)(cpr12 12)(cpr13 13)(cpr14 14)(cpr15 15) | |
2426 | (cpr16 16)(cpr17 17)(cpr18 18)(cpr19 19)(cpr20 20)(cpr21 21)(cpr22 22)(cpr23 23) | |
2427 | (cpr24 24)(cpr25 25)(cpr26 26)(cpr27 27)(cpr28 28)(cpr29 29)(cpr30 30)(cpr31 31) | |
2428 | (cpr32 32)(cpr33 33)(cpr34 34)(cpr35 35)(cpr36 36)(cpr37 37)(cpr38 38)(cpr39 39) | |
2429 | (cpr40 40)(cpr41 41)(cpr42 42)(cpr43 43)(cpr44 44)(cpr45 45)(cpr46 46)(cpr47 47) | |
2430 | (cpr48 48)(cpr49 49)(cpr50 50)(cpr51 51)(cpr52 52)(cpr53 53)(cpr54 54)(cpr55 55) | |
2431 | (cpr56 56)(cpr57 57)(cpr58 58)(cpr59 59)(cpr60 60)(cpr61 61)(cpr62 62)(cpr63 63) | |
2432 | ) | |
2433 | ) | |
2434 | ||
2435 | (define-hardware | |
2436 | (name h-cpr) | |
2437 | (comment "coprocessor registers") | |
2438 | (attrs PROFILE (MACH frv)) | |
2439 | (type register WI (64)) | |
2440 | (indices extern-keyword cpr-names) | |
2441 | ) | |
2442 | ||
2443 | ; Coprocessor Registers as double words | |
2444 | ; These registers are shadowed onto h-cpr | |
2445 | (define-hardware | |
2446 | (name h-cpr_double) | |
2447 | (comment "coprocessor registers as double words") | |
2448 | (attrs PROFILE VIRTUAL (MACH frv)) | |
2449 | (type register DI (32)) | |
2450 | ; FIXME: Need constraint to prohibit odd numbers. | |
2451 | (indices extern-keyword cpr-names) | |
2452 | (get (index) | |
2453 | (c-call DI "@cpu@_h_cpr_double_get_handler" index)) | |
2454 | (set (index newval) | |
2455 | (c-call VOID "@cpu@_h_cpr_double_set_handler" index newval)) | |
2456 | ) | |
2457 | ||
2458 | ; Special Purpose Registers | |
2459 | ; | |
2460 | (define-keyword | |
2461 | (name spr-names) | |
2462 | (print-name h-spr) | |
2463 | (prefix "") | |
2464 | (values | |
2465 | (psr 0) (pcsr 1) (bpcsr 2) (tbr 3) (bpsr 4) | |
2466 | ||
2467 | (hsr0 16) (hsr1 17) (hsr2 18) (hsr3 19) | |
2468 | (hsr4 20) (hsr5 21) (hsr6 22) (hsr7 23) | |
2469 | (hsr8 24) (hsr9 25) (hsr10 26) (hsr11 27) | |
2470 | (hsr12 28) (hsr13 29) (hsr14 30) (hsr15 31) | |
2471 | (hsr16 32) (hsr17 33) (hsr18 34) (hsr19 35) | |
2472 | (hsr20 36) (hsr21 37) (hsr22 38) (hsr23 39) | |
2473 | (hsr24 40) (hsr25 41) (hsr26 42) (hsr27 43) | |
2474 | (hsr28 44) (hsr29 45) (hsr30 46) (hsr31 47) | |
2475 | (hsr32 48) (hsr33 49) (hsr34 50) (hsr35 51) | |
2476 | (hsr36 52) (hsr37 53) (hsr38 54) (hsr39 55) | |
2477 | (hsr40 56) (hsr41 57) (hsr42 58) (hsr43 59) | |
2478 | (hsr44 60) (hsr45 61) (hsr46 62) (hsr47 63) | |
2479 | (hsr48 64) (hsr49 65) (hsr50 66) (hsr51 67) | |
2480 | (hsr52 68) (hsr53 69) (hsr54 70) (hsr55 71) | |
2481 | (hsr56 72) (hsr57 73) (hsr58 74) (hsr59 75) | |
2482 | (hsr60 76) (hsr61 77) (hsr62 78) (hsr63 79) | |
2483 | ||
ac7c07ac | 2484 | (ccr 256) (cccr 263) (lr 272) (lcr 273) (iacc0h 280) (iacc0l 281) (isr 288) |
9aab5aa3 AC |
2485 | |
2486 | (neear0 352) (neear1 353) (neear2 354) (neear3 355) | |
2487 | (neear4 356) (neear5 357) (neear6 358) (neear7 359) | |
2488 | (neear8 360) (neear9 361) (neear10 362) (neear11 363) | |
2489 | (neear12 364) (neear13 365) (neear14 366) (neear15 367) | |
2490 | (neear16 368) (neear17 369) (neear18 370) (neear19 371) | |
2491 | (neear20 372) (neear21 373) (neear22 374) (neear23 375) | |
2492 | (neear24 376) (neear25 377) (neear26 378) (neear27 379) | |
2493 | (neear28 380) (neear29 381) (neear30 382) (neear31 383) | |
2494 | ||
2495 | (nesr0 384) (nesr1 385) (nesr2 386) (nesr3 387) | |
2496 | (nesr4 388) (nesr5 389) (nesr6 390) (nesr7 391) | |
2497 | (nesr8 392) (nesr9 393) (nesr10 394) (nesr11 395) | |
2498 | (nesr12 396) (nesr13 397) (nesr14 398) (nesr15 399) | |
2499 | (nesr16 400) (nesr17 401) (nesr18 402) (nesr19 403) | |
2500 | (nesr20 404) (nesr21 405) (nesr22 406) (nesr23 407) | |
2501 | (nesr24 408) (nesr25 409) (nesr26 410) (nesr27 411) | |
2502 | (nesr28 412) (nesr29 413) (nesr30 414) (nesr31 415) | |
2503 | ||
2504 | (necr 416) | |
2505 | ||
2506 | (gner0 432) (gner1 433) | |
2507 | ||
2508 | (fner0 434) (fner1 435) | |
2509 | ||
2510 | (epcr0 512) (epcr1 513) (epcr2 514) (epcr3 515) | |
2511 | (epcr4 516) (epcr5 517) (epcr6 518) (epcr7 519) | |
2512 | (epcr8 520) (epcr9 521) (epcr10 522) (epcr11 523) | |
2513 | (epcr12 524) (epcr13 525) (epcr14 526) (epcr15 527) | |
2514 | (epcr16 528) (epcr17 529) (epcr18 530) (epcr19 531) | |
2515 | (epcr20 532) (epcr21 533) (epcr22 534) (epcr23 535) | |
2516 | (epcr24 536) (epcr25 537) (epcr26 538) (epcr27 539) | |
2517 | (epcr28 540) (epcr29 541) (epcr30 542) (epcr31 543) | |
2518 | (epcr32 544) (epcr33 545) (epcr34 546) (epcr35 547) | |
2519 | (epcr36 548) (epcr37 549) (epcr38 550) (epcr39 551) | |
2520 | (epcr40 552) (epcr41 553) (epcr42 554) (epcr43 555) | |
2521 | (epcr44 556) (epcr45 557) (epcr46 558) (epcr47 559) | |
2522 | (epcr48 560) (epcr49 561) (epcr50 562) (epcr51 563) | |
2523 | (epcr52 564) (epcr53 565) (epcr54 566) (epcr55 567) | |
2524 | (epcr56 568) (epcr57 569) (epcr58 570) (epcr59 571) | |
2525 | (epcr60 572) (epcr61 573) (epcr62 574) (epcr63 575) | |
2526 | ||
2527 | (esr0 576) (esr1 577) (esr2 578) (esr3 579) | |
2528 | (esr4 580) (esr5 581) (esr6 582) (esr7 583) | |
2529 | (esr8 584) (esr9 585) (esr10 586) (esr11 587) | |
2530 | (esr12 588) (esr13 589) (esr14 590) (esr15 591) | |
2531 | (esr16 592) (esr17 593) (esr18 594) (esr19 595) | |
2532 | (esr20 596) (esr21 597) (esr22 598) (esr23 599) | |
2533 | (esr24 600) (esr25 601) (esr26 602) (esr27 603) | |
2534 | (esr28 604) (esr29 605) (esr30 606) (esr31 607) | |
2535 | (esr32 608) (esr33 609) (esr34 610) (esr35 611) | |
2536 | (esr36 612) (esr37 613) (esr38 614) (esr39 615) | |
2537 | (esr40 616) (esr41 617) (esr42 618) (esr43 619) | |
2538 | (esr44 620) (esr45 621) (esr46 622) (esr47 623) | |
2539 | (esr48 624) (esr49 625) (esr50 626) (esr51 627) | |
2540 | (esr52 628) (esr53 629) (esr54 630) (esr55 631) | |
2541 | (esr56 632) (esr57 633) (esr58 634) (esr59 635) | |
2542 | (esr60 636) (esr61 637) (esr62 638) (esr63 639) | |
2543 | ||
2544 | (eir0 640) (eir1 641) (eir2 642) (eir3 643) | |
2545 | (eir4 644) (eir5 645) (eir6 646) (eir7 647) | |
2546 | (eir8 648) (eir9 649) (eir10 650) (eir11 651) | |
2547 | (eir12 652) (eir13 653) (eir14 654) (eir15 655) | |
2548 | (eir16 656) (eir17 657) (eir18 658) (eir19 659) | |
2549 | (eir20 660) (eir21 661) (eir22 662) (eir23 663) | |
2550 | (eir24 664) (eir25 665) (eir26 666) (eir27 667) | |
2551 | (eir28 668) (eir29 669) (eir30 670) (eir31 671) | |
2552 | ||
2553 | (esfr0 672) (esfr1 673) | |
2554 | ||
2555 | (sr0 768) (sr1 769) (sr2 770) (sr3 771) | |
2556 | ||
676a64f4 RS |
2557 | (scr0 832) (scr1 833) (scr2 834) (scr3 835) |
2558 | ||
9aab5aa3 AC |
2559 | (fsr0 1024) (fsr1 1025) (fsr2 1026) (fsr3 1027) |
2560 | (fsr4 1028) (fsr5 1029) (fsr6 1030) (fsr7 1031) | |
2561 | (fsr8 1032) (fsr9 1033) (fsr10 1034) (fsr11 1035) | |
2562 | (fsr12 1036) (fsr13 1037) (fsr14 1038) (fsr15 1039) | |
2563 | (fsr16 1040) (fsr17 1041) (fsr18 1042) (fsr19 1043) | |
2564 | (fsr20 1044) (fsr21 1045) (fsr22 1046) (fsr23 1047) | |
2565 | (fsr24 1048) (fsr25 1049) (fsr26 1050) (fsr27 1051) | |
2566 | (fsr28 1052) (fsr29 1053) (fsr30 1054) (fsr31 1055) | |
2567 | (fsr32 1056) (fsr33 1057) (fsr34 1058) (fsr35 1059) | |
2568 | (fsr36 1060) (fsr37 1061) (fsr38 1062) (fsr39 1063) | |
2569 | (fsr40 1064) (fsr41 1065) (fsr42 1066) (fsr43 1067) | |
2570 | (fsr44 1068) (fsr45 1069) (fsr46 1070) (fsr47 1071) | |
2571 | (fsr48 1072) (fsr49 1073) (fsr50 1074) (fsr51 1075) | |
2572 | (fsr52 1076) (fsr53 1077) (fsr54 1078) (fsr55 1079) | |
2573 | (fsr56 1080) (fsr57 1081) (fsr58 1082) (fsr59 1083) | |
2574 | (fsr60 1084) (fsr61 1085) (fsr62 1086) (fsr63 1087) | |
2575 | ||
2576 | ; FQ0-FQ31 are 64 bit registers. | |
2577 | ; These names allow access to the upper 32 bits of the FQ registers. | |
2578 | (fqop0 1088) (fqop1 1090) (fqop2 1092) (fqop3 1094) | |
2579 | (fqop4 1096) (fqop5 1098) (fqop6 1100) (fqop7 1102) | |
2580 | (fqop8 1104) (fqop9 1106) (fqop10 1108) (fqop11 1110) | |
2581 | (fqop12 1112) (fqop13 1114) (fqop14 1116) (fqop15 1118) | |
2582 | (fqop16 1120) (fqop17 1122) (fqop18 1124) (fqop19 1126) | |
2583 | (fqop20 1128) (fqop21 1130) (fqop22 1132) (fqop23 1134) | |
2584 | (fqop24 1136) (fqop25 1138) (fqop26 1140) (fqop27 1142) | |
2585 | (fqop28 1144) (fqop29 1146) (fqop30 1148) (fqop31 1150) | |
2586 | ; These names allow access to the lower 32 bits of the FQ registers. | |
2587 | (fqst0 1089) (fqst1 1091) (fqst2 1093) (fqst3 1095) | |
2588 | (fqst4 1097) (fqst5 1099) (fqst6 1101) (fqst7 1103) | |
2589 | (fqst8 1105) (fqst9 1107) (fqst10 1109) (fqst11 1111) | |
2590 | (fqst12 1113) (fqst13 1115) (fqst14 1117) (fqst15 1119) | |
2591 | (fqst16 1121) (fqst17 1123) (fqst18 1125) (fqst19 1127) | |
2592 | (fqst20 1129) (fqst21 1131) (fqst22 1133) (fqst23 1135) | |
2593 | (fqst24 1137) (fqst25 1139) (fqst26 1141) (fqst27 1143) | |
2594 | (fqst28 1145) (fqst29 1147) (fqst30 1149) (fqst31 1151) | |
2595 | ; These also access the lower 32 bits of the FQ registers. | |
2596 | ; These are not accessible as spr registers (see LSI appendix - section 13.4) | |
2597 | ; (fq0 1089) (fq1 1091) (fq2 1093) (fq3 1095) | |
2598 | ; (fq4 1097) (fq5 1099) (fq6 1101) (fq7 1103) | |
2599 | ; (fq8 1105) (fq9 1107) (fq10 1109) (fq11 1111) | |
2600 | ; (fq12 1113) (fq13 1115) (fq14 1117) (fq15 1119) | |
2601 | ; (fq16 1121) (fq17 1123) (fq18 1125) (fq19 1127) | |
2602 | ; (fq20 1129) (fq21 1131) (fq22 1133) (fq23 1135) | |
2603 | ; (fq24 1137) (fq25 1139) (fq26 1141) (fq27 1143) | |
2604 | ; (fq28 1145) (fq29 1147) (fq30 1149) (fq31 1151) | |
2605 | ||
2606 | (mcilr0 1272) (mcilr1 1273) | |
2607 | ||
2608 | (msr0 1280) (msr1 1281) (msr2 1282) (msr3 1283) | |
2609 | (msr4 1284) (msr5 1285) (msr6 1286) (msr7 1287) | |
2610 | (msr8 1288) (msr9 1289) (msr10 1290) (msr11 1291) | |
2611 | (msr12 1292) (msr13 1293) (msr14 1294) (msr15 1295) | |
2612 | (msr16 1296) (msr17 1297) (msr18 1298) (msr19 1299) | |
2613 | (msr20 1300) (msr21 1301) (msr22 1302) (msr23 1303) | |
2614 | (msr24 1304) (msr25 1305) (msr26 1306) (msr27 1307) | |
2615 | (msr28 1308) (msr29 1309) (msr30 1310) (msr31 1311) | |
2616 | (msr32 1312) (msr33 1313) (msr34 1314) (msr35 1315) | |
2617 | (msr36 1316) (msr37 1317) (msr38 1318) (msr39 1319) | |
2618 | (msr40 1320) (msr41 1321) (msr42 1322) (msr43 1323) | |
2619 | (msr44 1324) (msr45 1325) (msr46 1326) (msr47 1327) | |
2620 | (msr48 1328) (msr49 1329) (msr50 1330) (msr51 1331) | |
2621 | (msr52 1332) (msr53 1333) (msr54 1334) (msr55 1335) | |
2622 | (msr56 1336) (msr57 1337) (msr58 1338) (msr59 1339) | |
2623 | (msr60 1340) (msr61 1341) (msr62 1342) (msr63 1343) | |
2624 | ||
2625 | ; MQ0-MQ31 are 64 bit registers. | |
2626 | ; These names allow access to the upper 32 bits of the MQ registers. | |
2627 | (mqop0 1344) (mqop1 1346) (mqop2 1348) (mqop3 1350) | |
2628 | (mqop4 1352) (mqop5 1354) (mqop6 1356) (mqop7 1358) | |
2629 | (mqop8 1360) (mqop9 1362) (mqop10 1364) (mqop11 1366) | |
2630 | (mqop12 1368) (mqop13 1370) (mqop14 1372) (mqop15 1374) | |
2631 | (mqop16 1376) (mqop17 1378) (mqop18 1380) (mqop19 1382) | |
2632 | (mqop20 1384) (mqop21 1386) (mqop22 1388) (mqop23 1390) | |
2633 | (mqop24 1392) (mqop25 1394) (mqop26 1396) (mqop27 1398) | |
2634 | (mqop28 1400) (mqop29 1402) (mqop30 1404) (mqop31 1406) | |
2635 | ; These names allow access to the lower 32 bits of the MQ registers. | |
2636 | (mqst0 1345) (mqst1 1347) (mqst2 1349) (mqst3 1351) | |
2637 | (mqst4 1353) (mqst5 1355) (mqst6 1357) (mqst7 1359) | |
2638 | (mqst8 1361) (mqst9 1363) (mqst10 1365) (mqst11 1367) | |
2639 | (mqst12 1369) (mqst13 1371) (mqst14 1373) (mqst15 1375) | |
2640 | (mqst16 1377) (mqst17 1379) (mqst18 1381) (mqst19 1383) | |
2641 | (mqst20 1385) (mqst21 1387) (mqst22 1389) (mqst23 1391) | |
2642 | (mqst24 1393) (mqst25 1395) (mqst26 1397) (mqst27 1399) | |
2643 | (mqst28 1401) (mqst29 1403) (mqst30 1405) (mqst31 1407) | |
2644 | ; These also access the lower 32 bits of the MQ registers. | |
2645 | ; These are not accessible as spr registers (see LSI appendix - section 13.4) | |
2646 | ; (mq0 1345) (mq1 1347) (mq2 1349) (mq3 1351) | |
2647 | ; (mq4 1353) (mq5 1355) (mq6 1357) (mq7 1359) | |
2648 | ; (mq8 1361) (mq9 1363) (mq10 1365) (mq11 1367) | |
2649 | ; (mq12 1369) (mq13 1371) (mq14 1373) (mq15 1375) | |
2650 | ; (mq16 1377) (mq17 1379) (mq18 1381) (mq19 1383) | |
2651 | ; (mq20 1385) (mq21 1387) (mq22 1389) (mq23 1391) | |
2652 | ; (mq24 1393) (mq25 1395) (mq26 1397) (mq27 1399) | |
2653 | ; (mq28 1401) (mq29 1403) (mq30 1405) (mq31 1407) | |
2654 | ||
2655 | ; These are not accessible as spr registers (see LSI appendix - section 13.4) | |
2656 | ; (acc0 1408) (acc1 1409) (acc2 1410) (acc3 1411) | |
2657 | ; (acc4 1412) (acc5 1413) (acc6 1414) (acc7 1415) | |
2658 | ; (acc8 1416) (acc9 1417) (acc10 1418) (acc11 1419) | |
2659 | ; (acc12 1420) (acc13 1421) (acc14 1422) (acc15 1423) | |
2660 | ; (acc16 1424) (acc17 1425) (acc18 1426) (acc19 1427) | |
2661 | ; (acc20 1428) (acc21 1429) (acc22 1430) (acc23 1431) | |
2662 | ; (acc24 1432) (acc25 1433) (acc26 1434) (acc27 1435) | |
2663 | ; (acc28 1436) (acc29 1437) (acc30 1438) (acc31 1439) | |
2664 | ; (acc32 1440) (acc33 1441) (acc34 1442) (acc35 1443) | |
2665 | ; (acc36 1444) (acc37 1445) (acc38 1446) (acc39 1447) | |
2666 | ; (acc40 1448) (acc41 1449) (acc42 1450) (acc43 1451) | |
2667 | ; (acc44 1452) (acc45 1453) (acc46 1454) (acc47 1455) | |
2668 | ; (acc48 1456) (acc49 1457) (acc50 1458) (acc51 1459) | |
2669 | ; (acc52 1460) (acc53 1461) (acc54 1462) (acc55 1463) | |
2670 | ; (acc56 1464) (acc57 1465) (acc58 1466) (acc59 1467) | |
2671 | ; (acc60 1468) (acc61 1469) (acc62 1470) (acc63 1471) | |
2672 | ||
2673 | ; (accg0 1472) (accg1 1473) (accg2 1474) (accg3 1475) | |
2674 | ; (accg4 1476) (accg5 1477) (accg6 1478) (accg7 1479) | |
2675 | ; (accg8 1480) (accg9 1481) (accg10 1482) (accg11 1483) | |
2676 | ; (accg12 1484) (accg13 1485) (accg14 1486) (accg15 1487) | |
2677 | ; (accg16 1488) (accg17 1489) (accg18 1490) (accg19 1491) | |
2678 | ; (accg20 1492) (accg21 1493) (accg22 1494) (accg23 1495) | |
2679 | ; (accg24 1496) (accg25 1497) (accg26 1498) (accg27 1499) | |
2680 | ; (accg28 1500) (accg29 1501) (accg30 1502) (accg31 1503) | |
2681 | ; (accg32 1504) (accg33 1505) (accg34 1506) (accg35 1507) | |
2682 | ; (accg36 1508) (accg37 1509) (accg38 1510) (accg39 1511) | |
2683 | ; (accg40 1512) (accg41 1513) (accg42 1514) (accg43 1515) | |
2684 | ; (accg44 1516) (accg45 1517) (accg46 1518) (accg47 1519) | |
2685 | ; (accg48 1520) (accg49 1521) (accg50 1522) (accg51 1523) | |
2686 | ; (accg52 1524) (accg53 1525) (accg54 1526) (accg55 1527) | |
2687 | ; (accg56 1528) (accg57 1529) (accg58 1530) (accg59 1531) | |
2688 | ; (accg60 1532) (accg61 1533) (accg62 1534) (accg63 1535) | |
2689 | ||
2690 | (ear0 1536) (ear1 1537) (ear2 1538) (ear3 1539) | |
2691 | (ear4 1540) (ear5 1541) (ear6 1542) (ear7 1543) | |
2692 | (ear8 1544) (ear9 1545) (ear10 1546) (ear11 1547) | |
2693 | (ear12 1548) (ear13 1549) (ear14 1550) (ear15 1551) | |
2694 | (ear16 1552) (ear17 1553) (ear18 1554) (ear19 1555) | |
2695 | (ear20 1556) (ear21 1557) (ear22 1558) (ear23 1559) | |
2696 | (ear24 1560) (ear25 1561) (ear26 1562) (ear27 1563) | |
2697 | (ear28 1564) (ear29 1565) (ear30 1566) (ear31 1567) | |
2698 | (ear32 1568) (ear33 1569) (ear34 1570) (ear35 1571) | |
2699 | (ear36 1572) (ear37 1573) (ear38 1574) (ear39 1575) | |
2700 | (ear40 1576) (ear41 1577) (ear42 1578) (ear43 1579) | |
2701 | (ear44 1580) (ear45 1581) (ear46 1582) (ear47 1583) | |
2702 | (ear48 1584) (ear49 1585) (ear50 1586) (ear51 1587) | |
2703 | (ear52 1588) (ear53 1589) (ear54 1590) (ear55 1591) | |
2704 | (ear56 1592) (ear57 1593) (ear58 1594) (ear59 1595) | |
2705 | (ear60 1596) (ear61 1597) (ear62 1598) (ear63 1599) | |
2706 | ||
2707 | (edr0 1600) (edr1 1601) (edr2 1602) (edr3 1603) | |
2708 | (edr4 1604) (edr5 1605) (edr6 1606) (edr7 1607) | |
2709 | (edr8 1608) (edr9 1609) (edr10 1610) (edr11 1611) | |
2710 | (edr12 1612) (edr13 1613) (edr14 1614) (edr15 1615) | |
2711 | (edr16 1616) (edr17 1617) (edr18 1618) (edr19 1619) | |
2712 | (edr20 1620) (edr21 1621) (edr22 1622) (edr23 1623) | |
2713 | (edr24 1624) (edr25 1625) (edr26 1626) (edr27 1627) | |
2714 | (edr28 1628) (edr29 1629) (edr30 1630) (edr31 1631) | |
2715 | (edr32 1632) (edr33 1636) (edr34 1634) (edr35 1635) | |
2716 | (edr36 1636) (edr37 1637) (edr38 1638) (edr39 1639) | |
2717 | (edr40 1640) (edr41 1641) (edr42 1642) (edr43 1643) | |
2718 | (edr44 1644) (edr45 1645) (edr46 1646) (edr47 1647) | |
2719 | (edr48 1648) (edr49 1649) (edr50 1650) (edr51 1651) | |
2720 | (edr52 1652) (edr53 1653) (edr54 1654) (edr55 1655) | |
2721 | (edr56 1656) (edr57 1657) (edr58 1658) (edr59 1659) | |
2722 | (edr60 1660) (edr61 1661) (edr62 1662) (edr63 1663) | |
2723 | ||
2724 | (iamlr0 1664) (iamlr1 1665) (iamlr2 1666) (iamlr3 1667) | |
2725 | (iamlr4 1668) (iamlr5 1669) (iamlr6 1670) (iamlr7 1671) | |
2726 | (iamlr8 1672) (iamlr9 1673) (iamlr10 1674) (iamlr11 1675) | |
2727 | (iamlr12 1676) (iamlr13 1677) (iamlr14 1678) (iamlr15 1679) | |
2728 | (iamlr16 1680) (iamlr17 1681) (iamlr18 1682) (iamlr19 1683) | |
2729 | (iamlr20 1684) (iamlr21 1685) (iamlr22 1686) (iamlr23 1687) | |
2730 | (iamlr24 1688) (iamlr25 1689) (iamlr26 1690) (iamlr27 1691) | |
2731 | (iamlr28 1692) (iamlr29 1693) (iamlr30 1694) (iamlr31 1695) | |
2732 | (iamlr32 1696) (iamlr33 1697) (iamlr34 1698) (iamlr35 1699) | |
2733 | (iamlr36 1700) (iamlr37 1701) (iamlr38 1702) (iamlr39 1703) | |
2734 | (iamlr40 1704) (iamlr41 1705) (iamlr42 1706) (iamlr43 1707) | |
2735 | (iamlr44 1708) (iamlr45 1709) (iamlr46 1710) (iamlr47 1711) | |
2736 | (iamlr48 1712) (iamlr49 1713) (iamlr50 1714) (iamlr51 1715) | |
2737 | (iamlr52 1716) (iamlr53 1717) (iamlr54 1718) (iamlr55 1719) | |
2738 | (iamlr56 1720) (iamlr57 1721) (iamlr58 1722) (iamlr59 1723) | |
2739 | (iamlr60 1724) (iamlr61 1725) (iamlr62 1726) (iamlr63 1727) | |
2740 | ||
2741 | (iampr0 1728) (iampr1 1729) (iampr2 1730) (iampr3 1731) | |
2742 | (iampr4 1732) (iampr5 1733) (iampr6 1734) (iampr7 1735) | |
2743 | (iampr8 1736) (iampr9 1737) (iampr10 1738) (iampr11 1739) | |
2744 | (iampr12 1740) (iampr13 1741) (iampr14 1742) (iampr15 1743) | |
2745 | (iampr16 1744) (iampr17 1745) (iampr18 1746) (iampr19 1747) | |
2746 | (iampr20 1748) (iampr21 1749) (iampr22 1750) (iampr23 1751) | |
2747 | (iampr24 1752) (iampr25 1753) (iampr26 1754) (iampr27 1755) | |
2748 | (iampr28 1756) (iampr29 1757) (iampr30 1758) (iampr31 1759) | |
2749 | (iampr32 1760) (iampr33 1761) (iampr34 1762) (iampr35 1763) | |
2750 | (iampr36 1764) (iampr37 1765) (iampr38 1766) (iampr39 1767) | |
2751 | (iampr40 1768) (iampr41 1769) (iampr42 1770) (iampr43 1771) | |
2752 | (iampr44 1772) (iampr45 1773) (iampr46 1774) (iampr47 1775) | |
2753 | (iampr48 1776) (iampr49 1777) (iampr50 1778) (iampr51 1779) | |
2754 | (iampr52 1780) (iampr53 1781) (iampr54 1782) (iampr55 1783) | |
2755 | (iampr56 1784) (iampr57 1785) (iampr58 1786) (iampr59 1787) | |
2756 | (iampr60 1788) (iampr61 1789) (iampr62 1790) (iampr63 1791) | |
2757 | ||
2758 | (damlr0 1792) (damlr1 1793) (damlr2 1794) (damlr3 1795) | |
2759 | (damlr4 1796) (damlr5 1797) (damlr6 1798) (damlr7 1799) | |
2760 | (damlr8 1800) (damlr9 1801) (damlr10 1802) (damlr11 1803) | |
2761 | (damlr12 1804) (damlr13 1805) (damlr14 1806) (damlr15 1807) | |
2762 | (damlr16 1808) (damlr17 1809) (damlr18 1810) (damlr19 1811) | |
2763 | (damlr20 1812) (damlr21 1813) (damlr22 1814) (damlr23 1815) | |
2764 | (damlr24 1816) (damlr25 1817) (damlr26 1818) (damlr27 1819) | |
2765 | (damlr28 1820) (damlr29 1821) (damlr30 1822) (damlr31 1823) | |
2766 | (damlr32 1824) (damlr33 1825) (damlr34 1826) (damlr35 1827) | |
2767 | (damlr36 1828) (damlr37 1829) (damlr38 1830) (damlr39 1831) | |
2768 | (damlr40 1832) (damlr41 1833) (damlr42 1834) (damlr43 1835) | |
2769 | (damlr44 1836) (damlr45 1837) (damlr46 1838) (damlr47 1839) | |
2770 | (damlr48 1840) (damlr49 1841) (damlr50 1842) (damlr51 1843) | |
2771 | (damlr52 1844) (damlr53 1845) (damlr54 1846) (damlr55 1847) | |
2772 | (damlr56 1848) (damlr57 1849) (damlr58 1850) (damlr59 1851) | |
2773 | (damlr60 1852) (damlr61 1853) (damlr62 1854) (damlr63 1855) | |
2774 | ||
2775 | (dampr0 1856) (dampr1 1857) (dampr2 1858) (dampr3 1859) | |
2776 | (dampr4 1860) (dampr5 1861) (dampr6 1862) (dampr7 1863) | |
2777 | (dampr8 1864) (dampr9 1865) (dampr10 1866) (dampr11 1867) | |
2778 | (dampr12 1868) (dampr13 1869) (dampr14 1870) (dampr15 1871) | |
2779 | (dampr16 1872) (dampr17 1873) (dampr18 1874) (dampr19 1875) | |
2780 | (dampr20 1876) (dampr21 1877) (dampr22 1878) (dampr23 1879) | |
2781 | (dampr24 1880) (dampr25 1881) (dampr26 1882) (dampr27 1883) | |
2782 | (dampr28 1884) (dampr29 1885) (dampr30 1886) (dampr31 1887) | |
2783 | (dampr32 1888) (dampr33 1889) (dampr34 1890) (dampr35 1891) | |
2784 | (dampr36 1892) (dampr37 1893) (dampr38 1894) (dampr39 1895) | |
2785 | (dampr40 1896) (dampr41 1897) (dampr42 1898) (dampr43 1899) | |
2786 | (dampr44 1900) (dampr45 1901) (dampr46 1902) (dampr47 1903) | |
2787 | (dampr48 1904) (dampr49 1905) (dampr50 1906) (dampr51 1907) | |
2788 | (dampr52 1908) (dampr53 1909) (dampr54 1910) (dampr55 1911) | |
2789 | (dampr56 1912) (dampr57 1913) (dampr58 1914) (dampr59 1915) | |
2790 | (dampr60 1916) (dampr61 1917) (dampr62 1918) (dampr63 1919) | |
2791 | ||
2792 | (amcr 1920) (stbar 1921) (mmcr 1922) | |
676a64f4 RS |
2793 | (iamvr1 1925) (damvr1 1927) |
2794 | (cxnr 1936) (ttbr 1937) (tplr 1938) (tppr 1939) | |
2795 | (tpxr 1940) | |
2796 | (timerh 1952) (timerl 1953) (timerd 1954) | |
2797 | (dcr 2048) (brr 2049) (nmar 2050) (btbr 2051) | |
9aab5aa3 AC |
2798 | |
2799 | (ibar0 2052) (ibar1 2053) (ibar2 2054) (ibar3 2055) | |
2800 | (dbar0 2056) (dbar1 2057) (dbar2 2058) (dbar3 2059) | |
2801 | ||
2802 | (dbdr00 2060) (dbdr01 2061) (dbdr02 2062) (dbdr03 2063) | |
2803 | (dbdr10 2064) (dbdr11 2065) (dbdr12 2066) (dbdr13 2067) | |
2804 | (dbdr20 2068) (dbdr21 2069) (dbdr22 2070) (dbdr23 2071) | |
2805 | (dbdr30 2072) (dbdr31 2073) (dbdr32 2074) (dbdr33 2075) | |
2806 | ||
2807 | (dbmr00 2076) (dbmr01 2077) (dbmr02 2078) (dbmr03 2079) | |
2808 | (dbmr10 2080) (dbmr11 2081) (dbmr12 2082) (dbmr13 2083) | |
2809 | (dbmr20 2084) (dbmr21 2085) (dbmr22 2086) (dbmr23 2087) | |
2810 | (dbmr30 2088) (dbmr31 2089) (dbmr32 2090) (dbmr33 2091) | |
2811 | ||
53289dcd MS |
2812 | (cpcfr 2304) (cpcr 2305) (cpsr 2306) (cptr 2307) |
2813 | (cphsr0 2308) (cphsr1 2309) (cpesr0 2320) (cpesr1 2321) | |
2814 | (cpemr0 2322) (cpemr1 2323) | |
9aab5aa3 | 2815 | |
53289dcd MS |
2816 | (iperr0 2324) (iperr1 2325) (ipjsr 2326) (ipjrr 2327) |
2817 | (ipcsr0 2336) (ipcsr1 2337) (ipcwer0 2338) (ipcwer1 2339) | |
2818 | (ipcwr 2340) | |
9aab5aa3 | 2819 | |
53289dcd MS |
2820 | (mbhsr 2352) (mbssr 2353) (mbrsr 2354) (mbsdr 2355) |
2821 | (mbrdr 2356) (mbsmr 2357) (mbstr0 2359) (mbstr1 2360) | |
2822 | ||
2823 | (slpr 2368) (sldr 2369) (slhsr 2370) (sltr 2371) | |
2824 | (slwr 2372) | |
2825 | ||
2826 | (ihsr8 3848) (ihsr9 3849) (ihsr10 3850) | |
9aab5aa3 AC |
2827 | ) |
2828 | ) | |
2829 | ||
2830 | (define-hardware | |
2831 | (name h-spr) | |
2832 | (comment "special purpose registers") | |
2833 | (attrs PROFILE) | |
2834 | (type register UWI (4096)) | |
2835 | (indices extern-keyword spr-names) | |
2836 | (get (index) (c-call UWI "@cpu@_h_spr_get_handler" index)) | |
2837 | (set (index newval) (c-call VOID "@cpu@_h_spr_set_handler" index newval)) | |
2838 | ) | |
2839 | ||
2840 | (define-pmacro (spr-pcsr) (reg h-spr 1)) | |
2841 | (define-pmacro (spr-bpcsr) (reg h-spr 2)) | |
2842 | (define-pmacro (spr-lr) (reg h-spr 272)) | |
2843 | (define-pmacro (spr-lcr) (reg h-spr 273)) | |
ac7c07ac DB |
2844 | (define-pmacro (spr-iacc0h) (reg h-spr 280)) |
2845 | (define-pmacro (spr-iacc0l) (reg h-spr 281)) | |
9aab5aa3 AC |
2846 | (define-pmacro (spr-sr0) (reg h-spr 768)) |
2847 | (define-pmacro (spr-sr1) (reg h-spr 769)) | |
2848 | (define-pmacro (spr-sr2) (reg h-spr 770)) | |
2849 | (define-pmacro (spr-sr3) (reg h-spr 771)) | |
2850 | ||
2851 | ; Accumulator guard. Actually a subset of the SPR registers, but those SPRs | |
2852 | ; are read-only in most insns. This hardware element is used by those insns | |
2853 | ; which have direct access (mwtaccg, mrdaccg). | |
2854 | (define-keyword | |
2855 | (name accg-names) | |
2856 | (print-name h-accg) | |
2857 | (prefix "") | |
2858 | (values | |
2859 | (accg0 0)(accg1 1)(accg2 2)(accg3 3) | |
2860 | (accg4 4)(accg5 5)(accg6 6)(accg7 7) | |
2861 | (accg8 8)(accg9 9)(accg10 10)(accg11 11) | |
2862 | (accg12 12)(accg13 13)(accg14 14)(accg15 15) | |
2863 | (accg16 16)(accg17 17)(accg18 18)(accg19 19) | |
2864 | (accg20 20)(accg21 21)(accg22 22)(accg23 23) | |
2865 | (accg24 24)(accg25 25)(accg26 26)(accg27 27) | |
2866 | (accg28 28)(accg29 29)(accg30 30)(accg31 31) | |
2867 | (accg32 32)(accg33 33)(accg34 34)(accg35 35) | |
2868 | (accg36 36)(accg37 37)(accg38 38)(accg39 39) | |
2869 | (accg40 40)(accg41 41)(accg42 42)(accg43 43) | |
2870 | (accg44 44)(accg45 45)(accg46 46)(accg47 47) | |
2871 | (accg48 48)(accg49 49)(accg50 50)(accg51 51) | |
2872 | (accg52 52)(accg53 53)(accg54 54)(accg55 55) | |
2873 | (accg56 56)(accg57 57)(accg58 58)(accg59 59) | |
2874 | (accg60 60)(accg61 61)(accg62 62)(accg63 63) | |
2875 | ) | |
2876 | ) | |
2877 | ||
2878 | (define-hardware | |
2879 | (name h-accg) | |
2880 | (comment "accumulator guard") | |
2881 | (attrs PROFILE VIRTUAL) | |
2882 | (type register UWI (64)) | |
2883 | (indices extern-keyword accg-names) | |
2884 | (get (index) | |
2885 | (and (reg h-spr (add index 1472)) #xff)) | |
2886 | (set (index newval) | |
2887 | (set (raw-reg UWI h-spr (add index 1472)) (and newval #xff))) | |
2888 | ) | |
2889 | ||
2890 | ; 40 bit accumulator. Composed of ACCG and ACC registers concatenated, but | |
2891 | ; referenced more often as the composed 40 bits. | |
2892 | (define-keyword | |
2893 | (name acc-names) | |
2894 | (print-name h-acc40) | |
2895 | (prefix "") | |
2896 | (values | |
2897 | (acc0 0)(acc1 1)(acc2 2)(acc3 3)(acc4 4)(acc5 5)(acc6 6)(acc7 7) | |
2898 | (acc8 8)(acc9 9)(acc10 10)(acc11 11)(acc12 12)(acc13 13)(acc14 14)(acc15 15) | |
2899 | (acc16 16)(acc17 17)(acc18 18)(acc19 19)(acc20 20)(acc21 21)(acc22 22)(acc23 23) | |
2900 | (acc24 24)(acc25 25)(acc26 26)(acc27 27)(acc28 28)(acc29 29)(acc30 30)(acc31 31) | |
2901 | (acc32 32)(acc33 33)(acc34 34)(acc35 35)(acc36 36)(acc37 37)(acc38 38)(acc39 39) | |
2902 | (acc40 40)(acc41 41)(acc42 42)(acc43 43)(acc44 44)(acc45 45)(acc46 46)(acc47 47) | |
2903 | (acc48 48)(acc49 49)(acc50 50)(acc51 51)(acc52 52)(acc53 53)(acc54 54)(acc55 55) | |
2904 | (acc56 56)(acc57 57)(acc58 58)(acc59 59)(acc60 60)(acc61 61)(acc62 62)(acc63 63) | |
2905 | ) | |
2906 | ) | |
2907 | ||
2908 | (define-hardware | |
2909 | (name h-acc40S) | |
2910 | (comment "40 bit signed accumulator") | |
2911 | (attrs PROFILE VIRTUAL) | |
2912 | (type register DI (64)) | |
2913 | (indices extern-keyword acc-names) | |
2914 | ; The accumlator is made up of two 32 bit registers, accgi/acci. | |
2915 | ; We want to extract this as a combined 40 signed bits | |
2916 | (get (index) | |
2917 | (or DI | |
2918 | (sll DI (ext DI (trunc QI (reg h-spr (add index 1472)))) | |
2919 | 32) | |
2920 | (zext DI (reg h-spr (add index 1408))))) | |
2921 | ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions | |
2922 | ; on ACC and ACCG registers | |
2923 | (set (index newval) | |
2924 | (sequence () | |
2925 | (c-call VOID "frv_check_spr_write_access" (add index 1408)) | |
2926 | (set (raw-reg UWI h-spr | |
2927 | (add index 1472)) (and (srl newval 32) #xff)) | |
2928 | (set (raw-reg UWI h-spr | |
2929 | (add index 1408)) (trunc USI newval)))) | |
2930 | ) | |
2931 | ||
2932 | (define-hardware | |
2933 | (name h-acc40U) | |
2934 | (comment "40 bit unsigned accumulator") | |
2935 | (attrs PROFILE VIRTUAL) | |
2936 | (type register UDI (64)) | |
2937 | (indices extern-keyword acc-names) | |
2938 | ; The accumlator is made up of two 32 bit registers, accgi/acci. | |
2939 | ; We want to extract this as a combined 40 unsigned bits | |
2940 | (get (index) | |
2941 | (or DI | |
2942 | (sll DI (zext DI (reg h-spr (add index 1472))) 32) | |
2943 | (zext DI (reg h-spr (add index 1408))))) | |
2944 | ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions | |
2945 | ; on ACC and ACCG registers | |
2946 | (set (index newval) | |
2947 | (sequence () | |
2948 | (c-call VOID "frv_check_spr_write_access" (add index 1408)) | |
2949 | (set (raw-reg UWI h-spr | |
2950 | (add index 1472)) (and (srl newval 32) #xff)) | |
2951 | (set (raw-reg UWI h-spr | |
2952 | (add index 1408)) (trunc USI newval)))) | |
2953 | ) | |
ac7c07ac DB |
2954 | ; 64-bit signed accumulator. Composed of iacc0h and iacc0l registers |
2955 | ; concatenated, but referenced more often as the composed 64 bits. | |
2956 | (define-keyword | |
2957 | ; This is totally hokey -- I have to have an index! | |
2958 | (name iacc0-names) | |
2959 | (print-name h-iacc0) | |
2960 | (prefix "") | |
2961 | (values (iacc0 0)) | |
2962 | ) | |
2963 | ||
2964 | (define-hardware | |
2965 | (name h-iacc0) | |
2966 | (comment "64 bit signed accumulator") | |
676a64f4 | 2967 | (attrs PROFILE VIRTUAL (MACH fr400,fr450)) |
ac7c07ac DB |
2968 | (type register DI (1)) |
2969 | (indices extern-keyword iacc0-names) | |
2970 | ; The single 64-bit integer accumulator is made up of two 32 bit | |
2971 | ; registers, iacc0h and iacc0l. We want to extract this as a | |
2972 | ; combined 64 signed bits. | |
2973 | (get (idx) (or DI (sll DI (ext DI (spr-iacc0h)) 32) (zext DI (spr-iacc0l)))) | |
2974 | (set (idx newval) | |
2975 | (sequence () | |
2976 | (set (spr-iacc0h) (trunc SI (srl newval 32))) | |
2977 | (set (spr-iacc0l) (trunc SI newval)))) | |
2978 | ) | |
9aab5aa3 AC |
2979 | |
2980 | ; Integer condition code registers (CCR) | |
2981 | ; | |
2982 | ; The individual sub registers bits of the CCR are referenced more often than | |
2983 | ; the entire register so set them directly. We can assemble the | |
2984 | ; entire register when necessary. | |
2985 | ; | |
2986 | (define-keyword | |
2987 | (name iccr-names) | |
2988 | (print-name h-iccr) | |
2989 | (prefix "") | |
2990 | (values (icc0 0) (icc1 1) (icc2 2) (icc3 3)) | |
2991 | ) | |
2992 | ||
2993 | (define-hardware | |
2994 | (name h-iccr) | |
2995 | (comment "Integer condition code registers") | |
2996 | (attrs PROFILE) | |
2997 | (type register UQI (4)) | |
2998 | (indices extern-keyword iccr-names) | |
2999 | ) | |
3000 | ||
3001 | ; Floating point condition code registers (CCR) | |
3002 | ; | |
3003 | ; The individual sub registers bits of the CCR are referenced more often than | |
3004 | ; the entire register so set them directly. We can assemble the | |
3005 | ; entire register when necessary. | |
3006 | ; | |
3007 | (define-keyword | |
3008 | (name fccr-names) | |
3009 | (print-name h-fccr) | |
3010 | (prefix "") | |
3011 | (values (fcc0 0) (fcc1 1) (fcc2 2) (fcc3 3)) | |
3012 | ) | |
3013 | ||
3014 | (define-hardware | |
3015 | (name h-fccr) | |
6f18ad70 | 3016 | (comment "Floating point condition code registers") |
9aab5aa3 AC |
3017 | (attrs PROFILE) |
3018 | (type register UQI (4)) | |
3019 | (indices extern-keyword fccr-names) | |
3020 | ) | |
3021 | ||
3022 | ; C condition code registers (CCCR) | |
3023 | ; | |
3024 | (define-keyword | |
3025 | (name cccr-names) | |
3026 | (print-name h-cccr) | |
3027 | (prefix "") | |
3028 | (values (cc0 0) (cc1 1) (cc2 2) (cc3 3) (cc4 4) (cc5 5) (cc6 6) (cc7 7)) | |
3029 | ) | |
3030 | ||
3031 | (define-hardware | |
3032 | (name h-cccr) | |
3033 | (comment "Condition code registers") | |
3034 | (attrs PROFILE) | |
3035 | (type register UQI (8)) | |
3036 | (indices extern-keyword cccr-names) | |
3037 | ) | |
3038 | \f | |
3039 | ; Dummy hardware used to define packing bit on insns | |
3040 | ; | |
3041 | (define-hardware | |
3042 | (name h-pack) | |
3043 | (comment "Packing bit dummy hardware") | |
3044 | (type immediate (UINT 1)) | |
3045 | (values keyword "" (("" 1) (".p" 0) (".P" 0))) | |
3046 | ) | |
3047 | ; Dummy hardware used to define hint field for branches always taken | |
3048 | ; | |
3049 | (define-hardware | |
3050 | (name h-hint-taken) | |
3051 | (comment "Branch taken hint dummy hardware") | |
3052 | (type immediate (UINT 1)) | |
3053 | ; The order of these is important. We want '2' to get written by default, | |
3054 | ; but we also want the docoder/disassembler to allow the values '0', '1' and | |
3055 | ; '3'. | |
3056 | (values keyword "" (("" 2) ("" 0) ("" 1) ("" 3))) | |
3057 | ) | |
3058 | ; Dummy hardware used to define hint field for branches never taken | |
3059 | ; | |
3060 | (define-hardware | |
3061 | (name h-hint-not-taken) | |
3062 | (comment "Branch not taken hint dummy hardware") | |
3063 | (type immediate (UINT 1)) | |
3064 | ; The order of these is important. We want '0' to get written by default, | |
3065 | ; but we also want the docoder/disassembler to allow the values '1', '2' and | |
3066 | ; '3'. | |
3067 | (values keyword "" (("" 0) ("" 1) ("" 2) ("" 3))) | |
3068 | ) | |
3069 | \f | |
3070 | ; Instruction Operands. | |
3071 | ; These entries provide a layer between the assembler and the raw hardware | |
3072 | ; description, and are used to refer to hardware elements in the semantic | |
3073 | ; code. Usually there's a bit of over-specification, but in more complicated | |
3074 | ; instruction sets there isn't. | |
3075 | ||
3076 | ; FRV specific operand attributes: | |
3077 | ||
3078 | (define-attr | |
3079 | (for operand) | |
3080 | (type boolean) | |
3081 | (name HASH-PREFIX) | |
3082 | (comment "immediates have an optional '#' prefix") | |
3083 | ) | |
3084 | ||
3085 | ; ??? Convention says this should be o-sr, but then the insn definitions | |
3086 | ; should refer to o-sr which is clumsy. The "o-" could be implicit, but | |
3087 | ; then it should be implicit for all the symbols here, but then there would | |
3088 | ; be confusion between (f-)simm8 and (h-)simm8. | |
3089 | ; So for now the rule is exactly as it appears here. | |
3090 | ||
3091 | ; dnmop: define-normal-mode-operand: temporary, pending potential removal | |
3092 | ; of modes from h/w. | |
3093 | (define-pmacro (dnmop xname xcomment xattrs xtype xindex xmode) | |
3094 | (define-operand | |
3095 | (name xname) | |
3096 | (comment xcomment) | |
3097 | (.splice attrs (.unsplice xattrs)) | |
3098 | (type xtype) | |
3099 | (index xindex) | |
3100 | (mode xmode) | |
3101 | ) | |
3102 | ) | |
3103 | ||
1340b9a9 DB |
3104 | ; dnpmop: define-normal-parsed-mode-operand: Normal mode operand with parse handler |
3105 | (define-pmacro (dnpmop xname xcomment xattrs xtype xindex xmode xparse) | |
3106 | (define-operand | |
3107 | (name xname) | |
3108 | (comment xcomment) | |
3109 | (.splice attrs (.unsplice xattrs)) | |
3110 | (type xtype) | |
3111 | (index xindex) | |
3112 | (mode xmode) | |
3113 | (handlers (parse xparse)) | |
3114 | ) | |
3115 | ) | |
3116 | ||
9aab5aa3 AC |
3117 | (dnop pack "packing bit" () h-pack f-pack) |
3118 | ||
3119 | (dnmop GRi "source register 1" () h-gr f-GRi SI) | |
3120 | (dnmop GRj "source register 2" () h-gr f-GRj SI) | |
3121 | (dnmop GRk "destination register" () h-gr f-GRk SI) | |
3122 | (dnmop GRkhi "destination register" () h-gr_hi f-GRk UHI) | |
3123 | (dnmop GRklo "destination register" () h-gr_lo f-GRk UHI) | |
1340b9a9 | 3124 | (dnpmop GRdoublek "destination register" () h-gr_double f-GRk DI "even_register") |
9aab5aa3 AC |
3125 | (dnmop ACC40Si "signed accumulator" () h-acc40S f-ACC40Si DI) |
3126 | (dnmop ACC40Ui "unsigned accumulator" () h-acc40U f-ACC40Ui UDI) | |
3127 | (dnmop ACC40Sk "target accumulator" () h-acc40S f-ACC40Sk DI) | |
3128 | (dnmop ACC40Uk "target accumulator" () h-acc40U f-ACC40Uk UDI) | |
3129 | (dnmop ACCGi "source register" () h-accg f-ACCGi UWI) | |
3130 | (dnmop ACCGk "target register" () h-accg f-ACCGk UWI) | |
3131 | ||
3132 | (dnmop CPRi "source register" ((MACH frv)) h-cpr f-CPRi SI) | |
3133 | (dnmop CPRj "source register" ((MACH frv)) h-cpr f-CPRj SI) | |
3134 | (dnmop CPRk "destination register" ((MACH frv)) h-cpr f-CPRk SI) | |
1340b9a9 | 3135 | (dnpmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI "even_register") |
9aab5aa3 AC |
3136 | |
3137 | ; floating point operands | |
36c3ae24 NC |
3138 | (dnmop FRinti "source register 1" () h-fr_int f-FRi SI) |
3139 | (dnmop FRintj "source register 2" () h-fr_int f-FRj SI) | |
3140 | (dnmop FRintk "target register" () h-fr_int f-FRk SI) | |
9aab5aa3 AC |
3141 | (dnmop FRi "source register 1" () h-fr f-FRi SF) |
3142 | (dnmop FRj "source register 2" () h-fr f-FRj SF) | |
3143 | (dnmop FRk "destination register" () h-fr f-FRk SF) | |
3144 | (dnmop FRkhi "destination register" () h-fr_hi f-FRk UHI) | |
3145 | (dnmop FRklo "destination register" () h-fr_lo f-FRk UHI) | |
1340b9a9 DB |
3146 | (dnpmop FRdoublei "source register 1" () h-fr_double f-FRi DF "even_register") |
3147 | (dnpmop FRdoublej "source register 2" () h-fr_double f-FRj DF "even_register") | |
3148 | (dnpmop FRdoublek "target register" () h-fr_double f-FRk DF "even_register") | |
9aab5aa3 AC |
3149 | |
3150 | (dnop CRi "source register 1" () h-cccr f-CRi) | |
3151 | (dnop CRj "source register 2" () h-cccr f-CRj) | |
3152 | (dnop CRj_int "destination register" () h-cccr f-CRj_int) | |
3153 | (dnop CRj_float "destination register" () h-cccr f-CRj_float) | |
3154 | (dnop CRk "destination register" () h-cccr f-CRk) | |
3155 | (dnop CCi "condition register" () h-cccr f-CCi) | |
3156 | ||
3157 | (dnop ICCi_1 "condition register" () h-iccr f-ICCi_1) | |
3158 | (dnop ICCi_2 "condition register" () h-iccr f-ICCi_2) | |
3159 | (dnop ICCi_3 "condition register" () h-iccr f-ICCi_3) | |
3160 | (dnop FCCi_1 "condition register" () h-fccr f-FCCi_1) | |
3161 | (dnop FCCi_2 "condition register" () h-fccr f-FCCi_2) | |
3162 | (dnop FCCi_3 "condition register" () h-fccr f-FCCi_3) | |
3163 | (dnop FCCk "condition register" () h-fccr f-FCCk) | |
3164 | ||
3165 | (dnop eir "exception insn reg" () h-uint f-eir) | |
3166 | (dnop s10 "10 bit signed immediate" (HASH-PREFIX) h-sint f-s10) | |
3167 | (dnop u16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-u16) | |
3168 | (dnop s16 "16 bit signed immediate" (HASH-PREFIX) h-sint f-s16) | |
3169 | (dnop s6 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6) | |
3170 | (dnop s6_1 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6_1) | |
3171 | (dnop u6 "6 bit unsigned immediate" (HASH-PREFIX) h-uint f-u6) | |
3172 | (dnop s5 "5 bit signed immediate" (HASH-PREFIX) h-sint f-s5) | |
3173 | (dnop cond "conditional arithmetic" (HASH-PREFIX) h-uint f-cond) | |
3174 | (dnop ccond "lr branch condition" (HASH-PREFIX) h-uint f-ccond) | |
3175 | (dnop hint "2 bit branch predictor" (HASH-PREFIX) h-uint f-hint) | |
3176 | (dnop hint_taken "2 bit branch predictor" () h-hint-taken f-hint) | |
3177 | (dnop hint_not_taken "2 bit branch predictor" () h-hint-not-taken f-hint) | |
3178 | ||
3179 | (dnop LI "link indicator" () h-uint f-LI) | |
3180 | (dnop lock "cache lock indicator" (HASH-PREFIX) h-uint f-lock) | |
3181 | (dnop debug "debug mode indicator" (HASH-PREFIX) h-uint f-debug) | |
9aab5aa3 AC |
3182 | (dnop ae "all entries indicator" (HASH-PREFIX) h-uint f-ae) |
3183 | ||
3184 | (dnop label16 "18 bit pc relative address" () h-iaddr f-label16) | |
9aab5aa3 | 3185 | |
676a64f4 RS |
3186 | (dnop LRAE "Load Real Address E flag" () h-uint f-LRAE) |
3187 | (dnop LRAD "Load Real Address D flag" () h-uint f-LRAD) | |
3188 | (dnop LRAS "Load Real Address S flag" () h-uint f-LRAS) | |
3189 | ||
3190 | (dnop TLBPRopx "TLB Probe operation number" () h-uint f-TLBPRopx) | |
3191 | (dnop TLBPRL "TLB Probe L flag" () h-uint f-TLBPRL) | |
3192 | ||
8caa9169 DB |
3193 | (define-operand |
3194 | (name A0) | |
3195 | (comment "A==0 operand of mclracc") | |
3196 | (attrs) | |
3197 | (type h-uint) | |
3198 | (index f-A) | |
3199 | (mode USI) | |
3200 | (handlers (parse "A0")) | |
3201 | ) | |
3202 | ||
3203 | (define-operand | |
3204 | (name A1) | |
3205 | (comment "A==1 operand of mclracc") | |
3206 | (attrs) | |
3207 | (type h-uint) | |
3208 | (index f-A) | |
3209 | (mode USI) | |
3210 | (handlers (parse "A1")) | |
3211 | ) | |
3212 | ||
36c3ae24 NC |
3213 | (define-operand |
3214 | (name FRintieven) | |
3215 | (comment "(even) source register 1") | |
3216 | (attrs) | |
3217 | (type h-fr_int) | |
3218 | (index f-FRi) | |
3219 | (mode SI) | |
3220 | (handlers (parse "even_register")) | |
3221 | ) | |
3222 | ||
3223 | (define-operand | |
3224 | (name FRintjeven) | |
3225 | (comment "(even) source register 2") | |
3226 | (attrs) | |
3227 | (type h-fr_int) | |
3228 | (index f-FRj) | |
3229 | (mode SI) | |
3230 | (handlers (parse "even_register")) | |
3231 | ) | |
3232 | ||
3233 | (define-operand | |
3234 | (name FRintkeven) | |
3235 | (comment "(even) target register") | |
3236 | (attrs) | |
3237 | (type h-fr_int) | |
3238 | (index f-FRk) | |
3239 | (mode SI) | |
3240 | (handlers (parse "even_register")) | |
3241 | ) | |
3242 | ||
9aab5aa3 AC |
3243 | (define-operand |
3244 | (name d12) | |
3245 | (comment "12 bit signed immediate") | |
3246 | (attrs) | |
3247 | (type h-sint) | |
3248 | (index f-d12) | |
3249 | (handlers (parse "d12")) | |
3250 | ) | |
3251 | ||
3252 | (define-operand | |
3253 | (name s12) | |
3254 | (comment "12 bit signed immediate") | |
3255 | (attrs HASH-PREFIX) | |
3256 | (type h-sint) | |
3257 | (index f-d12) | |
3258 | (handlers (parse "s12")) | |
3259 | ) | |
3260 | ||
3261 | (define-operand | |
3262 | (name u12) | |
3263 | (comment "12 bit signed immediate") | |
3264 | (attrs HASH-PREFIX) | |
3265 | (type h-sint) | |
3266 | (index f-u12) | |
3267 | (handlers (parse "u12")) | |
3268 | ) | |
3269 | ||
3270 | (define-operand | |
3271 | (name spr) | |
3272 | (comment "special purpose register") | |
3273 | (attrs) | |
3274 | (type h-spr) | |
3275 | (index f-spr) | |
3276 | (handlers (parse "spr") (print "spr")) | |
3277 | ) | |
3278 | ||
3279 | (define-operand | |
3280 | (name ulo16) | |
3281 | (comment "16 bit unsigned immediate, for #lo()") | |
3282 | (attrs) | |
3283 | (type h-uint) | |
3284 | (index f-u16) | |
3285 | (handlers (parse "ulo16") (print "lo")) | |
3286 | ) | |
3287 | ||
3288 | (define-operand | |
3289 | (name slo16) | |
3290 | (comment "16 bit unsigned immediate, for #lo()") | |
3291 | (attrs) | |
3292 | (type h-sint) | |
3293 | (index f-s16) | |
3294 | (handlers (parse "uslo16") (print "lo")) | |
3295 | ) | |
3296 | ||
3297 | (define-operand | |
3298 | (name uhi16) | |
3299 | (comment "16 bit unsigned immediate, for #hi()") | |
3300 | (attrs) | |
3301 | (type h-uint) | |
3302 | (index f-u16) | |
3303 | (handlers (parse "uhi16") (print "hi")) | |
3304 | ) | |
3305 | ||
90219bd0 AO |
3306 | (define-operand |
3307 | (name label24) | |
3308 | (comment "26 bit pc relative address") | |
3309 | (attrs) | |
3310 | (type h-iaddr) | |
3311 | (index f-label24) | |
3312 | (mode SI) | |
3313 | (handlers (parse "call_label")) | |
3314 | ) | |
3315 | ||
9aab5aa3 AC |
3316 | ; operands representing hardware |
3317 | ; | |
3318 | (dnop psr_esr "PSR.ESR bit" (SEM-ONLY) h-psr_esr f-nil) | |
3319 | (dnop psr_s "PSR.S bit" (SEM-ONLY) h-psr_s f-nil) | |
3320 | (dnop psr_ps "PSR.PS bit" (SEM-ONLY) h-psr_ps f-nil) | |
3321 | (dnop psr_et "PSR.ET bit" (SEM-ONLY) h-psr_et f-nil) | |
3322 | ||
3323 | (dnop bpsr_bs "BPSR.BS bit" (SEM-ONLY) h-bpsr_bs f-nil) | |
3324 | (dnop bpsr_bet "BPSR.BET bit" (SEM-ONLY) h-bpsr_bet f-nil) | |
3325 | ||
3326 | (dnop tbr_tba "TBR.TBA" (SEM-ONLY) h-tbr_tba f-nil) | |
3327 | (dnop tbr_tt "TBR.TT" (SEM-ONLY) h-tbr_tt f-nil) | |
3328 | ||
3329 | ; Null operands | |
3330 | ; | |
3331 | (define-pmacro (ICCi_1-null) (f-ICCi_1-null 0)) | |
3332 | (define-pmacro (ICCi_2-null) (f-ICCi_2-null 0)) | |
3333 | (define-pmacro (ICCi_3-null) (f-ICCi_3-null 0)) | |
3334 | (define-pmacro (FCCi_1-null) (f-FCCi_1-null 0)) | |
3335 | (define-pmacro (FCCi_2-null) (f-FCCi_2-null 0)) | |
3336 | (define-pmacro (FCCi_3-null) (f-FCCi_3-null 0)) | |
3337 | (define-pmacro (rs-null) (f-rs-null 0)) | |
3338 | (define-pmacro (GRi-null) (f-GRi-null 0)) | |
3339 | (define-pmacro (GRj-null) (f-GRj-null 0)) | |
3340 | (define-pmacro (GRk-null) (f-GRk-null 0)) | |
3341 | (define-pmacro (FRi-null) (f-FRi-null 0)) | |
3342 | (define-pmacro (FRj-null) (f-FRj-null 0)) | |
3343 | (define-pmacro (ACCj-null) (f-ACCj-null 0)) | |
3344 | (define-pmacro (rd-null) (f-rd-null 0)) | |
3345 | (define-pmacro (cond-null) (f-cond-null 0)) | |
3346 | (define-pmacro (ccond-null) (f-ccond-null 0)) | |
3347 | (define-pmacro (s12-null) (f-s12-null 0)) | |
3348 | (define-pmacro (label16-null) (f-label16-null 0)) | |
3349 | (define-pmacro (misc-null-1) (f-misc-null-1 0)) | |
3350 | (define-pmacro (misc-null-2) (f-misc-null-2 0)) | |
3351 | (define-pmacro (misc-null-3) (f-misc-null-3 0)) | |
3352 | (define-pmacro (misc-null-4) (f-misc-null-4 0)) | |
3353 | (define-pmacro (misc-null-5) (f-misc-null-5 0)) | |
3354 | (define-pmacro (misc-null-6) (f-misc-null-6 0)) | |
3355 | (define-pmacro (misc-null-7) (f-misc-null-7 0)) | |
3356 | (define-pmacro (misc-null-8) (f-misc-null-8 0)) | |
3357 | (define-pmacro (misc-null-9) (f-misc-null-9 0)) | |
3358 | (define-pmacro (misc-null-10) (f-misc-null-10 0)) | |
3359 | (define-pmacro (misc-null-11) (f-misc-null-11 0)) | |
3360 | ||
676a64f4 RS |
3361 | (define-pmacro (LRA-null) (f-LRA-null 0)) |
3362 | (define-pmacro (TLBPR-null) (f-TLBPR-null 0)) | |
3363 | ||
9aab5aa3 AC |
3364 | (define-pmacro (LI-on) (f-LI-on 1)) |
3365 | (define-pmacro (LI-off) (f-LI-off 0)) | |
3366 | \f | |
3367 | ; Instruction definitions. | |
3368 | ; | |
3369 | ; Notes: | |
3370 | ; - dni is short for "define-normal-instruction" | |
3371 | ; - Macros are used to represent each insn format. These should be used as much | |
3372 | ; as possible unless an insn has exceptional behaviour | |
3373 | ; | |
3374 | ||
3375 | ; Commonly used Macros | |
3376 | ; | |
3377 | ; Specific registers | |
3378 | ; | |
3379 | ||
3380 | ; Integer condition code manipulation | |
3381 | ; | |
3382 | (define-pmacro (set-z-and-n icc x) | |
3383 | (if (eq x 0) | |
3384 | (set icc (or (and icc #x7) #x4)) | |
3385 | (if (lt x 0) | |
3386 | (set icc (or (and icc #xb) #x8)) | |
3387 | (set icc (and icc #x3)))) | |
3388 | ) | |
3389 | ||
3390 | (define-pmacro (set-n icc val) | |
3391 | (if (eq val 0) | |
3392 | (set icc (and icc #x7)) | |
3393 | (set icc (or icc #x8))) | |
3394 | ) | |
3395 | ||
3396 | (define-pmacro (set-z icc val) | |
3397 | (if (eq val 0) | |
3398 | (set icc (and icc #xb)) | |
3399 | (set icc (or icc #x4))) | |
3400 | ) | |
3401 | ||
3402 | (define-pmacro (set-v icc val) | |
3403 | (if (eq val 0) | |
3404 | (set icc (and icc #xd)) | |
3405 | (set icc (or icc #x2))) | |
3406 | ) | |
3407 | ||
3408 | (define-pmacro (set-c icc val) | |
3409 | (if (eq val 0) | |
3410 | (set icc (and icc #xe)) | |
3411 | (set icc (or icc #x1))) | |
3412 | ) | |
3413 | ||
3414 | (define-pmacro (nbit icc) | |
3415 | (trunc BI (srl (and icc #x8) 3)) | |
3416 | ) | |
3417 | ||
3418 | (define-pmacro (zbit icc) | |
3419 | (trunc BI (srl (and icc #x4) 2)) | |
3420 | ) | |
3421 | ||
3422 | (define-pmacro (vbit icc) | |
3423 | (trunc BI (srl (and icc #x2) 1)) | |
3424 | ) | |
3425 | ||
3426 | (define-pmacro (cbit icc) | |
3427 | (trunc BI (and icc #x1)) | |
3428 | ) | |
3429 | ||
3430 | (define-pmacro (ebit icc) | |
3431 | (trunc BI (srl (and icc #x8) 3)) | |
3432 | ) | |
3433 | ||
3434 | (define-pmacro (lbit icc) | |
3435 | (trunc BI (srl (and icc #x4) 2)) | |
3436 | ) | |
3437 | ||
3438 | (define-pmacro (gbit icc) | |
3439 | (trunc BI (srl (and icc #x2) 1)) | |
3440 | ) | |
3441 | ||
3442 | (define-pmacro (ubit icc) | |
3443 | (trunc BI (and icc #x1)) | |
3444 | ) | |
3445 | ||
8caa9169 DB |
3446 | ; FRV insns |
3447 | ; | |
9aab5aa3 | 3448 | ; |
9aab5aa3 AC |
3449 | ; Format: INT, Logic, Shift r-r |
3450 | ; | |
3451 | (define-pmacro (int-logic-r-r name operation op ope comment) | |
3452 | (dni name | |
3453 | (comment) | |
676a64f4 RS |
3454 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3455 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3456 | (.str name "$pack $GRi,$GRj,$GRk") |
3457 | (+ pack GRk op GRi (ICCi_1-null) ope GRj) | |
3458 | (set GRk (operation GRi GRj)) | |
676a64f4 | 3459 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3460 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3461 | ) |
3462 | ) | |
3463 | ||
3464 | (int-logic-r-r add add OP_00 OPE2_00 "add reg/reg") | |
3465 | (int-logic-r-r sub sub OP_00 OPE2_04 "sub reg/reg") | |
3466 | (int-logic-r-r and and OP_01 OPE2_00 "and reg/reg") | |
3467 | (int-logic-r-r or or OP_01 OPE2_02 "or reg/reg") | |
3468 | (int-logic-r-r xor xor OP_01 OPE2_04 "xor reg/reg") | |
3469 | ||
3470 | (dni not | |
3471 | ("not") | |
676a64f4 RS |
3472 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3473 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3474 | ("not$pack $GRj,$GRk") |
3475 | (+ pack GRk OP_01 (rs-null) (ICCi_1-null) OPE2_06 GRj) | |
3476 | (set GRk (inv GRj)) | |
676a64f4 | 3477 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3478 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3479 | ) |
3480 | ||
3481 | (dni sdiv | |
3482 | "signed division" | |
676a64f4 RS |
3483 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3484 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3485 | "sdiv$pack $GRi,$GRj,$GRk" |
3486 | (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0E GRj) | |
3487 | (sequence () | |
3488 | (c-call VOID "@cpu@_signed_integer_divide" | |
3489 | GRi GRj (index-of GRk) 0) | |
3490 | (clobber GRk)) | |
676a64f4 | 3491 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 3492 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3493 | ) |
3494 | ||
3495 | (dni nsdiv | |
3496 | "non excepting signed division" | |
ac7c07ac DB |
3497 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING |
3498 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
3499 | "nsdiv$pack $GRi,$GRj,$GRk" |
3500 | (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0E GRj) | |
3501 | (sequence () | |
3502 | (c-call VOID "@cpu@_signed_integer_divide" | |
3503 | GRi GRj (index-of GRk) 1) | |
3504 | (clobber GRk)) | |
c7a48b9a | 3505 | ((fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3506 | ) |
3507 | ||
3508 | (dni udiv | |
3509 | "unsigned division reg/reg" | |
676a64f4 RS |
3510 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3511 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3512 | "udiv$pack $GRi,$GRj,$GRk" |
3513 | (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0F GRj) | |
3514 | (sequence () | |
3515 | (c-call VOID "@cpu@_unsigned_integer_divide" | |
3516 | GRi GRj (index-of GRk) 0) | |
3517 | (clobber GRk)) | |
676a64f4 | 3518 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 3519 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3520 | ) |
3521 | ||
3522 | (dni nudiv | |
3523 | "non excepting unsigned division" | |
ac7c07ac DB |
3524 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING |
3525 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
3526 | "nudiv$pack $GRi,$GRj,$GRk" |
3527 | (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0F GRj) | |
3528 | (sequence () | |
3529 | (c-call VOID "@cpu@_unsigned_integer_divide" | |
3530 | GRi GRj (index-of GRk) 1) | |
3531 | (clobber GRk)) | |
c7a48b9a | 3532 | ((fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3533 | ) |
3534 | ||
3535 | ; Multiplication | |
3536 | ; | |
3537 | (define-pmacro (multiply-r-r name signop op ope comment) | |
3538 | (dni name | |
3539 | (comment) | |
676a64f4 RS |
3540 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3541 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3542 | (.str name "$pack $GRi,$GRj,$GRdoublek") |
3543 | (+ pack GRdoublek op GRi (ICCi_1-null) ope GRj) | |
3544 | (set GRdoublek (mul DI (signop DI GRi) (signop DI GRj))) | |
676a64f4 | 3545 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 3546 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
3547 | ) |
3548 | ) | |
3549 | ||
3550 | (multiply-r-r smul ext OP_00 OPE2_08 "signed multiply reg/reg") | |
3551 | (multiply-r-r umul zext OP_00 OPE2_0A "unsigned multiply reg/reg") | |
3552 | ||
ac7c07ac DB |
3553 | ; Multiplication with integer accumulator IACC |
3554 | ; | |
3555 | ||
3556 | (define-pmacro (iacc-set value) | |
3557 | (set (reg h-iacc0 0) value)) | |
3558 | ||
3559 | (define-pmacro (iacc-add value) | |
3560 | (set (reg h-iacc0 0) | |
3561 | (cond DI | |
3562 | ((andif (andif (gt value 0) (gt (reg h-iacc0 0) 0)) | |
3563 | (lt (sub DI #x7fffffffffffffff value) (reg h-iacc0 0))) | |
3564 | ; Positive overflow | |
3565 | (const DI #x7fffffffffffffff)) | |
3566 | ((andif (andif (lt value 0) (lt (reg h-iacc0 0) 0)) | |
3567 | (gt (sub DI #x8000000000000000 value) (reg h-iacc0 0))) | |
3568 | ; Negative overflow | |
3569 | (const DI #x8000000000000000)) | |
3570 | (else | |
3571 | (add DI (reg h-iacc0 0) value)))) | |
3572 | ) | |
3573 | ||
3574 | (define-pmacro (iacc-sub value) | |
3575 | (set (reg h-iacc0 0) | |
3576 | (cond DI | |
3577 | ((andif (andif (lt value 0) (gt (reg h-iacc0 0) 0)) | |
3578 | (lt (add DI #x7fffffffffffffff value) (reg h-iacc0 0))) | |
3579 | ; Positive overflow | |
3580 | (const DI #x7fffffffffffffff)) | |
3581 | ((andif (andif (gt value 0) (lt (reg h-iacc0 0) 0)) | |
3582 | (gt (add DI #x8000000000000000 value) (reg h-iacc0 0))) | |
3583 | ; Negative overflow | |
3584 | (const DI #x8000000000000000)) | |
3585 | (else | |
3586 | (sub DI (reg h-iacc0 0) value)))) | |
3587 | ) | |
3588 | ||
3589 | (define-pmacro (iacc-multiply-r-r name operation op ope comment) | |
3590 | (dni name | |
3591 | (comment) | |
676a64f4 RS |
3592 | ((UNIT IACC) (MACH fr400,fr450) |
3593 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO) | |
ac7c07ac DB |
3594 | (.str name "$pack $GRi,$GRj") |
3595 | (+ pack (rd-null) op GRi ope GRj) | |
3596 | ((.sym iacc- operation) (mul DI (ext DI GRi) (ext DI GRj))) | |
676a64f4 | 3597 | ((fr400 (unit u-integer)) (fr450 (unit u-integer))) |
ac7c07ac DB |
3598 | ) |
3599 | ) | |
3600 | ||
3601 | (iacc-multiply-r-r smu set OP_46 OPE1_05 "Signed multiply reg/reg/iacc") | |
3602 | (iacc-multiply-r-r smass add OP_46 OPE1_06 "Signed multiply/add reg/reg/iacc") | |
3603 | (iacc-multiply-r-r smsss sub OP_46 OPE1_07 "Signed multiply/sub reg/reg/iacc") | |
3604 | ||
9aab5aa3 AC |
3605 | (define-pmacro (int-shift-r-r name op ope comment) |
3606 | (dni name | |
3607 | (comment) | |
676a64f4 RS |
3608 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3609 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3610 | (.str name "$pack $GRi,$GRj,$GRk") |
3611 | (+ pack GRk op GRi (ICCi_1-null) ope GRj) | |
3612 | (set GRk (name GRi (and GRj #x1f))) | |
676a64f4 | 3613 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3614 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3615 | ) |
3616 | ) | |
3617 | ||
3618 | (int-shift-r-r sll OP_01 OPE2_08 "shift left logical reg/reg") | |
3619 | (int-shift-r-r srl OP_01 OPE2_0A "shift right logical reg/reg") | |
3620 | (int-shift-r-r sra OP_01 OPE2_0C "shift right arith reg/reg") | |
3621 | ||
ac7c07ac DB |
3622 | (dni slass |
3623 | "shift left arith reg/reg with saturation" | |
676a64f4 RS |
3624 | ((UNIT IALL) (MACH fr400,fr450) |
3625 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO) | |
ac7c07ac DB |
3626 | "slass$pack $GRi,$GRj,$GRk" |
3627 | (+ pack GRk OP_46 GRi OPE1_02 GRj) | |
3628 | (set GRk (c-call SI "@cpu@_shift_left_arith_saturate" GRi GRj)) | |
3629 | () | |
3630 | ) | |
3631 | ||
3632 | (dni scutss | |
3633 | "Integer accumulator cut with saturation" | |
676a64f4 RS |
3634 | ((UNIT I0) (MACH fr400,fr450) |
3635 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO) | |
ac7c07ac DB |
3636 | "scutss$pack $GRj,$GRk" |
3637 | (+ pack GRk OP_46 (rs-null) OPE1_04 GRj) | |
3638 | (set GRk (c-call SI "@cpu@_iacc_cut" (reg h-iacc0 0) GRj)) | |
3639 | () | |
3640 | ) | |
3641 | ||
9aab5aa3 AC |
3642 | (define-pmacro (scan-semantics arg1 arg2 targ) |
3643 | (sequence ((WI tmp1) (WI tmp2)) | |
3644 | (set tmp1 arg1) | |
3645 | (set tmp2 (sra arg2 1)) | |
3646 | (set targ (c-call WI "@cpu@_scan_result" (xor tmp1 tmp2)))) | |
3647 | ) | |
3648 | ||
3649 | (dni scan | |
3650 | "scan" | |
676a64f4 RS |
3651 | ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3652 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3653 | "scan$pack $GRi,$GRj,$GRk" |
3654 | (+ pack GRk OP_0B GRi (ICCi_1-null) OPE2_00 GRj) | |
3655 | (scan-semantics GRi GRj GRk) | |
676a64f4 | 3656 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3657 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3658 | ) |
3659 | ||
3660 | ; Format: conditional INT, Logic, Shift r-r | |
3661 | ; | |
3662 | (define-pmacro (conditional-int-logic name operation op ope comment) | |
3663 | (dni name | |
3664 | (comment) | |
676a64f4 RS |
3665 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3666 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3667 | (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond") |
3668 | (+ pack GRk op GRi CCi cond ope GRj) | |
3669 | (if (eq CCi (or cond 2)) | |
3670 | (set GRk (operation GRi GRj))) | |
676a64f4 | 3671 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3672 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3673 | ) |
3674 | ) | |
3675 | ||
3676 | (conditional-int-logic cadd add OP_58 OPE4_0 "conditional add") | |
3677 | (conditional-int-logic csub sub OP_58 OPE4_1 "conditional sub") | |
3678 | (conditional-int-logic cand and OP_5A OPE4_0 "conditional and") | |
3679 | (conditional-int-logic cor or OP_5A OPE4_1 "conditional or") | |
3680 | (conditional-int-logic cxor xor OP_5A OPE4_2 "conditional xor") | |
3681 | ||
3682 | (dni cnot | |
3683 | "conditional not" | |
676a64f4 RS |
3684 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3685 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3686 | "cnot$pack $GRj,$GRk,$CCi,$cond" |
3687 | (+ pack GRk OP_5A (rs-null) CCi cond OPE4_3 GRj) | |
3688 | (if (eq CCi (or cond 2)) | |
3689 | (set GRk (inv GRj))) | |
676a64f4 | 3690 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3691 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3692 | ) |
3693 | ||
3694 | (dni csmul | |
3695 | "conditional signed multiply" | |
676a64f4 RS |
3696 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3697 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3698 | "csmul$pack $GRi,$GRj,$GRdoublek,$CCi,$cond" |
3699 | (+ pack GRdoublek OP_58 GRi CCi cond OPE4_2 GRj) | |
3700 | (if (eq CCi (or cond 2)) | |
3701 | (set GRdoublek (mul DI (ext DI GRi) (ext DI GRj)))) | |
676a64f4 | 3702 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 3703 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
3704 | ) |
3705 | ||
3706 | (dni csdiv | |
3707 | "conditional signed division" | |
676a64f4 RS |
3708 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3709 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3710 | "csdiv$pack $GRi,$GRj,$GRk,$CCi,$cond" |
3711 | (+ pack GRk OP_58 GRi CCi cond OPE4_3 GRj) | |
3712 | (if (eq CCi (or cond 2)) | |
3713 | (sequence () | |
3714 | (c-call VOID "@cpu@_signed_integer_divide" | |
3715 | GRi GRj (index-of GRk) 0) | |
3716 | (clobber GRk))) | |
676a64f4 | 3717 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 3718 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3719 | ) |
3720 | ||
3721 | (dni cudiv | |
3722 | "conditional unsigned division" | |
676a64f4 RS |
3723 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3724 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3725 | "cudiv$pack $GRi,$GRj,$GRk,$CCi,$cond" |
3726 | (+ pack GRk OP_59 GRi CCi cond OPE4_3 GRj) | |
3727 | (if (eq CCi (or cond 2)) | |
3728 | (sequence () | |
3729 | (c-call VOID "@cpu@_unsigned_integer_divide" | |
3730 | GRi GRj (index-of GRk) 0) | |
3731 | (clobber GRk))) | |
676a64f4 | 3732 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 3733 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
3734 | ) |
3735 | ||
3736 | (define-pmacro (conditional-shift name operation op ope comment) | |
3737 | (dni name | |
3738 | (comment) | |
676a64f4 RS |
3739 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3740 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3741 | (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond") |
3742 | (+ pack GRk op GRi CCi cond ope GRj) | |
3743 | (if (eq CCi (or cond 2)) | |
3744 | (set GRk (operation GRi (and GRj #x1f)))) | |
676a64f4 | 3745 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3746 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3747 | ) |
3748 | ) | |
3749 | ||
3750 | (conditional-shift csll sll OP_5C OPE4_0 "conditional shift left logical") | |
3751 | (conditional-shift csrl srl OP_5C OPE4_1 "conditional shift right logical") | |
3752 | (conditional-shift csra sra OP_5C OPE4_2 "conditional shift right arith") | |
3753 | ||
3754 | (dni cscan | |
3755 | "conditional scan" | |
676a64f4 RS |
3756 | ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3757 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3758 | "cscan$pack $GRi,$GRj,$GRk,$CCi,$cond" |
3759 | (+ pack GRk OP_65 GRi CCi cond OPE4_3 GRj) | |
3760 | (if (eq CCi (or cond 2)) | |
3761 | (scan-semantics GRi GRj GRk)) | |
676a64f4 | 3762 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3763 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3764 | ) |
3765 | ||
3766 | ; Format: INT, Logic, Shift, cc r-r | |
3767 | ; | |
3768 | (define-pmacro (int-arith-cc-semantics operation icc) | |
3769 | (sequence ((BI tmp) (QI cc) (SI result)) | |
3770 | (set cc icc) | |
3771 | (set tmp ((.sym operation -oflag) GRi GRj (const 0))) | |
3772 | (set-v cc tmp) | |
3773 | (set tmp ((.sym operation -cflag) GRi GRj (const 0))) | |
3774 | (set-c cc tmp) | |
3775 | (set result (operation GRi GRj)) | |
3776 | (set-z-and-n cc result) | |
3777 | (set GRk result) | |
3778 | (set icc cc)) | |
3779 | ) | |
3780 | ||
3781 | (define-pmacro (int-arith-cc-r-r name operation op ope comment) | |
3782 | (dni name | |
3783 | (comment) | |
676a64f4 RS |
3784 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3785 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3786 | (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1") |
3787 | (+ pack GRk op GRi ICCi_1 ope GRj) | |
3788 | (int-arith-cc-semantics operation ICCi_1) | |
676a64f4 | 3789 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3790 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3791 | ) |
3792 | ) | |
3793 | ||
3794 | (int-arith-cc-r-r addcc add OP_00 OPE2_01 "add reg/reg, set icc") | |
3795 | (int-arith-cc-r-r subcc sub OP_00 OPE2_05 "sub reg/reg, set icc") | |
3796 | ||
3797 | (define-pmacro (int-logic-cc-semantics op icc) | |
3798 | (sequence ((SI tmp)) | |
3799 | (set tmp (op GRi GRj)) | |
3800 | (set GRk tmp) | |
3801 | (set-z-and-n icc tmp)) | |
3802 | ) | |
3803 | ||
3804 | (define-pmacro (int-logic-cc-r-r name op ope comment) | |
3805 | (dni (.sym name cc) | |
3806 | (comment) | |
676a64f4 RS |
3807 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3808 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3809 | (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1") |
3810 | (+ pack GRk op GRi ICCi_1 ope GRj) | |
3811 | (int-logic-cc-semantics name ICCi_1) | |
676a64f4 | 3812 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3813 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3814 | ) |
3815 | ) | |
3816 | ||
3817 | (int-logic-cc-r-r and OP_01 OPE2_01 "and reg/reg, set icc") | |
3818 | (int-logic-cc-r-r or OP_01 OPE2_03 "or reg/reg, set icc") | |
3819 | (int-logic-cc-r-r xor OP_01 OPE2_05 "xor reg/reg, set icc") | |
3820 | ||
3821 | (define-pmacro (int-shift-cc-semantics op l-r icc) | |
3822 | (sequence ((WI shift) (SI tmp) (QI cc)) | |
3823 | (set shift (and GRj #x1f)) | |
3824 | (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r) | |
3825 | GRi shift icc)) | |
3826 | (set tmp (op GRi shift)) | |
3827 | (set GRk tmp) | |
3828 | (set-z-and-n cc tmp) | |
3829 | (set icc cc)) | |
3830 | ) | |
3831 | ||
3832 | (define-pmacro (int-shift-cc-r-r name l-r op ope comment) | |
3833 | (dni (.sym name cc) | |
3834 | (comment) | |
676a64f4 RS |
3835 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3836 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3837 | (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1") |
3838 | (+ pack GRk op GRi ICCi_1 ope GRj) | |
3839 | (int-shift-cc-semantics name l-r ICCi_1) | |
676a64f4 | 3840 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3841 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3842 | ) |
3843 | ) | |
3844 | ||
3845 | (int-shift-cc-r-r sll left OP_01 OPE2_09 "shift left logical reg/reg,set icc") | |
3846 | (int-shift-cc-r-r srl right OP_01 OPE2_0B "shift right logical reg/reg,set icc") | |
3847 | (int-shift-cc-r-r sra right OP_01 OPE2_0D "shift right arith reg/reg,set icc") | |
3848 | ||
3849 | (define-pmacro (multiply-cc-semantics signop arg1 arg2 targ icc) | |
3850 | (sequence ((DI tmp) (QI cc)) | |
3851 | (set cc icc) | |
3852 | (set tmp (mul DI (signop DI arg1) (signop DI arg2))) | |
3853 | (set-n cc (srl DI tmp 63)) | |
3854 | (set-z cc (eq tmp 0)) | |
3855 | (set targ tmp) | |
3856 | (set icc cc)) | |
3857 | ) | |
3858 | ||
3859 | (define-pmacro (multiply-cc-r-r name signop op ope comment) | |
3860 | (dni name | |
3861 | (comment) | |
676a64f4 RS |
3862 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3863 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3864 | (.str name "$pack $GRi,$GRj,$GRdoublek,$ICCi_1") |
3865 | (+ pack GRdoublek op GRi ICCi_1 ope GRj) | |
3866 | (multiply-cc-semantics signop GRi GRj GRdoublek ICCi_1) | |
676a64f4 | 3867 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 3868 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
3869 | ) |
3870 | ) | |
3871 | ||
3872 | (multiply-cc-r-r smulcc ext OP_00 OPE2_09 "signed multiply reg/reg") | |
3873 | (multiply-cc-r-r umulcc zext OP_00 OPE2_0B "unsigned multiply reg/reg") | |
3874 | ||
3875 | ||
3876 | ; Format: conditional INT, Logic, Shift, cc r-r | |
3877 | ; | |
3878 | (define-pmacro (conditional-int-arith-cc name operation op ope comment) | |
3879 | (dni name | |
3880 | (comment) | |
676a64f4 RS |
3881 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3882 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3883 | (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond") |
3884 | (+ pack GRk op GRi CCi cond ope GRj) | |
3885 | (if (eq CCi (or cond 2)) | |
3886 | (int-arith-cc-semantics operation | |
3887 | (reg h-iccr (and (index-of CCi) 3)))) | |
676a64f4 | 3888 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3889 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3890 | ) |
3891 | ) | |
3892 | ||
3893 | (conditional-int-arith-cc caddcc add OP_59 OPE4_0 "add, set icc") | |
3894 | (conditional-int-arith-cc csubcc sub OP_59 OPE4_1 "sub, set icc") | |
3895 | ||
3896 | (dni csmulcc | |
3897 | "conditional signed multiply and set condition code" | |
676a64f4 RS |
3898 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
3899 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3900 | "csmulcc$pack $GRi,$GRj,$GRdoublek,$CCi,$cond" |
3901 | (+ pack GRdoublek OP_59 GRi CCi cond OPE4_2 GRj) | |
3902 | (if (eq CCi (or cond 2)) | |
3903 | (multiply-cc-semantics ext GRi GRj GRdoublek | |
3904 | (reg h-iccr (and (index-of CCi) 3)))) | |
676a64f4 | 3905 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 3906 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
3907 | ) |
3908 | ||
3909 | (define-pmacro (conditional-int-logic-cc name operation op ope comment) | |
3910 | (dni name | |
3911 | (comment) | |
676a64f4 RS |
3912 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3913 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3914 | (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond") |
3915 | (+ pack GRk op GRi CCi cond ope GRj) | |
3916 | (if (eq CCi (or cond 2)) | |
3917 | (int-logic-cc-semantics operation | |
3918 | (reg h-iccr (and (index-of CCi) 3)))) | |
676a64f4 | 3919 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3920 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3921 | ) |
3922 | ) | |
3923 | ||
3924 | (conditional-int-logic-cc candcc and OP_5B OPE4_0 "conditional and, set icc") | |
3925 | (conditional-int-logic-cc corcc or OP_5B OPE4_1 "conditional or , set icc") | |
3926 | (conditional-int-logic-cc cxorcc xor OP_5B OPE4_2 "conditional xor, set icc") | |
3927 | ||
3928 | (define-pmacro (conditional-int-shift-cc name l-r op ope comment) | |
3929 | (dni (.sym c name cc) | |
3930 | (comment) | |
676a64f4 RS |
3931 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3932 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
3933 | (.str (.sym c name cc) "$pack $GRi,$GRj,$GRk,$CCi,$cond") |
3934 | (+ pack GRk op GRi CCi cond ope GRj) | |
3935 | (if (eq CCi (or cond 2)) | |
3936 | (int-shift-cc-semantics name l-r | |
3937 | (reg h-iccr (and (index-of CCi) 3)))) | |
676a64f4 | 3938 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3939 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3940 | ) |
3941 | ) | |
3942 | ||
3943 | (conditional-int-shift-cc sll left OP_5D OPE4_0 "shift left logical, set icc") | |
3944 | (conditional-int-shift-cc srl right OP_5D OPE4_1 "shift right logical, set icc") | |
3945 | (conditional-int-shift-cc sra right OP_5D OPE4_2 "shift right arith , set icc") | |
3946 | ||
3947 | ; Add and subtract with carry | |
3948 | ; | |
3949 | (define-pmacro (int-arith-x-r-r name operation op ope comment) | |
3950 | (dni name | |
3951 | (comment) | |
676a64f4 RS |
3952 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3953 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3954 | (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1") |
3955 | (+ pack GRk op GRi ICCi_1 ope GRj) | |
3956 | (set GRk ((.sym operation c) GRi GRj (cbit ICCi_1))) | |
676a64f4 | 3957 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3958 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3959 | ) |
3960 | ) | |
3961 | ||
3962 | (int-arith-x-r-r addx add OP_00 OPE2_02 "Add reg/reg, with carry") | |
3963 | (int-arith-x-r-r subx sub OP_00 OPE2_06 "Sub reg/reg, with carry") | |
3964 | ||
3965 | (define-pmacro (int-arith-x-cc-r-r name operation op ope comment) | |
3966 | (dni name | |
3967 | (comment) | |
676a64f4 RS |
3968 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
3969 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
3970 | (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1") |
3971 | (+ pack GRk op GRi ICCi_1 ope GRj) | |
3972 | (sequence ((WI tmp) (QI cc)) | |
3973 | (set cc ICCi_1) | |
3974 | (set tmp ((.sym operation c) GRi GRj (cbit cc))) | |
3975 | (set-v cc ((.sym operation -oflag) GRi GRj (cbit cc))) | |
3976 | (set-c cc ((.sym operation -cflag) GRi GRj (cbit cc))) | |
3977 | (set-z-and-n cc tmp) | |
3978 | (set GRk tmp) | |
3979 | (set ICCi_1 cc)) | |
676a64f4 | 3980 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 3981 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
3982 | ) |
3983 | ) | |
3984 | ||
3985 | (int-arith-x-cc-r-r addxcc add OP_00 OPE2_03 "Add reg/reg, use/set carry") | |
3986 | (int-arith-x-cc-r-r subxcc sub OP_00 OPE2_07 "Sub reg/reg, use/set carry") | |
ac7c07ac DB |
3987 | ; Add and subtract with saturation |
3988 | ; | |
3989 | (define-pmacro (int-arith-ss-r-r name operation op ope comment) | |
3990 | (dni name | |
3991 | (comment) | |
676a64f4 RS |
3992 | ((UNIT IALL) (MACH fr400,fr450) |
3993 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO) | |
ac7c07ac DB |
3994 | (.str name "$pack $GRi,$GRj,$GRk") |
3995 | (+ pack GRk op GRi ope GRj) | |
3996 | (sequence () | |
3997 | (set GRk (operation GRi GRj)) | |
3998 | (if ((.sym operation -oflag) GRi GRj (const 0)) | |
3999 | ; Overflow, saturate. | |
4000 | ; Sign of result will be | |
4001 | ; same as sign of first operand. | |
4002 | (set GRk | |
4003 | (cond SI | |
4004 | ((gt GRi 0) (const #x7fffffff)) | |
4005 | ((lt GRi 0) (const #x80000000)) | |
4006 | (else (const 0))))) | |
4007 | ) | |
676a64f4 | 4008 | ((fr400 (unit u-integer)) (fr450 (unit u-integer))) |
ac7c07ac DB |
4009 | ) |
4010 | ) | |
4011 | ||
4012 | (int-arith-ss-r-r addss add OP_46 OPE1_00 "add reg/reg, with saturation") | |
4013 | (int-arith-ss-r-r subss sub OP_46 OPE1_01 "sub reg/reg, with saturation") | |
9aab5aa3 AC |
4014 | |
4015 | ; Format: INT, Logic, Shift r-simm | |
4016 | ; | |
4017 | (define-pmacro (int-logic-r-simm name operation op comment) | |
4018 | (dni name | |
4019 | (comment) | |
676a64f4 RS |
4020 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4021 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4022 | (.str name "$pack $GRi,$s12,$GRk") |
4023 | (+ pack GRk op GRi s12) | |
4024 | (set GRk (operation GRi s12)) | |
676a64f4 | 4025 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4026 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4027 | ) |
4028 | ) | |
4029 | ||
4030 | (int-logic-r-simm addi add OP_10 "add reg/immed") | |
4031 | (int-logic-r-simm subi sub OP_14 "sub reg/immed") | |
4032 | (int-logic-r-simm andi and OP_20 "and reg/immed") | |
4033 | (int-logic-r-simm ori or OP_22 "or reg/immed") | |
4034 | (int-logic-r-simm xori xor OP_24 "xor reg/immed") | |
4035 | ||
4036 | (dni sdivi | |
4037 | "signed division reg/immed" | |
676a64f4 RS |
4038 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
4039 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4040 | "sdivi$pack $GRi,$s12,$GRk" |
4041 | (+ pack GRk OP_1E GRi s12) | |
4042 | (sequence () | |
4043 | (c-call VOID "@cpu@_signed_integer_divide" | |
4044 | GRi s12 (index-of GRk) 0) | |
4045 | (clobber GRk)) | |
676a64f4 | 4046 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 4047 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
4048 | ) |
4049 | ||
4050 | (dni nsdivi | |
4051 | "non excepting signed division reg/immed" | |
ac7c07ac DB |
4052 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING |
4053 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4054 | "nsdivi$pack $GRi,$s12,$GRk" |
4055 | (+ pack GRk OP_2E GRi s12) | |
4056 | (sequence () | |
4057 | (c-call VOID "@cpu@_signed_integer_divide" | |
4058 | GRi s12 (index-of GRk) 1) | |
4059 | (clobber GRk)) | |
c7a48b9a | 4060 | ((fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
4061 | ) |
4062 | ||
4063 | (dni udivi | |
4064 | "unsigned division reg/immed" | |
676a64f4 RS |
4065 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
4066 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4067 | "udivi$pack $GRi,$s12,$GRk" |
4068 | (+ pack GRk OP_1F GRi s12) | |
4069 | (sequence () | |
4070 | (c-call VOID "@cpu@_unsigned_integer_divide" | |
4071 | GRi s12 (index-of GRk) 0) | |
4072 | (clobber GRk)) | |
676a64f4 | 4073 | ((fr400 (unit u-idiv)) (fr450 (unit u-idiv)) |
ac7c07ac | 4074 | (fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
4075 | ) |
4076 | ||
4077 | (dni nudivi | |
4078 | "non excepting unsigned division reg/immed" | |
ac7c07ac DB |
4079 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING |
4080 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4081 | "nudivi$pack $GRi,$s12,$GRk" |
4082 | (+ pack GRk OP_2F GRi s12) | |
4083 | (sequence () | |
4084 | (c-call VOID "@cpu@_unsigned_integer_divide" | |
4085 | GRi s12 (index-of GRk) 1) | |
4086 | (clobber GRk)) | |
c7a48b9a | 4087 | ((fr500 (unit u-idiv)) (fr550 (unit u-idiv))) |
9aab5aa3 AC |
4088 | ) |
4089 | ||
4090 | (define-pmacro (multiply-r-simm name signop op comment) | |
4091 | (dni name | |
4092 | (comment) | |
676a64f4 RS |
4093 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
4094 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4095 | (.str name "$pack $GRi,$s12,$GRdoublek") |
4096 | (+ pack GRdoublek op GRi s12) | |
4097 | (set GRdoublek (mul DI (signop DI GRi) (signop DI s12))) | |
676a64f4 | 4098 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 4099 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
4100 | ) |
4101 | ) | |
4102 | ||
4103 | (multiply-r-simm smuli ext OP_18 "signed multiply reg/immed") | |
4104 | (multiply-r-simm umuli zext OP_1A "unsigned multiply reg/immed") | |
4105 | ||
4106 | (define-pmacro (int-shift-r-simm name op comment) | |
4107 | (dni (.sym name i) | |
4108 | (comment) | |
676a64f4 RS |
4109 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4110 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4111 | (.str (.sym name i) "$pack $GRi,$s12,$GRk") |
4112 | (+ pack GRk op GRi s12) | |
4113 | (set GRk (name GRi (and s12 #x1f))) | |
676a64f4 | 4114 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4115 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4116 | ) |
4117 | ) | |
4118 | ||
4119 | (int-shift-r-simm sll OP_28 "shift left logical reg/immed") | |
4120 | (int-shift-r-simm srl OP_2A "shift right logical reg/immed") | |
4121 | (int-shift-r-simm sra OP_2C "shift right arith reg/immed") | |
4122 | ||
4123 | (dni scani | |
4124 | "scan immediate" | |
676a64f4 RS |
4125 | ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4126 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4127 | "scani$pack $GRi,$s12,$GRk" |
4128 | (+ pack GRk OP_47 GRi s12) | |
4129 | (scan-semantics GRi s12 GRk) | |
676a64f4 | 4130 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4131 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4132 | ) |
4133 | ||
4134 | ; Format: INT, Logic, Shift cc r-simm | |
4135 | ; | |
4136 | (define-pmacro (int-arith-cc-r-simm name operation op comment) | |
4137 | (dni name | |
4138 | (comment) | |
676a64f4 RS |
4139 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4140 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4141 | (.str name "$pack $GRi,$s10,$GRk,$ICCi_1") |
4142 | (+ pack GRk op GRi ICCi_1 s10) | |
4143 | (sequence ((BI tmp) (QI cc) (SI result)) | |
4144 | (set cc ICCi_1) | |
4145 | (set tmp ((.sym operation -oflag) GRi s10 (const 0))) | |
4146 | (set-v cc tmp) | |
4147 | (set tmp ((.sym operation -cflag) GRi s10 (const 0))) | |
4148 | (set-c cc tmp) | |
4149 | (set result (operation GRi s10)) | |
4150 | (set-z-and-n cc result) | |
4151 | (set GRk result) | |
4152 | (set ICCi_1 cc)) | |
676a64f4 | 4153 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4154 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4155 | ) |
4156 | ) | |
4157 | ||
4158 | (int-arith-cc-r-simm addicc add OP_11 "add reg/immed, set icc") | |
4159 | (int-arith-cc-r-simm subicc sub OP_15 "sub reg/immed, set icc") | |
4160 | ||
4161 | (define-pmacro (int-logic-cc-r-simm name op comment) | |
4162 | (dni (.sym name icc) | |
4163 | (comment) | |
676a64f4 RS |
4164 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4165 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4166 | (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1") |
4167 | (+ pack GRk op GRi ICCi_1 s10) | |
4168 | (sequence ((SI tmp)) | |
4169 | (set tmp (name GRi s10)) | |
4170 | (set GRk tmp) | |
4171 | (set-z-and-n ICCi_1 tmp)) | |
676a64f4 | 4172 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4173 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4174 | ) |
4175 | ) | |
4176 | ||
4177 | (int-logic-cc-r-simm and OP_21 "and reg/immed, set icc") | |
4178 | (int-logic-cc-r-simm or OP_23 "or reg/immed, set icc") | |
4179 | (int-logic-cc-r-simm xor OP_25 "xor reg/immed, set icc") | |
4180 | ||
4181 | (define-pmacro (multiply-cc-r-simm name signop op comment) | |
4182 | (dni name | |
4183 | (comment) | |
676a64f4 RS |
4184 | ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) |
4185 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4186 | (.str name "$pack $GRi,$s10,$GRdoublek,$ICCi_1") |
4187 | (+ pack GRdoublek op GRi ICCi_1 s10) | |
4188 | (multiply-cc-semantics signop GRi s10 GRdoublek ICCi_1) | |
676a64f4 | 4189 | ((fr400 (unit u-imul)) (fr450 (unit u-imul)) |
ac7c07ac | 4190 | (fr500 (unit u-imul)) (fr550 (unit u-imul))) |
9aab5aa3 AC |
4191 | ) |
4192 | ) | |
4193 | ||
4194 | (multiply-cc-r-simm smulicc ext OP_19 "signed multiply reg/immed") | |
4195 | (multiply-cc-r-simm umulicc zext OP_1B "unsigned multiply reg/immed") | |
4196 | ||
4197 | (define-pmacro (int-shift-cc-r-simm name l-r op comment) | |
4198 | (dni (.sym name icc) | |
4199 | (comment) | |
676a64f4 RS |
4200 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4201 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4202 | (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1") |
4203 | (+ pack GRk op GRi ICCi_1 s10) | |
4204 | (sequence ((WI shift) (SI tmp) (QI cc)) | |
4205 | (set shift (and s10 #x1f)) | |
4206 | (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r) | |
4207 | GRi shift ICCi_1)) | |
4208 | (set tmp (name GRi shift)) | |
4209 | (set GRk tmp) | |
4210 | (set-z-and-n cc tmp) | |
4211 | (set ICCi_1 cc)) | |
676a64f4 | 4212 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4213 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4214 | ) |
4215 | ) | |
4216 | ||
4217 | (int-shift-cc-r-simm sll left OP_29 "shift left logical reg/immed, set icc") | |
4218 | (int-shift-cc-r-simm srl right OP_2B "shift right logical reg/immed, set icc") | |
4219 | (int-shift-cc-r-simm sra right OP_2D "shift right arith reg/immed, set icc") | |
4220 | ||
4221 | (define-pmacro (int-arith-x-r-simm name operation op comment) | |
4222 | (dni name | |
4223 | (comment) | |
676a64f4 RS |
4224 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4225 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4226 | (.str name "$pack $GRi,$s10,$GRk,$ICCi_1") |
4227 | (+ pack GRk op GRi ICCi_1 s10) | |
4228 | (set GRk ((.sym operation c) GRi s10 (cbit ICCi_1))) | |
676a64f4 | 4229 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4230 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4231 | ) |
4232 | ) | |
4233 | ||
4234 | (int-arith-x-r-simm addxi add OP_12 "Add reg/immed, with carry") | |
4235 | (int-arith-x-r-simm subxi sub OP_16 "Sub reg/immed, with carry") | |
4236 | ||
4237 | (define-pmacro (int-arith-x-cc-r-simm name operation op comment) | |
4238 | (dni name | |
4239 | (comment) | |
676a64f4 RS |
4240 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4241 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4242 | (.str name "$pack $GRi,$s10,$GRk,$ICCi_1") |
4243 | (+ pack GRk op GRi ICCi_1 s10) | |
4244 | (sequence ((WI tmp) (QI cc)) | |
4245 | (set cc ICCi_1) | |
4246 | (set tmp ((.sym operation c) GRi s10 (cbit cc))) | |
4247 | (set-v cc ((.sym operation -oflag) GRi s10 (cbit cc))) | |
4248 | (set-c cc ((.sym operation -cflag) GRi s10 (cbit cc))) | |
4249 | (set-z-and-n cc tmp) | |
4250 | (set GRk tmp) | |
4251 | (set ICCi_1 cc)) | |
676a64f4 | 4252 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4253 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4254 | ) |
4255 | ) | |
4256 | ||
4257 | (int-arith-x-cc-r-simm addxicc add OP_13 "Add reg/immed, with carry") | |
4258 | (int-arith-x-cc-r-simm subxicc sub OP_17 "Sub reg/immed, with carry") | |
4259 | ||
4260 | ; Byte compare insns | |
4261 | ||
4262 | (dni cmpb | |
4263 | "Compare bytes" | |
676a64f4 RS |
4264 | ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1) |
4265 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4266 | "cmpb$pack $GRi,$GRj,$ICCi_1" |
4267 | (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0C GRj) | |
4268 | (sequence ((QI cc)) | |
4269 | (set-n cc (eq (and GRi #xff000000) (and GRj #xff000000))) | |
4270 | (set-z cc (eq (and GRi #x00ff0000) (and GRj #x00ff0000))) | |
4271 | (set-v cc (eq (and GRi #x0000ff00) (and GRj #x0000ff00))) | |
4272 | (set-c cc (eq (and GRi #x000000ff) (and GRj #x000000ff))) | |
4273 | (set ICCi_1 cc)) | |
676a64f4 RS |
4274 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
4275 | (fr550 (unit u-integer))) | |
9aab5aa3 AC |
4276 | ) |
4277 | ||
4278 | (dni cmpba | |
4279 | "OR of Compare bytes" | |
676a64f4 RS |
4280 | ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1) |
4281 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4282 | "cmpba$pack $GRi,$GRj,$ICCi_1" |
4283 | (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0D GRj) | |
4284 | (sequence ((QI cc)) | |
4285 | (set cc 0) | |
4286 | (set-c cc | |
4287 | (orif (eq (and GRi #xff000000) (and GRj #xff000000)) | |
4288 | (orif (eq (and GRi #x00ff0000) (and GRj #x00ff0000)) | |
4289 | (orif (eq (and GRi #x0000ff00) | |
4290 | (and GRj #x0000ff00)) | |
4291 | (eq (and GRi #x000000ff) | |
4292 | (and GRj #x000000ff)))))) | |
4293 | (set ICCi_1 cc)) | |
676a64f4 RS |
4294 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
4295 | (fr550 (unit u-integer))) | |
9aab5aa3 AC |
4296 | ) |
4297 | ||
4298 | ; Format: Load immediate | |
4299 | ; | |
4300 | (dni setlo | |
4301 | "set low order bits" | |
676a64f4 RS |
4302 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4303 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4304 | "setlo$pack $ulo16,$GRklo" |
4305 | (+ pack GRk OP_3D (misc-null-4) u16) | |
4306 | (set GRklo u16) | |
676a64f4 | 4307 | ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo)) |
ac7c07ac | 4308 | (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo))) |
9aab5aa3 AC |
4309 | ) |
4310 | ||
4311 | (dni sethi | |
4312 | "set high order bits" | |
676a64f4 RS |
4313 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4314 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4315 | "sethi$pack $uhi16,$GRkhi" |
4316 | (+ pack GRkhi OP_3E (misc-null-4) u16) | |
4317 | (set GRkhi u16) | |
676a64f4 | 4318 | ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo)) |
ac7c07ac | 4319 | (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo))) |
9aab5aa3 AC |
4320 | ) |
4321 | ||
4322 | (dni setlos | |
4323 | "set low order bits and extend sign" | |
676a64f4 RS |
4324 | ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1) |
4325 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
4326 | "setlos$pack $slo16,$GRk" |
4327 | (+ pack GRk OP_3F (misc-null-4) s16) | |
4328 | (set GRk s16) | |
676a64f4 | 4329 | ((fr400 (unit u-integer)) (fr450 (unit u-integer)) |
ac7c07ac | 4330 | (fr500 (unit u-integer)) (fr550 (unit u-integer))) |
9aab5aa3 AC |
4331 | ) |
4332 | ||
90219bd0 | 4333 | (define-pmacro (load-gr-r name mode op ope comment ann) |
9aab5aa3 AC |
4334 | (dni name |
4335 | (comment) | |
676a64f4 RS |
4336 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4337 | (FR400-MAJOR I-2) (FR450-MAJOR I-2)) | |
90219bd0 | 4338 | (.str name "$pack " ann "($GRi,$GRj),$GRk") |
9aab5aa3 AC |
4339 | (+ pack GRk op GRi ope GRj) |
4340 | (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))) | |
676a64f4 | 4341 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
ac7c07ac | 4342 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4343 | ) |
4344 | ) | |
4345 | ||
90219bd0 AO |
4346 | (dann ldann "ld annotation" SI "ld_annotation" "at") |
4347 | ||
4348 | (load-gr-r ldsb QI OP_02 OPE1_00 "Load signed byte" "@") | |
4349 | (load-gr-r ldub UQI OP_02 OPE1_01 "Load unsigned byte" "@") | |
4350 | (load-gr-r ldsh HI OP_02 OPE1_02 "Load signed half" "@") | |
4351 | (load-gr-r lduh UHI OP_02 OPE1_03 "Load unsigned half" "@") | |
4352 | (load-gr-r ld SI OP_02 OPE1_04 "Load word" "$ldann") | |
9aab5aa3 AC |
4353 | |
4354 | (define-pmacro (load-fr-r name mode op ope comment) | |
4355 | (dni name | |
4356 | (comment) | |
676a64f4 RS |
4357 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4358 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS) | |
9aab5aa3 AC |
4359 | (.str name "$pack @($GRi,$GRj),$FRintk") |
4360 | (+ pack FRintk op GRi ope GRj) | |
4361 | (set FRintk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))) | |
676a64f4 | 4362 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
ac7c07ac | 4363 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
4364 | ) |
4365 | ) | |
4366 | ||
4367 | (load-fr-r ldbf UQI OP_02 OPE1_08 "Load byte float") | |
4368 | (load-fr-r ldhf UHI OP_02 OPE1_09 "Load half float") | |
4369 | (load-fr-r ldf SI OP_02 OPE1_0A "Load word float") | |
4370 | ||
4371 | (define-pmacro (load-cpr-r name mode op ope reg attr comment) | |
4372 | (dni name | |
4373 | (comment) | |
4374 | ((UNIT LOAD) (FR500-MAJOR I-2) attr) | |
4375 | (.str name "$pack @($GRi,$GRj),$" reg "k") | |
4376 | (+ pack (.sym reg k) op GRi ope GRj) | |
4377 | (set (.sym reg k) | |
4378 | (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))) | |
4379 | () | |
4380 | ) | |
4381 | ) | |
4382 | ||
4383 | (load-cpr-r ldc SI OP_02 OPE1_0D CPR (MACH frv) "Load coprocessor word") | |
4384 | ||
4385 | ; These correspond to enumerators in frv-sim.h | |
4386 | (define-pmacro (ne-UQI-size) 0) | |
4387 | (define-pmacro (ne-QI-size) 1) | |
4388 | (define-pmacro (ne-UHI-size) 2) | |
4389 | (define-pmacro (ne-HI-size) 3) | |
4390 | (define-pmacro (ne-SI-size) 4) | |
4391 | (define-pmacro (ne-DI-size) 5) | |
4392 | (define-pmacro (ne-XI-size) 6) | |
4393 | ||
4394 | (define-pmacro (ne-load-semantics base dispix targ idisp size is_float action) | |
4395 | (sequence ((BI do_op)) | |
4396 | (set do_op | |
4397 | (c-call BI "@cpu@_check_non_excepting_load" | |
4398 | (index-of base) dispix (index-of targ) | |
4399 | idisp size is_float)) | |
4400 | (if do_op action)) | |
4401 | ) | |
4402 | ||
4403 | (define-pmacro (ne-load-gr-r name mode op ope size comment) | |
4404 | (dni name | |
4405 | (comment) | |
ac7c07ac DB |
4406 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING |
4407 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4408 | (.str name "$pack @($GRi,$GRj),$GRk") |
4409 | (+ pack GRk op GRi ope GRj) | |
4410 | (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 | |
4411 | (set GRk | |
4412 | (c-call mode (.str "@cpu@_read_mem_" mode) | |
4413 | pc (add GRi GRj)))) | |
ac7c07ac | 4414 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4415 | ) |
4416 | ) | |
4417 | ||
4418 | (ne-load-gr-r nldsb QI OP_02 OPE1_20 (ne-QI-size) "Load signed byte") | |
4419 | (ne-load-gr-r nldub UQI OP_02 OPE1_21 (ne-UQI-size) "Load unsigned byte") | |
4420 | (ne-load-gr-r nldsh HI OP_02 OPE1_22 (ne-HI-size) "Load signed half") | |
4421 | (ne-load-gr-r nlduh UHI OP_02 OPE1_23 (ne-UHI-size) "Load unsigned half") | |
4422 | (ne-load-gr-r nld SI OP_02 OPE1_24 (ne-SI-size) "Load word") | |
4423 | ||
4424 | (define-pmacro (ne-load-fr-r name mode op ope size comment) | |
4425 | (dni name | |
4426 | (comment) | |
ac7c07ac DB |
4427 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS |
4428 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4429 | (.str name "$pack @($GRi,$GRj),$FRintk") |
4430 | (+ pack FRintk op GRi ope GRj) | |
4431 | (ne-load-semantics GRi (index-of GRj) FRintk 0 size 1 | |
4432 | (set FRintk | |
4433 | (c-call mode (.str "@cpu@_read_mem_" mode) | |
4434 | pc (add GRi GRj)))) | |
ac7c07ac | 4435 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
4436 | ) |
4437 | ) | |
4438 | ||
4439 | (ne-load-fr-r nldbf UQI OP_02 OPE1_28 (ne-UQI-size) "Load byte float") | |
4440 | (ne-load-fr-r nldhf UHI OP_02 OPE1_29 (ne-UHI-size) "Load half float") | |
4441 | (ne-load-fr-r nldf SI OP_02 OPE1_2A (ne-SI-size) "Load word float") | |
4442 | ||
4443 | ; Semantics for a load-double insn | |
4444 | ; | |
4445 | (define-pmacro (load-double-semantics not_gr mode regtype address arg) | |
4446 | (if (orif not_gr (ne (index-of (.sym regtype doublek)) 0)) | |
4447 | (sequence () | |
4448 | (set address (add GRi arg)) | |
4449 | (set (.sym regtype doublek) | |
4450 | (c-call mode (.str "@cpu@_read_mem_" mode) pc address)))) | |
4451 | ) | |
4452 | ||
4453 | (define-pmacro (load-double-r-r | |
90219bd0 | 4454 | name not_gr mode op ope regtype attr profile comment ann) |
9aab5aa3 AC |
4455 | (dni name |
4456 | (comment) | |
676a64f4 RS |
4457 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4458 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr) | |
90219bd0 | 4459 | (.str name "$pack " ann "($GRi,$GRj),$" regtype "doublek") |
9aab5aa3 AC |
4460 | (+ pack (.sym regtype doublek) op GRi ope GRj) |
4461 | (sequence ((WI address)) | |
4462 | (load-double-semantics not_gr mode regtype address GRj)) | |
4463 | profile | |
4464 | ) | |
4465 | ) | |
4466 | ||
90219bd0 AO |
4467 | (dann lddann "ldd annotation" SI "ldd_annotation" "at") |
4468 | ||
9aab5aa3 | 4469 | (load-double-r-r ldd 0 DI OP_02 OPE1_05 GR NA |
676a64f4 RS |
4470 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4471 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
90219bd0 | 4472 | "Load double word" "$lddann") |
9aab5aa3 | 4473 | (load-double-r-r lddf 1 DF OP_02 OPE1_0B FR FR-ACCESS |
676a64f4 RS |
4474 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4475 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
90219bd0 | 4476 | "Load double float" "@") |
9aab5aa3 | 4477 | (load-double-r-r lddc 1 DI OP_02 OPE1_0E CPR (MACH frv) () |
90219bd0 | 4478 | "Load coprocessor double" "@") |
9aab5aa3 AC |
4479 | |
4480 | (define-pmacro (ne-load-double-r-r | |
4481 | name not_gr mode op ope regtype size is_float attr profile | |
4482 | comment) | |
4483 | (dni name | |
4484 | (comment) | |
ac7c07ac DB |
4485 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr |
4486 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4487 | (.str name "$pack @($GRi,$GRj),$" regtype "doublek") |
4488 | (+ pack (.sym regtype doublek) op GRi ope GRj) | |
4489 | (sequence ((WI address)) | |
4490 | (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek) | |
4491 | 0 size is_float | |
4492 | (load-double-semantics not_gr mode | |
4493 | regtype | |
4494 | address GRj))) | |
4495 | profile | |
4496 | ) | |
4497 | ) | |
4498 | ||
4499 | (ne-load-double-r-r nldd 0 DI OP_02 OPE1_25 GR (ne-DI-size) 0 NA | |
ac7c07ac | 4500 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word") |
9aab5aa3 | 4501 | (ne-load-double-r-r nlddf 1 DF OP_02 OPE1_2B FR (ne-DI-size) 1 FR-ACCESS |
ac7c07ac | 4502 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float") |
9aab5aa3 AC |
4503 | |
4504 | ; Semantics for a load-quad insn | |
4505 | ; | |
4506 | (define-pmacro (load-quad-semantics regtype address arg) | |
4507 | (sequence () | |
4508 | (set address (add GRi arg)) | |
4509 | (c-call VOID (.str "@cpu@_load_quad_" regtype) | |
4510 | pc address (index-of (.sym regtype k)))) | |
4511 | ) | |
4512 | ||
4513 | (define-pmacro (load-quad-r-r name op ope regtype attr profile comment) | |
4514 | (dni name | |
4515 | (comment) | |
4516 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr) | |
4517 | (.str name "$pack @($GRi,$GRj),$" regtype "k") | |
4518 | (+ pack (.sym regtype k) op GRi ope GRj) | |
4519 | (sequence ((WI address)) | |
4520 | (load-quad-semantics regtype address GRj)) | |
4521 | ; TODO regtype-k not referenced for profiling | |
4522 | profile | |
4523 | ) | |
4524 | ) | |
4525 | ||
4526 | (load-quad-r-r ldq OP_02 OPE1_06 GR NA ((fr500 (unit u-gr-load))) | |
4527 | "Load quad word") | |
4528 | (load-quad-r-r ldqf OP_02 OPE1_0C FRint FR-ACCESS ((fr500 (unit u-fr-load))) | |
4529 | "Load quad float") | |
4530 | (load-quad-r-r ldqc OP_02 OPE1_0F CPR NA () "Load coprocessor quad") | |
4531 | ||
4532 | (define-pmacro (ne-load-quad-r-r | |
4533 | name op ope regtype size is_float attr profile comment) | |
4534 | (dni name | |
4535 | (comment) | |
4536 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr) | |
4537 | (.str name "$pack @($GRi,$GRj),$" regtype "k") | |
4538 | (+ pack (.sym regtype k) op GRi ope GRj) | |
4539 | (sequence ((WI address)) | |
4540 | (ne-load-semantics GRi (index-of GRj) (.sym regtype k) | |
4541 | 0 size is_float | |
4542 | (load-quad-semantics regtype address GRj))) | |
4543 | ; TODO regtype-k not referenced for profiling | |
4544 | profile | |
4545 | ) | |
4546 | ) | |
4547 | ||
4548 | (ne-load-quad-r-r nldq OP_02 OPE1_26 GR (ne-XI-size) 0 NA | |
4549 | ((fr500 (unit u-gr-load))) "Load quad word") | |
4550 | (ne-load-quad-r-r nldqf OP_02 OPE1_2C FRint (ne-XI-size) 1 FR-ACCESS | |
4551 | ((fr500 (unit u-fr-load))) "Load quad float") | |
4552 | ||
4553 | (define-pmacro (load-gr-u-semantics mode) | |
4554 | (sequence ((UWI address)) | |
4555 | (set address (add GRi GRj)) | |
4556 | (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc address)) | |
4557 | (if (ne (index-of GRi) (index-of GRk)) | |
4558 | (sequence () | |
4559 | (set GRi address) | |
4560 | (c-call VOID "@cpu@_force_update")))) | |
4561 | ) | |
4562 | ||
4563 | (define-pmacro (load-gr-u name mode op ope comment) | |
4564 | (dni name | |
4565 | (comment) | |
676a64f4 RS |
4566 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4567 | (FR400-MAJOR I-2) (FR450-MAJOR I-2)) | |
9aab5aa3 AC |
4568 | (.str name "$pack @($GRi,$GRj),$GRk") |
4569 | (+ pack GRk op GRi ope GRj) | |
4570 | (load-gr-u-semantics mode) | |
676a64f4 | 4571 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
ac7c07ac | 4572 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4573 | ) |
4574 | ) | |
4575 | ||
4576 | (load-gr-u ldsbu QI OP_02 OPE1_10 "Load signed byte, update index") | |
4577 | (load-gr-u ldubu UQI OP_02 OPE1_11 "Load unsigned byte, update index") | |
4578 | (load-gr-u ldshu HI OP_02 OPE1_12 "Load signed half, update index") | |
4579 | (load-gr-u lduhu UHI OP_02 OPE1_13 "Load unsigned half, update index") | |
4580 | (load-gr-u ldu SI OP_02 OPE1_14 "Load word, update index") | |
4581 | ||
4582 | (define-pmacro (ne-load-gr-u name mode op ope size comment) | |
4583 | (dni name | |
4584 | (comment) | |
ac7c07ac DB |
4585 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING |
4586 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4587 | (.str name "$pack @($GRi,$GRj),$GRk") |
4588 | (+ pack GRk op GRi ope GRj) | |
4589 | (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 (load-gr-u-semantics mode)) | |
ac7c07ac | 4590 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4591 | ) |
4592 | ) | |
4593 | ||
4594 | (ne-load-gr-u nldsbu QI OP_02 OPE1_30 (ne-QI-size) "Load signed byte, update index") | |
4595 | (ne-load-gr-u nldubu UQI OP_02 OPE1_31 (ne-UQI-size) "Load unsigned byte, update index") | |
4596 | (ne-load-gr-u nldshu HI OP_02 OPE1_32 (ne-HI-size) "Load signed half, update index") | |
4597 | (ne-load-gr-u nlduhu UHI OP_02 OPE1_33 (ne-UHI-size) "Load unsigned half, update index") | |
4598 | (ne-load-gr-u nldu SI OP_02 OPE1_34 (ne-SI-size) "Load word, update index") | |
4599 | ||
4600 | (define-pmacro (load-non-gr-u-semantics mode regtype) | |
4601 | (sequence ((UWI address)) | |
4602 | (set address (add GRi GRj)) | |
4603 | (set (.sym regtype k) | |
4604 | (c-call mode (.str "@cpu@_read_mem_" mode) pc address)) | |
4605 | (set GRi address) | |
4606 | (c-call VOID "@cpu@_force_update")) | |
4607 | ) | |
4608 | ||
4609 | (define-pmacro (load-fr-u name mode op ope comment) | |
4610 | (dni name | |
4611 | (comment) | |
676a64f4 RS |
4612 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4613 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS) | |
9aab5aa3 AC |
4614 | (.str name "$pack @($GRi,$GRj),$FRintk") |
4615 | (+ pack FRintk op GRi ope GRj) | |
4616 | (load-non-gr-u-semantics mode FRint) | |
676a64f4 | 4617 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
ac7c07ac | 4618 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
4619 | ) |
4620 | ) | |
4621 | ||
4622 | (load-fr-u ldbfu UQI OP_02 OPE1_18 "Load byte float, update index") | |
4623 | (load-fr-u ldhfu UHI OP_02 OPE1_19 "Load half float, update index") | |
4624 | (load-fr-u ldfu SI OP_02 OPE1_1A "Load word float, update index") | |
4625 | ||
4626 | (define-pmacro (load-cpr-u name mode op ope comment) | |
4627 | (dni name | |
4628 | (comment) | |
4629 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv)) | |
4630 | (.str name "$pack @($GRi,$GRj),$CPRk") | |
4631 | (+ pack CPRk op GRi ope GRj) | |
4632 | (load-non-gr-u-semantics mode CPR) | |
4633 | () | |
4634 | ) | |
4635 | ) | |
4636 | ||
4637 | (load-cpr-u ldcu SI OP_02 OPE1_1D "Load coprocessor word float,update index") | |
4638 | ||
4639 | (define-pmacro (ne-load-non-gr-u name mode op ope regtype size comment) | |
4640 | (dni name | |
4641 | (comment) | |
ac7c07ac DB |
4642 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS |
4643 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4644 | (.str name "$pack @($GRi,$GRj),$" regtype "k") |
4645 | (+ pack (.sym regtype k) op GRi ope GRj) | |
4646 | (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1 | |
4647 | (load-non-gr-u-semantics mode regtype)) | |
ac7c07ac | 4648 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
4649 | ) |
4650 | ) | |
4651 | ||
4652 | (ne-load-non-gr-u nldbfu UQI OP_02 OPE1_38 FRint (ne-UQI-size) "Load byte float, update index") | |
4653 | (ne-load-non-gr-u nldhfu UHI OP_02 OPE1_39 FRint (ne-UHI-size) "Load half float, update index") | |
4654 | (ne-load-non-gr-u nldfu SI OP_02 OPE1_3A FRint (ne-SI-size) "Load word float, update index") | |
4655 | ||
4656 | (define-pmacro (load-double-gr-u-semantics) | |
4657 | (sequence ((WI address)) | |
4658 | (load-double-semantics 0 DI GR address GRj) | |
4659 | (if (ne (index-of GRi) (index-of GRdoublek)) | |
4660 | (sequence () | |
4661 | (set GRi address) | |
4662 | (c-call VOID "@cpu@_force_update")))) | |
4663 | ) | |
4664 | ||
4665 | (define-pmacro (load-double-gr-u name op ope comment) | |
4666 | (dni name | |
4667 | (comment) | |
676a64f4 RS |
4668 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4669 | (FR400-MAJOR I-2) (FR450-MAJOR I-2)) | |
9aab5aa3 AC |
4670 | (.str name "$pack @($GRi,$GRj),$GRdoublek") |
4671 | (+ pack GRdoublek op GRi ope GRj) | |
4672 | (load-double-gr-u-semantics) | |
676a64f4 | 4673 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
ac7c07ac | 4674 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4675 | ) |
4676 | ) | |
4677 | ||
4678 | (load-double-gr-u lddu OP_02 OPE1_15 "Load double word, update index") | |
4679 | ||
4680 | (define-pmacro (ne-load-double-gr-u name op ope size comment) | |
4681 | (dni name | |
4682 | (comment) | |
ac7c07ac DB |
4683 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING |
4684 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4685 | (.str name "$pack @($GRi,$GRj),$GRdoublek") |
4686 | (+ pack GRdoublek op GRi ope GRj) | |
4687 | (ne-load-semantics GRi (index-of GRj) GRdoublek 0 size 0 | |
4688 | (load-double-gr-u-semantics)) | |
ac7c07ac | 4689 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
4690 | |
4691 | ) | |
4692 | ) | |
4693 | ||
4694 | (ne-load-double-gr-u nlddu OP_02 OPE1_35 (ne-DI-size) "Load double word, update index") | |
4695 | ||
4696 | (define-pmacro (load-double-non-gr-u-semantics mode regtype) | |
4697 | (sequence ((WI address)) | |
4698 | (load-double-semantics 1 mode regtype address GRj) | |
4699 | (set GRi address) | |
4700 | (c-call VOID "@cpu@_force_update")) | |
4701 | ) | |
4702 | ||
4703 | (define-pmacro (load-double-non-gr-u | |
4704 | name mode op ope regtype attr profile comment) | |
4705 | (dni name | |
4706 | (comment) | |
676a64f4 RS |
4707 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4708 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr) | |
9aab5aa3 AC |
4709 | (.str name "$pack @($GRi,$GRj),$" regtype "doublek") |
4710 | (+ pack (.sym regtype doublek) op GRi ope GRj) | |
4711 | (load-double-non-gr-u-semantics mode regtype) | |
4712 | profile | |
4713 | ) | |
4714 | ) | |
4715 | ||
4716 | (load-double-non-gr-u lddfu DF OP_02 OPE1_1B FR FR-ACCESS | |
676a64f4 RS |
4717 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4718 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
4719 | "Load double float, update index") |
4720 | (load-double-non-gr-u lddcu DI OP_02 OPE1_1E CPR (MACH frv) | |
4721 | () "Load coprocessor double float, update index") | |
4722 | ||
4723 | (define-pmacro (ne-load-double-non-gr-u name mode op ope regtype size comment) | |
4724 | (dni name | |
4725 | (comment) | |
ac7c07ac DB |
4726 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS |
4727 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4728 | (.str name "$pack @($GRi,$GRj),$" regtype "doublek") |
4729 | (+ pack (.sym regtype doublek) op GRi ope GRj) | |
4730 | (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek) 0 size 1 | |
4731 | (load-double-non-gr-u-semantics mode regtype)) | |
ac7c07ac | 4732 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
4733 | ) |
4734 | ) | |
4735 | ||
4736 | (ne-load-double-non-gr-u nlddfu DF OP_02 OPE1_3B FR (ne-DI-size) "Load double float, update index") | |
4737 | ||
4738 | (define-pmacro (load-quad-gr-u-semantics) | |
4739 | (sequence ((WI address)) | |
4740 | (load-quad-semantics GR address GRj) | |
4741 | (if (ne (index-of GRi) (index-of GRk)) | |
4742 | (sequence () | |
4743 | (set GRi address) | |
4744 | (c-call VOID "@cpu@_force_update")))) | |
4745 | ) | |
4746 | ||
4747 | (define-pmacro (load-quad-gr-u name op ope comment) | |
4748 | (dni name | |
4749 | (comment) | |
4750 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv)) | |
4751 | (.str name "$pack @($GRi,$GRj),$GRk") | |
4752 | (+ pack GRk op GRi ope GRj) | |
4753 | (load-quad-gr-u-semantics) | |
4754 | ; TODO - GRk not referenced here for profiling | |
4755 | ((fr500 (unit u-gr-load))) | |
4756 | ) | |
4757 | ) | |
4758 | ||
4759 | (load-quad-gr-u ldqu OP_02 OPE1_16 "Load quad word, update index") | |
4760 | ||
4761 | (define-pmacro (ne-load-quad-gr-u name op ope size comment) | |
4762 | (dni name | |
4763 | (comment) | |
4764 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING) | |
4765 | (.str name "$pack @($GRi,$GRj),$GRk") | |
4766 | (+ pack GRk op GRi ope GRj) | |
4767 | (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 | |
4768 | (load-quad-gr-u-semantics)) | |
4769 | ; TODO - GRk not referenced here for profiling | |
4770 | ((fr500 (unit u-gr-load))) | |
4771 | ) | |
4772 | ) | |
4773 | ||
4774 | (ne-load-quad-gr-u nldqu OP_02 OPE1_36 (ne-XI-size) "Load quad word, update index") | |
4775 | ||
4776 | (define-pmacro (load-quad-non-gr-u-semantics regtype) | |
4777 | (sequence ((WI address)) | |
4778 | (load-quad-semantics regtype address GRj) | |
4779 | (set GRi address) | |
4780 | (c-call VOID "@cpu@_force_update")) | |
4781 | ) | |
4782 | ||
4783 | (define-pmacro (load-quad-non-gr-u name op ope regtype attr profile comment) | |
4784 | (dni name | |
4785 | (comment) | |
4786 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr) | |
4787 | (.str name "$pack @($GRi,$GRj),$" regtype "k") | |
4788 | (+ pack (.sym regtype k) op GRi ope GRj) | |
4789 | (load-quad-non-gr-u-semantics regtype) | |
4790 | profile | |
4791 | ) | |
4792 | ) | |
4793 | ||
4794 | (load-quad-non-gr-u ldqfu OP_02 OPE1_1C FRint FR-ACCESS | |
4795 | ((fr500 (unit u-fr-load))) "Load quad float, update index") | |
4796 | (load-quad-non-gr-u ldqcu OP_02 OPE1_1F CPR NA | |
4797 | () "Load coprocessor quad word, update index") | |
4798 | ||
4799 | (define-pmacro (ne-load-quad-non-gr-u name op ope regtype size comment) | |
4800 | (dni name | |
4801 | (comment) | |
4802 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING FR-ACCESS) | |
4803 | (.str name "$pack @($GRi,$GRj),$" regtype "k") | |
4804 | (+ pack (.sym regtype k) op GRi ope GRj) | |
4805 | (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1 | |
4806 | (load-quad-non-gr-u-semantics regtype)) | |
4807 | ((fr500 (unit u-fr-load))) | |
4808 | ) | |
4809 | ) | |
4810 | ||
4811 | (ne-load-quad-non-gr-u nldqfu OP_02 OPE1_3C FRint (ne-XI-size) "Load quad float,update index") | |
4812 | ||
4813 | (define-pmacro (load-r-simm name mode op regtype attr profile comment) | |
4814 | (dni name | |
4815 | (comment) | |
676a64f4 RS |
4816 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4817 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr) | |
9aab5aa3 AC |
4818 | (.str name "$pack @($GRi,$d12),$" regtype "k") |
4819 | (+ pack (.sym regtype k) op GRi d12) | |
4820 | (set (.sym regtype k) | |
4821 | (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi d12))) | |
4822 | profile | |
4823 | ) | |
4824 | ) | |
4825 | ||
4826 | (load-r-simm ldsbi QI OP_30 GR NA | |
676a64f4 RS |
4827 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4828 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4829 | "Load signed byte") |
4830 | (load-r-simm ldshi HI OP_31 GR NA | |
676a64f4 RS |
4831 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4832 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4833 | "Load signed half") |
4834 | (load-r-simm ldi SI OP_32 GR NA | |
676a64f4 RS |
4835 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4836 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4837 | "Load word") |
4838 | (load-r-simm ldubi UQI OP_35 GR NA | |
676a64f4 RS |
4839 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4840 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4841 | "Load unsigned byte") |
4842 | (load-r-simm lduhi UHI OP_36 GR NA | |
676a64f4 RS |
4843 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4844 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4845 | "Load unsigned half") |
4846 | ||
4847 | (load-r-simm ldbfi UQI OP_38 FRint FR-ACCESS | |
676a64f4 RS |
4848 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4849 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
4850 | "Load byte float") |
4851 | (load-r-simm ldhfi UHI OP_39 FRint FR-ACCESS | |
676a64f4 RS |
4852 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4853 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
4854 | "Load half float") |
4855 | (load-r-simm ldfi SI OP_3A FRint FR-ACCESS | |
676a64f4 RS |
4856 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4857 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
4858 | "Load word float") |
4859 | ||
4860 | (define-pmacro (ne-load-r-simm | |
4861 | name mode op regtype size is_float attr profile comment) | |
4862 | (dni name | |
4863 | (comment) | |
ac7c07ac DB |
4864 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr |
4865 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4866 | (.str name "$pack @($GRi,$d12),$" regtype "k") |
4867 | (+ pack (.sym regtype k) op GRi d12) | |
4868 | (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float | |
4869 | (set (.sym regtype k) | |
4870 | (c-call mode (.str "@cpu@_read_mem_" mode) | |
4871 | pc (add GRi d12)))) | |
4872 | profile | |
4873 | ) | |
4874 | ) | |
4875 | ||
4876 | (ne-load-r-simm nldsbi QI OP_40 GR (ne-QI-size) 0 NA | |
ac7c07ac | 4877 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed byte") |
9aab5aa3 | 4878 | (ne-load-r-simm nldubi UQI OP_41 GR (ne-UQI-size) 0 NA |
ac7c07ac | 4879 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned byte") |
9aab5aa3 | 4880 | (ne-load-r-simm nldshi HI OP_42 GR (ne-HI-size) 0 NA |
ac7c07ac | 4881 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed half") |
9aab5aa3 | 4882 | (ne-load-r-simm nlduhi UHI OP_43 GR (ne-UHI-size) 0 NA |
ac7c07ac | 4883 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned half") |
9aab5aa3 | 4884 | (ne-load-r-simm nldi SI OP_44 GR (ne-SI-size) 0 NA |
ac7c07ac | 4885 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load word") |
9aab5aa3 AC |
4886 | |
4887 | (ne-load-r-simm nldbfi UQI OP_48 FRint (ne-UQI-size) 1 FR-ACCESS | |
ac7c07ac | 4888 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load byte float") |
9aab5aa3 | 4889 | (ne-load-r-simm nldhfi UHI OP_49 FRint (ne-UHI-size) 1 FR-ACCESS |
ac7c07ac | 4890 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load half float") |
9aab5aa3 | 4891 | (ne-load-r-simm nldfi SI OP_4A FRint (ne-SI-size) 1 FR-ACCESS |
ac7c07ac | 4892 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load word float") |
9aab5aa3 AC |
4893 | |
4894 | (define-pmacro (load-double-r-simm | |
4895 | name not_gr mode op regtype attr profile comment) | |
4896 | (dni name | |
4897 | (comment) | |
676a64f4 RS |
4898 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
4899 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr) | |
9aab5aa3 AC |
4900 | (.str name "$pack @($GRi,$d12),$" regtype "doublek") |
4901 | (+ pack (.sym regtype doublek) op GRi d12) | |
4902 | (sequence ((WI address)) | |
4903 | (load-double-semantics not_gr mode regtype address d12)) | |
4904 | profile | |
4905 | ) | |
4906 | ) | |
4907 | ||
4908 | (load-double-r-simm lddi 0 DI OP_33 GR NA | |
676a64f4 RS |
4909 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
4910 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
4911 | "Load double word") |
4912 | (load-double-r-simm lddfi 1 DF OP_3B FR FR-ACCESS | |
676a64f4 RS |
4913 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
4914 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
4915 | "Load double float") |
4916 | ||
4917 | (define-pmacro (ne-load-double-r-simm | |
4918 | name not_gr mode op regtype size is_float attr profile comment) | |
4919 | (dni name | |
4920 | (comment) | |
ac7c07ac DB |
4921 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr |
4922 | (MACH simple,tomcat,fr500,fr550,frv)) | |
9aab5aa3 AC |
4923 | (.str name "$pack @($GRi,$d12),$" regtype "doublek") |
4924 | (+ pack (.sym regtype doublek) op GRi d12) | |
4925 | (sequence ((WI address)) | |
4926 | (ne-load-semantics GRi -1 (.sym regtype doublek) | |
4927 | d12 size is_float | |
4928 | (load-double-semantics not_gr mode | |
4929 | regtype | |
4930 | address d12))) | |
4931 | profile | |
4932 | ) | |
4933 | ) | |
4934 | ||
4935 | (ne-load-double-r-simm nlddi 0 DI OP_45 GR (ne-DI-size) 0 NA | |
ac7c07ac | 4936 | ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word") |
9aab5aa3 | 4937 | (ne-load-double-r-simm nlddfi 1 DF OP_4B FR (ne-DI-size) 1 FR-ACCESS |
ac7c07ac | 4938 | ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float") |
9aab5aa3 AC |
4939 | |
4940 | (define-pmacro (load-quad-r-simm name op regtype attr profile comment) | |
4941 | (dni name | |
4942 | (comment) | |
4943 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr) | |
4944 | (.str name "$pack @($GRi,$d12),$" regtype "k") | |
4945 | (+ pack (.sym regtype k) op GRi d12) | |
4946 | (sequence ((WI address)) | |
4947 | (load-quad-semantics regtype address d12)) | |
4948 | profile | |
4949 | ) | |
4950 | ) | |
4951 | ||
4952 | (load-quad-r-simm ldqi OP_34 GR NA | |
4953 | ((fr500 (unit u-gr-load))) "Load quad word") | |
4954 | (load-quad-r-simm ldqfi OP_3C FRint FR-ACCESS | |
4955 | ((fr500 (unit u-fr-load))) "Load quad float") | |
4956 | ||
4957 | (define-pmacro (ne-load-quad-r-simm | |
4958 | name op regtype size is_float attr profile comment) | |
4959 | (dni name | |
4960 | (comment) | |
4961 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr) | |
4962 | (.str name "$pack @($GRi,$d12),$" regtype "k") | |
4963 | (+ pack (.sym regtype k) op GRi d12) | |
4964 | (sequence ((WI address)) | |
4965 | (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float | |
4966 | (load-quad-semantics regtype address d12))) | |
4967 | profile | |
4968 | ) | |
4969 | ) | |
4970 | ||
9aab5aa3 AC |
4971 | (ne-load-quad-r-simm nldqfi OP_4C FRint (ne-XI-size) 1 FR-ACCESS |
4972 | ((fr500 (unit u-fr-load))) "Load quad float") | |
4973 | ||
4974 | (define-pmacro (store-r-r name mode op ope reg attr profile comment) | |
4975 | (dni name | |
4976 | (comment) | |
676a64f4 RS |
4977 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
4978 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
9aab5aa3 AC |
4979 | (.str name "$pack $" reg "k,@($GRi,$GRj)") |
4980 | (+ pack (.sym reg k) op GRi ope GRj) | |
4981 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
4982 | pc (add GRi GRj) (.sym reg k)) | |
4983 | profile | |
4984 | ) | |
4985 | ) | |
4986 | ||
4987 | (store-r-r stb QI OP_03 OPE1_00 GR NA | |
676a64f4 RS |
4988 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
4989 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
4990 | "Store unsigned byte") |
4991 | (store-r-r sth HI OP_03 OPE1_01 GR NA | |
676a64f4 RS |
4992 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
4993 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
4994 | "Store unsigned half") |
4995 | (store-r-r st SI OP_03 OPE1_02 GR NA | |
676a64f4 RS |
4996 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
4997 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
4998 | "Store word") |
4999 | ||
5000 | (store-r-r stbf QI OP_03 OPE1_08 FRint FR-ACCESS | |
676a64f4 RS |
5001 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5002 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5003 | "Store byte float") |
5004 | (store-r-r sthf HI OP_03 OPE1_09 FRint FR-ACCESS | |
676a64f4 RS |
5005 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5006 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5007 | "Store half float") |
5008 | (store-r-r stf SI OP_03 OPE1_0A FRint FR-ACCESS | |
676a64f4 RS |
5009 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5010 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5011 | "Store word float") |
5012 | ||
5013 | (store-r-r stc SI OP_03 OPE1_25 CPR (MACH frv) () "Store coprocessor word") | |
5014 | ||
9aab5aa3 AC |
5015 | ; Semantics for a store-double insn |
5016 | ; | |
5017 | (define-pmacro (store-double-semantics mode regtype address arg) | |
5018 | (sequence () | |
5019 | (set address (add GRi arg)) | |
5020 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
5021 | pc address (.sym regtype doublek))) | |
5022 | ) | |
5023 | ||
5024 | (define-pmacro (store-double-r-r name mode op ope regtype attr profile comment) | |
5025 | (dni name | |
5026 | (comment) | |
676a64f4 RS |
5027 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5028 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
1340b9a9 DB |
5029 | (.str name "$pack $" regtype "doublek,@($GRi,$GRj)") |
5030 | (+ pack (.sym regtype doublek) op GRi ope GRj) | |
9aab5aa3 AC |
5031 | (sequence ((WI address)) |
5032 | (store-double-semantics mode regtype address GRj)) | |
5033 | profile | |
5034 | ) | |
5035 | ) | |
5036 | ||
5037 | (store-double-r-r std DI OP_03 OPE1_03 GR NA | |
676a64f4 RS |
5038 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5039 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5040 | "Store double word") |
5041 | (store-double-r-r stdf DF OP_03 OPE1_0B FR FR-ACCESS | |
676a64f4 RS |
5042 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5043 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5044 | "Store double float") |
5045 | ||
5046 | (store-double-r-r stdc DI OP_03 OPE1_26 CPR (MACH frv) | |
5047 | () "Store coprocessor double word") | |
5048 | ||
9aab5aa3 AC |
5049 | ; Semantics for a store-quad insn |
5050 | ; | |
5051 | (define-pmacro (store-quad-semantics regtype address arg) | |
5052 | (sequence () | |
5053 | (set address (add GRi arg)) | |
5054 | (c-call VOID (.str "@cpu@_store_quad_" regtype) | |
5055 | pc address (index-of (.sym regtype k)))) | |
5056 | ) | |
5057 | ||
5058 | (define-pmacro (store-quad-r-r name op ope regtype attr profile comment) | |
5059 | (dni name | |
5060 | (comment) | |
8caa9169 | 5061 | ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr) |
9aab5aa3 AC |
5062 | (.str name "$pack $" regtype "k,@($GRi,$GRj)") |
5063 | (+ pack (.sym regtype k) op GRi ope GRj) | |
5064 | (sequence ((WI address)) | |
5065 | (store-quad-semantics regtype address GRj)) | |
5066 | profile | |
5067 | ) | |
5068 | ) | |
5069 | ||
5070 | (store-quad-r-r stq OP_03 OPE1_04 GR NA | |
5071 | ((fr500 (unit u-gr-store))) "Store quad word") | |
5072 | (store-quad-r-r stqf OP_03 OPE1_0C FRint FR-ACCESS | |
5073 | ((fr500 (unit u-fr-store))) | |
5074 | "Store quad float") | |
5075 | (store-quad-r-r stqc OP_03 OPE1_27 CPR NA | |
5076 | () "Store coprocessor quad word") | |
5077 | ||
9aab5aa3 AC |
5078 | (define-pmacro (store-r-r-u name mode op ope regtype attr profile comment) |
5079 | (dni name | |
5080 | (comment) | |
676a64f4 RS |
5081 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5082 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
9aab5aa3 AC |
5083 | (.str name "$pack $" regtype "k,@($GRi,$GRj)") |
5084 | (+ pack (.sym regtype k) op GRi ope GRj) | |
5085 | (sequence ((UWI address)) | |
5086 | (set address (add GRi GRj)) | |
5087 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
5088 | pc address (.sym regtype k)) | |
5089 | (set GRi address)) | |
5090 | profile | |
5091 | ) | |
5092 | ) | |
5093 | ||
5094 | (store-r-r-u stbu QI OP_03 OPE1_10 GR NA | |
676a64f4 RS |
5095 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5096 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5097 | "Store unsigned byte, update index") |
5098 | (store-r-r-u sthu HI OP_03 OPE1_11 GR NA | |
676a64f4 RS |
5099 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5100 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5101 | "Store unsigned half, update index") |
5102 | (store-r-r-u stu WI OP_03 OPE1_12 GR NA | |
676a64f4 RS |
5103 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5104 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5105 | "Store word, update index") |
5106 | ||
5107 | (store-r-r-u stbfu QI OP_03 OPE1_18 FRint FR-ACCESS | |
676a64f4 RS |
5108 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5109 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5110 | "Store byte float, update index") |
5111 | (store-r-r-u sthfu HI OP_03 OPE1_19 FRint FR-ACCESS | |
676a64f4 RS |
5112 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5113 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5114 | "Store half float, update index") |
5115 | (store-r-r-u stfu SI OP_03 OPE1_1A FRint FR-ACCESS | |
676a64f4 RS |
5116 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5117 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5118 | "Store word float, update index") |
5119 | ||
5120 | (store-r-r-u stcu SI OP_03 OPE1_2D CPR (MACH frv) () | |
5121 | "Store coprocessor word, update index") | |
5122 | ||
5123 | (define-pmacro (store-double-r-r-u | |
5124 | name mode op ope regtype attr profile comment) | |
5125 | (dni name | |
5126 | (comment) | |
676a64f4 RS |
5127 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5128 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
1340b9a9 DB |
5129 | (.str name "$pack $" regtype "doublek,@($GRi,$GRj)") |
5130 | (+ pack (.sym regtype doublek) op GRi ope GRj) | |
9aab5aa3 AC |
5131 | (sequence ((WI address)) |
5132 | (store-double-semantics mode regtype address GRj) | |
5133 | (set GRi address)) | |
5134 | profile | |
5135 | ) | |
5136 | ) | |
5137 | ||
5138 | (store-double-r-r-u stdu DI OP_03 OPE1_13 GR NA | |
676a64f4 RS |
5139 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5140 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5141 | "Store double word, update index") |
5142 | (store-double-r-r-u stdfu DF OP_03 OPE1_1B FR FR-ACCESS | |
676a64f4 RS |
5143 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5144 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5145 | "Store double float,update index") |
5146 | (store-double-r-r-u stdcu DI OP_03 OPE1_2E CPR (MACH frv) () | |
5147 | "Store coprocessor double word, update index") | |
5148 | ||
5149 | (define-pmacro (store-quad-r-r-u name op ope regtype attr profile comment) | |
5150 | (dni name | |
5151 | (comment) | |
8caa9169 | 5152 | ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr) |
9aab5aa3 AC |
5153 | (.str name "$pack $" regtype "k,@($GRi,$GRj)") |
5154 | (+ pack (.sym regtype k) op GRi ope GRj) | |
5155 | (sequence ((WI address)) | |
5156 | (store-quad-semantics regtype address GRj) | |
5157 | (set GRi address)) | |
5158 | profile | |
5159 | ) | |
5160 | ) | |
5161 | ||
5162 | (store-quad-r-r-u stqu OP_03 OPE1_14 GR NA | |
5163 | ((fr500 (unit u-gr-store))) | |
5164 | "Store quad word, update index") | |
5165 | (store-quad-r-r-u stqfu OP_03 OPE1_1C FRint FR-ACCESS | |
5166 | ((fr500 (unit u-fr-store))) | |
5167 | "Store quad float, update index") | |
5168 | (store-quad-r-r-u stqcu OP_03 OPE1_2F CPR NA () | |
5169 | "Store coprocessor quad word, update index") | |
5170 | ||
5171 | (define-pmacro (conditional-load name mode op ope regtype profile comment) | |
5172 | (dni name | |
5173 | (comment) | |
676a64f4 RS |
5174 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5175 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL) | |
9aab5aa3 AC |
5176 | (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond") |
5177 | (+ pack (.sym regtype k) op GRi CCi cond ope GRj) | |
5178 | (if (eq CCi (or cond 2)) | |
5179 | (set (.sym regtype k) | |
5180 | (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))) | |
5181 | profile | |
5182 | ) | |
5183 | ) | |
5184 | ||
5185 | (conditional-load cldsb QI OP_5E OPE4_0 GR | |
676a64f4 RS |
5186 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5187 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5188 | "Load signed byte") |
5189 | (conditional-load cldub UQI OP_5E OPE4_1 GR | |
676a64f4 RS |
5190 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5191 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5192 | "Load unsigned byte") |
5193 | (conditional-load cldsh HI OP_5E OPE4_2 GR | |
676a64f4 RS |
5194 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5195 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5196 | "Load signed half") |
5197 | (conditional-load clduh UHI OP_5E OPE4_3 GR | |
676a64f4 RS |
5198 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5199 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5200 | "Load unsigned half") |
5201 | (conditional-load cld SI OP_5F OPE4_0 GR | |
676a64f4 RS |
5202 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5203 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5204 | "Load word") |
5205 | ||
5206 | (conditional-load cldbf UQI OP_60 OPE4_0 FRint | |
676a64f4 RS |
5207 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
5208 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
5209 | "Load byte float") |
5210 | (conditional-load cldhf UHI OP_60 OPE4_1 FRint | |
676a64f4 RS |
5211 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
5212 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
5213 | "Load half float") |
5214 | (conditional-load cldf SI OP_60 OPE4_2 FRint | |
676a64f4 RS |
5215 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
5216 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
5217 | "Load word float") |
5218 | ||
5219 | (define-pmacro (conditional-load-double | |
5220 | name not_gr mode op ope regtype attr profile comment) | |
5221 | (dni name | |
5222 | (comment) | |
676a64f4 RS |
5223 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5224 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL attr) | |
9aab5aa3 AC |
5225 | (.str name "$pack @($GRi,$GRj),$" regtype "doublek,$CCi,$cond") |
5226 | (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj) | |
5227 | (if (eq CCi (or cond 2)) | |
5228 | (sequence ((WI address)) | |
5229 | (load-double-semantics not_gr mode regtype address GRj))) | |
5230 | profile | |
5231 | ) | |
5232 | ) | |
5233 | ||
5234 | (conditional-load-double cldd 0 DI OP_5F OPE4_1 GR NA | |
676a64f4 RS |
5235 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5236 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) | |
9aab5aa3 AC |
5237 | "Load double word") |
5238 | (conditional-load-double clddf 1 DF OP_60 OPE4_3 FR FR-ACCESS | |
676a64f4 RS |
5239 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
5240 | (fr500 (unit u-gr-load)) (fr550 (unit u-fr-load))) | |
9aab5aa3 AC |
5241 | "Load double float") |
5242 | ||
5243 | (dni cldq | |
5244 | "conditional load quad integer" | |
5245 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL) | |
5246 | "cldq$pack @($GRi,$GRj),$GRk,$CCi,$cond" | |
5247 | (+ pack GRk OP_5F GRi CCi cond OPE4_2 GRj) | |
5248 | (if (eq CCi (or cond 2)) | |
5249 | (sequence ((WI address)) | |
5250 | (load-quad-semantics GR address GRj))) | |
5251 | ((fr500 (unit u-gr-load))) | |
5252 | ) | |
5253 | ||
5254 | (define-pmacro (conditional-load-gr-u name mode op ope comment) | |
5255 | (dni name | |
5256 | (comment) | |
676a64f4 RS |
5257 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5258 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL) | |
9aab5aa3 AC |
5259 | (.str name "$pack @($GRi,$GRj),$GRk,$CCi,$cond") |
5260 | (+ pack GRk op GRi CCi cond ope GRj) | |
5261 | (if (eq CCi (or cond 2)) | |
5262 | (sequence ((WI address)) | |
5263 | (set address (add GRi GRj)) | |
5264 | (set GRk | |
5265 | (c-call mode (.str "@cpu@_read_mem_" mode) | |
5266 | pc address)) | |
5267 | (if (ne (index-of GRi) (index-of GRk)) | |
5268 | (set GRi address)))) | |
676a64f4 | 5269 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
ac7c07ac | 5270 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
5271 | ) |
5272 | ) | |
5273 | ||
5274 | (conditional-load-gr-u cldsbu QI OP_61 OPE4_0 "Load signed byte, update") | |
5275 | (conditional-load-gr-u cldubu UQI OP_61 OPE4_1 "Load unsigned byte, update") | |
5276 | (conditional-load-gr-u cldshu HI OP_61 OPE4_2 "Load signed half, update") | |
5277 | (conditional-load-gr-u clduhu UHI OP_61 OPE4_3 "Load unsigned half, update") | |
5278 | (conditional-load-gr-u cldu SI OP_62 OPE4_0 "Load word, update") | |
5279 | ||
5280 | (define-pmacro (conditional-load-non-gr-u name mode op ope regtype comment) | |
5281 | (dni name | |
5282 | (comment) | |
676a64f4 RS |
5283 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5284 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
5285 | (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond") |
5286 | (+ pack (.sym regtype k) op GRi CCi cond ope GRj) | |
5287 | (if (eq CCi (or cond 2)) | |
5288 | (sequence ((WI address)) | |
5289 | (set address (add GRi GRj)) | |
5290 | (set (.sym regtype k) | |
5291 | (c-call mode (.str "@cpu@_read_mem_" mode) | |
5292 | pc address)) | |
5293 | (set GRi address))) | |
676a64f4 | 5294 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
ac7c07ac | 5295 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
5296 | ) |
5297 | ) | |
5298 | ||
5299 | (conditional-load-non-gr-u cldbfu UQI OP_63 OPE4_0 FRint "Load byte float, update") | |
5300 | (conditional-load-non-gr-u cldhfu UHI OP_63 OPE4_1 FRint "Load half float, update") | |
5301 | (conditional-load-non-gr-u cldfu SI OP_63 OPE4_2 FRint "Load word float, update") | |
5302 | ||
5303 | ||
5304 | (dni clddu | |
5305 | "Load double word, update" | |
676a64f4 RS |
5306 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5307 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL) | |
9aab5aa3 AC |
5308 | "clddu$pack @($GRi,$GRj),$GRdoublek,$CCi,$cond" |
5309 | (+ pack GRdoublek OP_62 GRi CCi cond OPE4_1 GRj) | |
5310 | (if (eq CCi (or cond 2)) | |
5311 | (sequence ((WI address)) | |
5312 | (load-double-semantics 0 DI GR address GRj) | |
5313 | (if (ne (index-of GRi) (index-of GRdoublek)) | |
5314 | (set GRi address)))) | |
676a64f4 | 5315 | ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load)) |
ac7c07ac | 5316 | (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) |
9aab5aa3 AC |
5317 | ) |
5318 | ||
5319 | (dni clddfu | |
5320 | "Load double float, update" | |
676a64f4 RS |
5321 | ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) |
5322 | (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
5323 | "clddfu$pack @($GRi,$GRj),$FRdoublek,$CCi,$cond" |
5324 | (+ pack FRdoublek OP_63 GRi CCi cond OPE4_3 GRj) | |
5325 | (if (eq CCi (or cond 2)) | |
5326 | (sequence ((WI address)) | |
5327 | (load-double-semantics 1 DF FR address GRj) | |
5328 | (set GRi address))) | |
676a64f4 | 5329 | ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load)) |
ac7c07ac | 5330 | (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) |
9aab5aa3 AC |
5331 | ) |
5332 | ||
5333 | (dni cldqu | |
5334 | "conditional load quad integer and update index" | |
5335 | ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL) | |
5336 | "cldqu$pack @($GRi,$GRj),$GRk,$CCi,$cond" | |
5337 | (+ pack GRk OP_62 GRi CCi cond OPE4_2 GRj) | |
5338 | (if (eq CCi (or cond 2)) | |
5339 | (sequence ((WI address)) | |
5340 | (load-quad-semantics GR address GRj) | |
5341 | (if (ne (index-of GRi) (index-of GRk)) | |
5342 | (set GRi address)))) | |
5343 | ((fr500 (unit u-gr-load))) | |
5344 | ) | |
5345 | ||
5346 | (define-pmacro (conditional-store name mode op ope regtype profile comment) | |
5347 | (dni name | |
5348 | (comment) | |
676a64f4 RS |
5349 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5350 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL) | |
9aab5aa3 AC |
5351 | (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond") |
5352 | (+ pack (.sym regtype k) op GRi CCi cond ope GRj) | |
5353 | (if (eq CCi (or cond 2)) | |
5354 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
5355 | pc (add GRi GRj) (.sym regtype k))) | |
5356 | profile | |
5357 | ) | |
5358 | ) | |
5359 | ||
5360 | (conditional-store cstb QI OP_64 OPE4_0 GR | |
676a64f4 RS |
5361 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5362 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5363 | "Store unsigned byte") |
5364 | (conditional-store csth HI OP_64 OPE4_1 GR | |
676a64f4 RS |
5365 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5366 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5367 | "Store unsigned half") |
5368 | (conditional-store cst SI OP_64 OPE4_2 GR | |
676a64f4 RS |
5369 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5370 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5371 | "Store word") |
5372 | ||
5373 | (conditional-store cstbf QI OP_66 OPE4_0 FRint | |
676a64f4 RS |
5374 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5375 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5376 | "Store byte float") |
5377 | (conditional-store csthf HI OP_66 OPE4_1 FRint | |
676a64f4 RS |
5378 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5379 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5380 | "Store half float") |
5381 | (conditional-store cstf SI OP_66 OPE4_2 FRint | |
676a64f4 RS |
5382 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5383 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5384 | "Store word float") |
5385 | ||
5386 | (define-pmacro (conditional-store-double | |
5387 | name mode op ope regtype attr profile comment) | |
5388 | (dni name | |
5389 | (comment) | |
676a64f4 RS |
5390 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5391 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr) | |
1340b9a9 DB |
5392 | (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond") |
5393 | (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj) | |
9aab5aa3 AC |
5394 | (if (eq CCi (or cond 2)) |
5395 | (sequence ((WI address)) | |
5396 | (store-double-semantics mode regtype address GRj))) | |
5397 | profile | |
5398 | ) | |
5399 | ) | |
5400 | ||
5401 | (conditional-store-double cstd DI OP_64 OPE4_3 GR NA | |
676a64f4 RS |
5402 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5403 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5404 | "Store double word") |
5405 | (conditional-store-double cstdf DF OP_66 OPE4_3 FR FR-ACCESS | |
676a64f4 RS |
5406 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5407 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5408 | "Store double float") |
5409 | ||
5410 | (dni cstq | |
5411 | "conditionally store quad word" | |
8caa9169 | 5412 | ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) CONDITIONAL) |
9aab5aa3 AC |
5413 | "cstq$pack $GRk,@($GRi,$GRj),$CCi,$cond" |
5414 | (+ pack GRk OP_65 GRi CCi cond OPE4_0 GRj) | |
5415 | (if (eq CCi (or cond 2)) | |
5416 | (sequence ((WI address)) | |
5417 | (store-quad-semantics GR address GRj))) | |
5418 | ((fr500 (unit u-gr-store))) | |
5419 | ) | |
5420 | ||
5421 | (define-pmacro (conditional-store-u | |
5422 | name mode op ope regtype attr profile comment) | |
5423 | (dni name | |
5424 | (comment) | |
676a64f4 RS |
5425 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5426 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr) | |
9aab5aa3 AC |
5427 | (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond") |
5428 | (+ pack (.sym regtype k) op GRi CCi cond ope GRj) | |
5429 | (if (eq CCi (or cond 2)) | |
5430 | (sequence ((WI address)) | |
5431 | (set address (add GRi GRj)) | |
5432 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
5433 | pc address (.sym regtype k)) | |
5434 | (set GRi address))) | |
5435 | profile | |
5436 | ) | |
5437 | ) | |
5438 | ||
5439 | (conditional-store-u cstbu QI OP_67 OPE4_0 GR NA | |
676a64f4 RS |
5440 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5441 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5442 | "Store unsigned byte, update index") |
5443 | (conditional-store-u csthu HI OP_67 OPE4_1 GR NA | |
676a64f4 RS |
5444 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5445 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5446 | "Store unsigned half, update index") |
5447 | (conditional-store-u cstu SI OP_67 OPE4_2 GR NA | |
676a64f4 RS |
5448 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5449 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5450 | "Store word, update index") |
5451 | ||
5452 | (conditional-store-u cstbfu QI OP_68 OPE4_0 FRint FR-ACCESS | |
676a64f4 RS |
5453 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5454 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5455 | "Store byte float, update index") |
5456 | (conditional-store-u csthfu HI OP_68 OPE4_1 FRint FR-ACCESS | |
676a64f4 RS |
5457 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5458 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5459 | "Store half float, update index") |
5460 | (conditional-store-u cstfu SI OP_68 OPE4_2 FRint FR-ACCESS | |
676a64f4 RS |
5461 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5462 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5463 | "Store word float, update index") |
5464 | ||
5465 | (define-pmacro (conditional-store-double-u | |
5466 | name mode op ope regtype attr profile comment) | |
5467 | (dni name | |
5468 | (comment) | |
676a64f4 RS |
5469 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5470 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr) | |
1340b9a9 DB |
5471 | (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond") |
5472 | (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj) | |
9aab5aa3 AC |
5473 | (if (eq CCi (or cond 2)) |
5474 | (sequence ((WI address)) | |
5475 | (store-double-semantics mode regtype address GRj) | |
5476 | (set GRi address))) | |
5477 | profile | |
5478 | ) | |
5479 | ) | |
5480 | ||
5481 | (conditional-store-double-u cstdu DI OP_67 OPE4_3 GR NA | |
676a64f4 | 5482 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
ac7c07ac | 5483 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) |
9aab5aa3 AC |
5484 | "Store double word, update index") |
5485 | (conditional-store-double-u cstdfu DF OP_68 OPE4_3 FR FR-ACCESS | |
676a64f4 | 5486 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
ac7c07ac | 5487 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) |
9aab5aa3 AC |
5488 | "Store double float, update index") |
5489 | ||
5490 | (define-pmacro (store-r-simm name mode op regtype attr profile comment) | |
5491 | (dni name | |
5492 | (comment) | |
676a64f4 RS |
5493 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5494 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
9aab5aa3 AC |
5495 | (.str name "$pack $" regtype "k,@($GRi,$d12)") |
5496 | (+ pack (.sym regtype k) op GRi d12) | |
5497 | (c-call VOID (.str "@cpu@_write_mem_" mode) | |
5498 | pc (add GRi d12) (.sym regtype k)) | |
5499 | profile | |
5500 | ) | |
5501 | ) | |
5502 | ||
5503 | (store-r-simm stbi QI OP_50 GR NA | |
676a64f4 RS |
5504 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5505 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5506 | "Store unsigned byte") |
5507 | (store-r-simm sthi HI OP_51 GR NA | |
676a64f4 RS |
5508 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5509 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5510 | "Store unsigned half") |
5511 | (store-r-simm sti SI OP_52 GR NA | |
676a64f4 RS |
5512 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
5513 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) | |
9aab5aa3 AC |
5514 | "Store word") |
5515 | ||
5516 | (store-r-simm stbfi QI OP_4E FRint FR-ACCESS | |
676a64f4 RS |
5517 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5518 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5519 | "Store byte float") |
5520 | (store-r-simm sthfi HI OP_4F FRint FR-ACCESS | |
676a64f4 RS |
5521 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5522 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5523 | "Store half float") |
5524 | (store-r-simm stfi SI OP_55 FRint FR-ACCESS | |
676a64f4 RS |
5525 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
5526 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) | |
9aab5aa3 AC |
5527 | "Store word float") |
5528 | ||
5529 | (define-pmacro (store-double-r-simm name mode op regtype attr profile comment) | |
5530 | (dni name | |
5531 | (comment) | |
676a64f4 RS |
5532 | ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3) |
5533 | (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr) | |
1340b9a9 DB |
5534 | (.str name "$pack $" regtype "doublek,@($GRi,$d12)") |
5535 | (+ pack (.sym regtype doublek) op GRi d12) | |
9aab5aa3 AC |
5536 | (sequence ((WI address)) |
5537 | (store-double-semantics mode regtype address d12)) | |
5538 | profile | |
5539 | ) | |
5540 | ) | |
5541 | ||
5542 | (store-double-r-simm stdi DI OP_53 GR NA | |
676a64f4 | 5543 | ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store)) |
ac7c07ac | 5544 | (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store))) |
9aab5aa3 AC |
5545 | "Store double word") |
5546 | (store-double-r-simm stdfi DF OP_56 FR FR-ACCESS | |
676a64f4 | 5547 | ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store)) |
ac7c07ac | 5548 | (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store))) |
9aab5aa3 AC |
5549 | "Store double float") |
5550 | ||
5551 | (define-pmacro (store-quad-r-simm name op regtype attr profile comment) | |
5552 | (dni name | |
5553 | (comment) | |
8caa9169 | 5554 | ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr) |
9aab5aa3 AC |
5555 | (.str name "$pack $" regtype "k,@($GRi,$d12)") |
5556 | (+ pack (.sym regtype k) op GRi d12) | |
5557 | (sequence ((WI address)) | |
5558 | (store-quad-semantics regtype address d12)) | |
5559 | profile | |
5560 | ) | |
5561 | ) | |
5562 | ||
5563 | (store-quad-r-simm stqi OP_54 GR NA ((fr500 (unit u-gr-store))) | |
5564 | "Store quad word") | |
5565 | (store-quad-r-simm stqfi OP_57 FRint FR-ACCESS () | |
5566 | "Store quad float") | |
5567 | ||
5568 | (define-pmacro (swap-semantics base offset arg) | |
5569 | (sequence ((WI tmp) (WI address)) | |
5570 | (set tmp arg) | |
5571 | (set address (add base offset)) | |
ac7c07ac | 5572 | (c-call VOID "@cpu@_check_swap_address" address) |
9aab5aa3 AC |
5573 | (set arg (c-call WI "@cpu@_read_mem_WI" pc address)) |
5574 | (c-call VOID "@cpu@_write_mem_WI" pc address tmp)) | |
5575 | ) | |
5576 | ||
5577 | (dni swap | |
5578 | "Swap contents of memory with GR" | |
676a64f4 RS |
5579 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
5580 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
5581 | "swap$pack @($GRi,$GRj),$GRk" |
5582 | (+ pack GRk OP_03 GRi OPE1_05 GRj) | |
5583 | (swap-semantics GRi GRj GRk) | |
676a64f4 | 5584 | ((fr400 (unit u-swap)) (fr450 (unit u-swap)) |
ac7c07ac | 5585 | (fr500 (unit u-swap)) (fr550 (unit u-swap))) |
9aab5aa3 AC |
5586 | ) |
5587 | ||
5588 | (dni "swapi" | |
5589 | "Swap contents of memory with GR" | |
676a64f4 RS |
5590 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
5591 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
5592 | ("swapi$pack @($GRi,$d12),$GRk") |
5593 | (+ pack GRk OP_4D GRi d12) | |
5594 | (swap-semantics GRi d12 GRk) | |
676a64f4 | 5595 | ((fr400 (unit u-swap)) (fr450 (unit u-swap)) |
ac7c07ac | 5596 | (fr500 (unit u-swap)) (fr550 (unit u-swap))) |
9aab5aa3 AC |
5597 | ) |
5598 | ||
5599 | (dni cswap | |
5600 | "Conditionally swap contents of memory with GR" | |
676a64f4 RS |
5601 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
5602 | (FR400-MAJOR C-2) (FR450-MAJOR C-2) CONDITIONAL) | |
9aab5aa3 AC |
5603 | "cswap$pack @($GRi,$GRj),$GRk,$CCi,$cond" |
5604 | (+ pack GRk OP_65 GRi CCi cond OPE4_2 GRj) | |
5605 | (if (eq CCi (or cond 2)) | |
5606 | (swap-semantics GRi GRj GRk)) | |
676a64f4 | 5607 | ((fr400 (unit u-swap)) (fr450 (unit u-swap)) |
ac7c07ac | 5608 | (fr500 (unit u-swap)) (fr550 (unit u-swap))) |
9aab5aa3 AC |
5609 | ) |
5610 | ||
5611 | (define-pmacro (register-transfer | |
0457efce | 5612 | name op ope reg_src reg_targ pipe attrs profile comment) |
9aab5aa3 AC |
5613 | (dni name |
5614 | (comment) | |
0457efce | 5615 | (.splice (UNIT pipe) (.unsplice attrs)) |
9aab5aa3 AC |
5616 | (.str name "$pack $" reg_src ",$" reg_targ) |
5617 | (+ pack reg_targ op (rs-null) ope reg_src) | |
5618 | (set reg_targ reg_src) | |
5619 | profile | |
5620 | ) | |
5621 | ) | |
5622 | ||
5623 | (register-transfer movgf OP_03 OPE1_15 | |
0457efce | 5624 | GRj FRintk I0 |
676a64f4 RS |
5625 | ((FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5626 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS) | |
5627 | ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr)) | |
5628 | (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr))) | |
9aab5aa3 AC |
5629 | "transfer gr to fr") |
5630 | (register-transfer movfg OP_03 OPE1_0D | |
0457efce | 5631 | FRintk GRj I0 |
676a64f4 RS |
5632 | ((FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5633 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS) | |
5634 | ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr)) | |
5635 | (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr))) | |
9aab5aa3 AC |
5636 | "transfer fr to gr") |
5637 | ||
5638 | (define-pmacro (nextreg hw r offset) (reg hw (add (index-of r) offset))) | |
5639 | ||
5640 | (define-pmacro (register-transfer-double-from-gr-semantics cond) | |
5641 | (if cond | |
5642 | (if (eq (index-of GRj) 0) | |
5643 | (sequence () | |
5644 | (set FRintk 0) | |
5645 | (set (nextreg h-fr_int FRintk 1) 0)) | |
5646 | (sequence () | |
5647 | (set FRintk GRj) | |
5648 | (set (nextreg h-fr_int FRintk 1) (nextreg h-gr GRj 1))))) | |
5649 | ) | |
5650 | ||
5651 | (dni movgfd | |
5652 | "move GR for FR double" | |
676a64f4 RS |
5653 | ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5654 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS) | |
9aab5aa3 AC |
5655 | "movgfd$pack $GRj,$FRintk" |
5656 | (+ pack FRintk OP_03 (rs-null) OPE1_16 GRj) | |
5657 | (register-transfer-double-from-gr-semantics 1) | |
5658 | ; TODO -- doesn't handle second register in the pair | |
676a64f4 | 5659 | ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr)) |
ac7c07ac | 5660 | (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr))) |
9aab5aa3 AC |
5661 | ) |
5662 | ||
5663 | (define-pmacro (register-transfer-double-to-gr-semantics cond) | |
5664 | (if (andif (ne (index-of GRj) 0) cond) | |
5665 | (sequence () | |
5666 | (set GRj FRintk) | |
5667 | (set (nextreg h-gr GRj 1) (nextreg h-fr_int FRintk 1)))) | |
5668 | ) | |
5669 | ||
5670 | (dni movfgd | |
5671 | "move FR for GR double" | |
676a64f4 RS |
5672 | ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5673 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS) | |
9aab5aa3 AC |
5674 | "movfgd$pack $FRintk,$GRj" |
5675 | (+ pack FRintk OP_03 (rs-null) OPE1_0E GRj) | |
5676 | (register-transfer-double-to-gr-semantics 1) | |
5677 | ; TODO -- doesn't handle second register in the pair | |
676a64f4 | 5678 | ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr)) |
ac7c07ac | 5679 | (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr))) |
9aab5aa3 AC |
5680 | ) |
5681 | ||
5682 | (dni movgfq | |
5683 | "move GR for FR quad" | |
5684 | ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS) | |
5685 | "movgfq$pack $GRj,$FRintk" | |
5686 | (+ pack FRintk OP_03 (rs-null) OPE1_17 GRj) | |
5687 | (if (eq (index-of GRj) 0) | |
5688 | (sequence () | |
5689 | (set FRintk 0) | |
5690 | (set (reg h-fr_int (add (index-of FRintk) 1)) 0) | |
5691 | (set (reg h-fr_int (add (index-of FRintk) 2)) 0) | |
5692 | (set (reg h-fr_int (add (index-of FRintk) 3)) 0)) | |
5693 | (sequence () | |
5694 | (set FRintk GRj) | |
5695 | (set (reg h-fr_int (add (index-of FRintk) 1)) | |
5696 | (reg h-gr (add (index-of GRj) 1))) | |
5697 | (set (reg h-fr_int (add (index-of FRintk) 2)) | |
5698 | (reg h-gr (add (index-of GRj) 2))) | |
5699 | (set (reg h-fr_int (add (index-of FRintk) 3)) | |
5700 | (reg h-gr (add (index-of GRj) 3))))) | |
5701 | () | |
5702 | ) | |
5703 | ||
5704 | (dni movfgq | |
5705 | "move FR for GR quad" | |
5706 | ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS) | |
5707 | "movfgq$pack $FRintk,$GRj" | |
5708 | (+ pack FRintk OP_03 (rs-null) OPE1_0F GRj) | |
5709 | (if (ne (index-of GRj) 0) | |
5710 | (sequence () | |
5711 | (set GRj FRintk) | |
5712 | (set (reg h-gr (add (index-of GRj) 1)) | |
5713 | (reg h-fr_int (add (index-of FRintk) 1))) | |
5714 | (set (reg h-gr (add (index-of GRj) 2)) | |
5715 | (reg h-fr_int (add (index-of FRintk) 2))) | |
5716 | (set (reg h-gr (add (index-of GRj) 3)) | |
5717 | (reg h-fr_int (add (index-of FRintk) 3))))) | |
5718 | () | |
5719 | ) | |
5720 | ||
5721 | (define-pmacro (conditional-register-transfer | |
0457efce | 5722 | name op ope reg_src reg_targ pipe attrs profile comment) |
9aab5aa3 AC |
5723 | (dni name |
5724 | (comment) | |
0457efce | 5725 | (.splice (UNIT pipe) CONDITIONAL FR-ACCESS (.unsplice attrs)) |
9aab5aa3 AC |
5726 | (.str name "$pack $" reg_src ",$" reg_targ ",$CCi,$cond") |
5727 | (+ pack reg_targ op (rs-null) CCi cond ope reg_src) | |
5728 | (if (eq CCi (or cond 2)) | |
5729 | (set reg_targ reg_src)) | |
5730 | profile | |
5731 | ) | |
5732 | ) | |
5733 | ||
5734 | (conditional-register-transfer cmovgf OP_69 OPE4_0 GRj FRintk I0 | |
676a64f4 RS |
5735 | ((FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5736 | (FR400-MAJOR I-4) (FR450-MAJOR I-4)) | |
5737 | ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr)) | |
5738 | (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr))) | |
9aab5aa3 AC |
5739 | "transfer gr to fr") |
5740 | (conditional-register-transfer cmovfg OP_69 OPE4_2 FRintk GRj I0 | |
676a64f4 RS |
5741 | ((FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5742 | (FR400-MAJOR I-4) (FR450-MAJOR I-4)) | |
5743 | ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr)) | |
5744 | (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr))) | |
9aab5aa3 AC |
5745 | "transfer fr to gr") |
5746 | ||
5747 | ||
5748 | (dni cmovgfd | |
5749 | "Conditional move GR to FR double" | |
676a64f4 RS |
5750 | ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5751 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
5752 | "cmovgfd$pack $GRj,$FRintk,$CCi,$cond" |
5753 | (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_1 GRj) | |
5754 | (register-transfer-double-from-gr-semantics (eq CCi (or cond 2))) | |
5755 | ; TODO -- doesn't handle extra registers in double | |
676a64f4 | 5756 | ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr)) |
ac7c07ac | 5757 | (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr))) |
9aab5aa3 AC |
5758 | ) |
5759 | ||
5760 | (dni cmovfgd | |
5761 | "Conditional move FR to GR double" | |
676a64f4 RS |
5762 | ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5) |
5763 | (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
5764 | "cmovfgd$pack $FRintk,$GRj,$CCi,$cond" |
5765 | (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_3 GRj) | |
5766 | (register-transfer-double-to-gr-semantics (eq CCi (or cond 2))) | |
5767 | ; TODO -- doesn't handle second register in the pair | |
676a64f4 | 5768 | ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr)) |
ac7c07ac | 5769 | (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr))) |
9aab5aa3 AC |
5770 | ) |
5771 | ||
5772 | (define-pmacro (register-transfer-spr | |
5773 | name op ope reg_src reg_targ unitname comment) | |
5774 | (dni name | |
5775 | (comment) | |
676a64f4 RS |
5776 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
5777 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
5778 | (.str name "$pack $" reg_src ",$" reg_targ) |
5779 | (+ pack reg_targ op ope reg_src) | |
5780 | (set reg_targ reg_src) | |
676a64f4 | 5781 | ((fr400 (unit unitname)) (fr450 (unit unitname)) |
ac7c07ac | 5782 | (fr500 (unit unitname)) (fr550 (unit unitname))) |
9aab5aa3 AC |
5783 | ) |
5784 | ) | |
5785 | ||
5786 | (register-transfer-spr movgs OP_03 OPE1_06 GRj spr u-gr2spr "transfer gr->spr") | |
5787 | (register-transfer-spr movsg OP_03 OPE1_07 spr GRj u-spr2gr "transfer spr->gr") | |
5788 | ||
5789 | ; Integer Branch Conditions | |
5790 | (define-pmacro (Inev cc) (const BI 0)) | |
5791 | (define-pmacro (Ira cc) (const BI 1)) | |
5792 | (define-pmacro (Ieq cc) ( zbit cc)) | |
5793 | (define-pmacro (Ine cc) (not (zbit cc))) | |
5794 | (define-pmacro (Ile cc) ( orif (zbit cc) (xor (nbit cc) (vbit cc)))) | |
5795 | (define-pmacro (Igt cc) (not (orif (zbit cc) (xor (nbit cc) (vbit cc))))) | |
5796 | (define-pmacro (Ilt cc) ( xor (nbit cc) (vbit cc))) | |
5797 | (define-pmacro (Ige cc) (not (xor (nbit cc) (vbit cc)))) | |
5798 | (define-pmacro (Ils cc) ( orif (cbit cc) (zbit cc))) | |
5799 | (define-pmacro (Ihi cc) (not (orif (cbit cc) (zbit cc)))) | |
5800 | (define-pmacro (Ic cc) ( cbit cc)) | |
5801 | (define-pmacro (Inc cc) (not (cbit cc))) | |
5802 | (define-pmacro (In cc) ( nbit cc)) | |
5803 | (define-pmacro (Ip cc) (not (nbit cc))) | |
5804 | (define-pmacro (Iv cc) ( vbit cc)) | |
5805 | (define-pmacro (Inv cc) (not (vbit cc))) | |
5806 | ||
5807 | ; Float Branch Conditions | |
5808 | (define-pmacro (Fnev cc) (const BI 0)) | |
5809 | (define-pmacro (Fra cc) (const BI 1)) | |
5810 | (define-pmacro (Fne cc) (orif (lbit cc) (orif (gbit cc) (ubit cc)))) | |
5811 | (define-pmacro (Feq cc) (ebit cc)) | |
5812 | (define-pmacro (Flg cc) (orif (lbit cc) (gbit cc))) | |
5813 | (define-pmacro (Fue cc) (orif (ebit cc) (ubit cc))) | |
5814 | (define-pmacro (Ful cc) (orif (lbit cc) (ubit cc))) | |
5815 | (define-pmacro (Fge cc) (orif (ebit cc) (gbit cc))) | |
5816 | (define-pmacro (Flt cc) (lbit cc)) | |
5817 | (define-pmacro (Fuge cc) (orif (ebit cc) (orif (gbit cc) (ubit cc)))) | |
5818 | (define-pmacro (Fug cc) (orif (gbit cc) (ubit cc))) | |
5819 | (define-pmacro (Fle cc) (orif (ebit cc) (lbit cc))) | |
5820 | (define-pmacro (Fgt cc) (gbit cc)) | |
5821 | (define-pmacro (Fule cc) (orif (ebit cc) (orif (lbit cc) (ubit cc)))) | |
5822 | (define-pmacro (Fu cc) (ubit cc)) | |
5823 | (define-pmacro (Fo cc) (orif (ebit cc) (orif (lbit cc) (gbit cc)))) | |
5824 | ||
5825 | (define-pmacro (conditional-branch-i prefix cc op cond comment) | |
5826 | (dni (.sym prefix cc) | |
5827 | (comment) | |
676a64f4 RS |
5828 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5829 | (FR400-MAJOR B-1) (FR450-MAJOR B-1)) | |
9aab5aa3 AC |
5830 | (.str (.sym prefix cc) "$pack $ICCi_2,$hint,$label16") |
5831 | (+ pack (.sym ICC_ cc) ICCi_2 op hint label16) | |
5832 | (sequence () | |
5833 | (c-call VOID "@cpu@_model_branch" label16 hint) | |
5834 | (if (cond ICCi_2) | |
5835 | (set pc label16))) | |
676a64f4 | 5836 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5837 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5838 | ) |
5839 | ) | |
5840 | ||
5841 | (dni bra | |
5842 | "integer branch equal" | |
676a64f4 RS |
5843 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5844 | (FR400-MAJOR B-1) (FR450-MAJOR B-1)) | |
9aab5aa3 AC |
5845 | "bra$pack $hint_taken$label16" |
5846 | (+ pack ICC_ra (ICCi_2-null) OP_06 hint_taken label16) | |
5847 | (sequence () | |
5848 | (c-call VOID "@cpu@_model_branch" label16 hint_taken) | |
5849 | (set pc label16)) | |
676a64f4 | 5850 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5851 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5852 | ) |
5853 | ||
5854 | (dni bno | |
5855 | "integer branch never" | |
676a64f4 RS |
5856 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5857 | (FR400-MAJOR B-1) (FR450-MAJOR B-1)) | |
9aab5aa3 AC |
5858 | "bno$pack$hint_not_taken" |
5859 | (+ pack ICC_nev (ICCi_2-null) OP_06 hint_not_taken (label16-null)) | |
5860 | (c-call VOID "@cpu@_model_branch" label16 hint_not_taken) | |
676a64f4 | 5861 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5862 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5863 | ) |
5864 | ||
5865 | (conditional-branch-i b eq OP_06 Ieq "integer branch equal") | |
5866 | (conditional-branch-i b ne OP_06 Ine "integer branch not equal") | |
5867 | (conditional-branch-i b le OP_06 Ile "integer branch less or equal") | |
5868 | (conditional-branch-i b gt OP_06 Igt "integer branch greater") | |
5869 | (conditional-branch-i b lt OP_06 Ilt "integer branch less") | |
5870 | (conditional-branch-i b ge OP_06 Ige "integer branch greater or equal") | |
5871 | (conditional-branch-i b ls OP_06 Ils "integer branch less or equal unsigned") | |
5872 | (conditional-branch-i b hi OP_06 Ihi "integer branch greater unsigned") | |
5873 | (conditional-branch-i b c OP_06 Ic "integer branch carry set") | |
5874 | (conditional-branch-i b nc OP_06 Inc "integer branch carry clear") | |
5875 | (conditional-branch-i b n OP_06 In "integer branch negative") | |
5876 | (conditional-branch-i b p OP_06 Ip "integer branch positive") | |
5877 | (conditional-branch-i b v OP_06 Iv "integer branch overflow set") | |
5878 | (conditional-branch-i b nv OP_06 Inv "integer branch overflow clear") | |
5879 | ||
5880 | (define-pmacro (conditional-branch-f prefix cc op cond comment) | |
5881 | (dni (.sym prefix cc) | |
5882 | (comment) | |
676a64f4 RS |
5883 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5884 | (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS) | |
9aab5aa3 AC |
5885 | (.str (.sym prefix cc) "$pack $FCCi_2,$hint,$label16") |
5886 | (+ pack (.sym FCC_ cc) FCCi_2 op hint label16) | |
5887 | (sequence () | |
5888 | (c-call VOID "@cpu@_model_branch" label16 hint) | |
5889 | (if (cond FCCi_2) (set pc label16))) | |
676a64f4 | 5890 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5891 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5892 | ) |
5893 | ) | |
5894 | ||
5895 | (dni fbra | |
5896 | "float branch equal" | |
676a64f4 RS |
5897 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5898 | (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS) | |
9aab5aa3 AC |
5899 | "fbra$pack $hint_taken$label16" |
5900 | (+ pack FCC_ra (FCCi_2-null) OP_07 hint_taken label16) | |
5901 | (sequence () | |
5902 | (c-call VOID "@cpu@_model_branch" label16 hint_taken) | |
5903 | (set pc label16)) | |
676a64f4 | 5904 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5905 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5906 | ) |
5907 | ||
5908 | (dni fbno | |
5909 | "float branch never" | |
676a64f4 RS |
5910 | ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1) |
5911 | (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS) | |
9aab5aa3 AC |
5912 | "fbno$pack$hint_not_taken" |
5913 | (+ pack FCC_nev (FCCi_2-null) OP_07 hint_not_taken (label16-null)) | |
5914 | (c-call VOID "@cpu@_model_branch" label16 hint_not_taken) | |
676a64f4 | 5915 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5916 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5917 | ) |
5918 | ||
5919 | (conditional-branch-f fb ne OP_07 Fne "float branch not equal") | |
5920 | (conditional-branch-f fb eq OP_07 Feq "float branch equal") | |
5921 | (conditional-branch-f fb lg OP_07 Flg "float branch less or greater") | |
5922 | (conditional-branch-f fb ue OP_07 Fue "float branch unordered or equal") | |
5923 | (conditional-branch-f fb ul OP_07 Ful "float branch unordered or less") | |
5924 | (conditional-branch-f fb ge OP_07 Fge "float branch greater or equal") | |
5925 | (conditional-branch-f fb lt OP_07 Flt "float branch less") | |
5926 | (conditional-branch-f fb uge OP_07 Fuge "float branch unordered, greater,equal") | |
5927 | (conditional-branch-f fb ug OP_07 Fug "float branch unordered or greater") | |
5928 | (conditional-branch-f fb le OP_07 Fle "float branch less or equal") | |
5929 | (conditional-branch-f fb gt OP_07 Fgt "float branch greater") | |
5930 | (conditional-branch-f fb ule OP_07 Fule "float branch unordered, less or equal") | |
5931 | (conditional-branch-f fb u OP_07 Fu "float branch unordered") | |
5932 | (conditional-branch-f fb o OP_07 Fo "float branch ordered") | |
5933 | ||
5934 | (define-pmacro (ctrlr-branch-semantics cond ccond) | |
5935 | (sequence ((SI tmp)) | |
5936 | (set tmp (sub (spr-lcr) 1)) | |
5937 | (set (spr-lcr) tmp) | |
5938 | (if cond | |
5939 | (if (eq ccond 0) | |
5940 | (if (ne tmp 0) | |
5941 | (set pc (spr-lr))) | |
5942 | (if (eq tmp 0) | |
5943 | (set pc (spr-lr)))))) | |
5944 | ) | |
5945 | ||
5946 | (dni bctrlr | |
5947 | "LCR conditional branch to lr" | |
676a64f4 RS |
5948 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
5949 | (FR400-MAJOR B-2) (FR450-MAJOR B-2)) | |
9aab5aa3 AC |
5950 | ("bctrlr$pack $ccond,$hint") |
5951 | (+ pack (cond-null) (ICCi_2-null) OP_0E hint OPE3_01 ccond (s12-null)) | |
5952 | (sequence () | |
5953 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint) | |
5954 | (ctrlr-branch-semantics (const BI 1) ccond)) | |
676a64f4 | 5955 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5956 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5957 | ) |
5958 | ||
5959 | (define-pmacro (conditional-branch-cclr prefix cc i-f op ope cond attr comment) | |
5960 | (dni (.sym prefix cc lr) | |
5961 | (comment) | |
676a64f4 RS |
5962 | ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3) |
5963 | (FR400-MAJOR B-3) (FR450-MAJOR B-3) attr) | |
9aab5aa3 AC |
5964 | (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$hint") |
5965 | (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope | |
5966 | (ccond-null) (s12-null)) | |
5967 | (sequence () | |
5968 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint) | |
5969 | (if (cond (.sym i-f CCi_2)) (set pc (spr-lr)))) | |
676a64f4 | 5970 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5971 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5972 | ) |
5973 | ) | |
5974 | ||
5975 | (dni bralr | |
5976 | "integer cclr branch always" | |
676a64f4 RS |
5977 | ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3) |
5978 | (FR400-MAJOR B-3) (FR450-MAJOR B-3)) | |
9aab5aa3 AC |
5979 | "bralr$pack$hint_taken" |
5980 | (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_02 (ccond-null) (s12-null)) | |
5981 | (sequence () | |
5982 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken) | |
5983 | (set pc (spr-lr))) | |
676a64f4 | 5984 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5985 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5986 | ) |
5987 | ||
5988 | (dni bnolr | |
5989 | "integer cclr branch never" | |
676a64f4 RS |
5990 | ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3) |
5991 | (FR400-MAJOR B-3) (FR450-MAJOR B-3)) | |
9aab5aa3 AC |
5992 | "bnolr$pack$hint_not_taken" |
5993 | (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_02 (ccond-null) (s12-null)) | |
5994 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken) | |
676a64f4 | 5995 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 5996 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
5997 | ) |
5998 | ||
5999 | (conditional-branch-cclr b eq I OP_0E OPE3_02 Ieq NA "integer cclr branch equal") | |
6000 | (conditional-branch-cclr b ne I OP_0E OPE3_02 Ine NA "integer cclr branch not equal") | |
6001 | (conditional-branch-cclr b le I OP_0E OPE3_02 Ile NA "integer cclr branch less or equal") | |
6002 | (conditional-branch-cclr b gt I OP_0E OPE3_02 Igt NA "integer cclr branch greater") | |
6003 | (conditional-branch-cclr b lt I OP_0E OPE3_02 Ilt NA "integer cclr branch less") | |
6004 | (conditional-branch-cclr b ge I OP_0E OPE3_02 Ige NA "integer cclr branch greater or equal") | |
6005 | (conditional-branch-cclr b ls I OP_0E OPE3_02 Ils NA "integer cclr branch less or equal unsigned") | |
6006 | (conditional-branch-cclr b hi I OP_0E OPE3_02 Ihi NA "integer cclr branch greater unsigned") | |
6007 | (conditional-branch-cclr b c I OP_0E OPE3_02 Ic NA "integer cclr branch carry set") | |
6008 | (conditional-branch-cclr b nc I OP_0E OPE3_02 Inc NA "integer cclr branch carry clear") | |
6009 | (conditional-branch-cclr b n I OP_0E OPE3_02 In NA "integer cclr branch negative") | |
6010 | (conditional-branch-cclr b p I OP_0E OPE3_02 Ip NA "integer cclr branch positive") | |
6011 | (conditional-branch-cclr b v I OP_0E OPE3_02 Iv NA "integer cclr branch overflow set") | |
6012 | (conditional-branch-cclr b nv I OP_0E OPE3_02 Inv NA "integer cclr branch overflow clear") | |
6013 | ||
6014 | (dni fbralr | |
6015 | "float cclr branch always" | |
676a64f4 RS |
6016 | ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3) |
6017 | (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS) | |
9aab5aa3 AC |
6018 | "fbralr$pack$hint_taken" |
6019 | (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_06 (ccond-null) (s12-null)) | |
6020 | (sequence () | |
6021 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken) | |
6022 | (set pc (spr-lr))) | |
676a64f4 | 6023 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6024 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6025 | ) |
6026 | ||
6027 | (dni fbnolr | |
6028 | "float cclr branch never" | |
676a64f4 RS |
6029 | ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3) |
6030 | (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS) | |
9aab5aa3 AC |
6031 | "fbnolr$pack$hint_not_taken" |
6032 | (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_06 (ccond-null) (s12-null)) | |
6033 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken) | |
676a64f4 | 6034 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6035 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6036 | ) |
6037 | ||
6038 | (conditional-branch-cclr fb eq F OP_0E OPE3_06 Feq FR-ACCESS "float cclr branch equal") | |
6039 | (conditional-branch-cclr fb ne F OP_0E OPE3_06 Fne FR-ACCESS "float cclr branch not equal") | |
6040 | (conditional-branch-cclr fb lg F OP_0E OPE3_06 Flg FR-ACCESS "float branch less or greater") | |
6041 | (conditional-branch-cclr fb ue F OP_0E OPE3_06 Fue FR-ACCESS "float branch unordered or equal") | |
6042 | (conditional-branch-cclr fb ul F OP_0E OPE3_06 Ful FR-ACCESS "float branch unordered or less") | |
6043 | (conditional-branch-cclr fb ge F OP_0E OPE3_06 Fge FR-ACCESS "float branch greater or equal") | |
6044 | (conditional-branch-cclr fb lt F OP_0E OPE3_06 Flt FR-ACCESS "float branch less") | |
6045 | (conditional-branch-cclr fb uge F OP_0E OPE3_06 Fuge FR-ACCESS "float branch unordered, greater, equal") | |
6046 | (conditional-branch-cclr fb ug F OP_0E OPE3_06 Fug FR-ACCESS "float branch unordered or greater") | |
6047 | (conditional-branch-cclr fb le F OP_0E OPE3_06 Fle FR-ACCESS "float branch less or equal") | |
6048 | (conditional-branch-cclr fb gt F OP_0E OPE3_06 Fgt FR-ACCESS "float branch greater") | |
6049 | (conditional-branch-cclr fb ule F OP_0E OPE3_06 Fule FR-ACCESS "float branch unordered, less or equal") | |
6050 | (conditional-branch-cclr fb u F OP_0E OPE3_06 Fu FR-ACCESS "float branch unordered") | |
6051 | (conditional-branch-cclr fb o F OP_0E OPE3_06 Fo FR-ACCESS "float branch ordered") | |
6052 | ||
6053 | (define-pmacro (conditional-branch-ctrlr prefix cc i-f op ope cond attr comment) | |
6054 | (dni (.sym prefix cc lr) | |
6055 | (comment) | |
676a64f4 RS |
6056 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
6057 | (FR400-MAJOR B-2) (FR450-MAJOR B-2) attr) | |
9aab5aa3 AC |
6058 | (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$ccond,$hint") |
6059 | (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope ccond (s12-null)) | |
6060 | (sequence () | |
6061 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint) | |
6062 | (ctrlr-branch-semantics (cond (.sym i-f CCi_2)) ccond)) | |
676a64f4 | 6063 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6064 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6065 | ) |
6066 | ) | |
6067 | ||
6068 | (dni bcralr | |
6069 | "integer ctrlr branch always" | |
676a64f4 RS |
6070 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
6071 | (FR400-MAJOR B-2) (FR450-MAJOR B-2)) | |
9aab5aa3 AC |
6072 | "bcralr$pack $ccond$hint_taken" |
6073 | (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_03 ccond (s12-null)) | |
6074 | (sequence () | |
6075 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken) | |
6076 | (ctrlr-branch-semantics (const BI 1) ccond)) | |
676a64f4 | 6077 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6078 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6079 | ) |
6080 | ||
6081 | (dni bcnolr | |
6082 | "integer ctrlr branch never" | |
676a64f4 RS |
6083 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
6084 | (FR400-MAJOR B-2) (FR450-MAJOR B-2)) | |
9aab5aa3 AC |
6085 | "bcnolr$pack$hint_not_taken" |
6086 | (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_03 (ccond-null) (s12-null)) | |
6087 | (sequence () | |
6088 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken) | |
6089 | (ctrlr-branch-semantics (const BI 0) ccond)) | |
676a64f4 | 6090 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6091 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6092 | ) |
6093 | ||
6094 | (conditional-branch-ctrlr bc eq I OP_0E OPE3_03 Ieq NA "integer ctrlr branch equal") | |
6095 | (conditional-branch-ctrlr bc ne I OP_0E OPE3_03 Ine NA "integer ctrlr branch not equal") | |
6096 | (conditional-branch-ctrlr bc le I OP_0E OPE3_03 Ile NA "integer ctrlr branch less equal") | |
6097 | (conditional-branch-ctrlr bc gt I OP_0E OPE3_03 Igt NA "integer ctrlr branch greater") | |
6098 | (conditional-branch-ctrlr bc lt I OP_0E OPE3_03 Ilt NA "integer ctrlr branch less") | |
6099 | (conditional-branch-ctrlr bc ge I OP_0E OPE3_03 Ige NA "integer ctrlr branch greater equal") | |
6100 | (conditional-branch-ctrlr bc ls I OP_0E OPE3_03 Ils NA "integer ctrlr branch less equal unsigned") | |
6101 | (conditional-branch-ctrlr bc hi I OP_0E OPE3_03 Ihi NA "integer ctrlr branch greater unsigned") | |
6102 | (conditional-branch-ctrlr bc c I OP_0E OPE3_03 Ic NA "integer ctrlr branch carry set") | |
6103 | (conditional-branch-ctrlr bc nc I OP_0E OPE3_03 Inc NA "integer ctrlr branch carry clear") | |
6104 | (conditional-branch-ctrlr bc n I OP_0E OPE3_03 In NA "integer ctrlr branch negative") | |
6105 | (conditional-branch-ctrlr bc p I OP_0E OPE3_03 Ip NA "integer ctrlr branch positive") | |
6106 | (conditional-branch-ctrlr bc v I OP_0E OPE3_03 Iv NA "integer ctrlr branch overflow set") | |
6107 | (conditional-branch-ctrlr bc nv I OP_0E OPE3_03 Inv NA "integer ctrlr branch overflow clear") | |
6108 | ||
6109 | (dni fcbralr | |
6110 | "float ctrlr branch always" | |
676a64f4 RS |
6111 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
6112 | (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS) | |
9aab5aa3 AC |
6113 | "fcbralr$pack $ccond$hint_taken" |
6114 | (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_07 ccond (s12-null)) | |
6115 | (sequence () | |
6116 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken) | |
6117 | (ctrlr-branch-semantics (const BI 1) ccond)) | |
676a64f4 | 6118 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6119 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6120 | ) |
6121 | ||
6122 | (dni fcbnolr | |
6123 | "float ctrlr branch never" | |
676a64f4 RS |
6124 | ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2) |
6125 | (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS) | |
9aab5aa3 AC |
6126 | "fcbnolr$pack$hint_not_taken" |
6127 | (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_07 (ccond-null) (s12-null)) | |
6128 | (sequence () | |
6129 | (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken) | |
6130 | (ctrlr-branch-semantics (const BI 0) ccond)) | |
676a64f4 | 6131 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6132 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6133 | ) |
6134 | ||
6135 | (conditional-branch-ctrlr fcb eq F OP_0E OPE3_07 Feq FR-ACCESS "float cclr branch equal") | |
6136 | (conditional-branch-ctrlr fcb ne F OP_0E OPE3_07 Fne FR-ACCESS "float cclr branch not equal") | |
6137 | (conditional-branch-ctrlr fcb lg F OP_0E OPE3_07 Flg FR-ACCESS "float branch less or greater") | |
6138 | (conditional-branch-ctrlr fcb ue F OP_0E OPE3_07 Fue FR-ACCESS "float branch unordered or equal") | |
6139 | (conditional-branch-ctrlr fcb ul F OP_0E OPE3_07 Ful FR-ACCESS "float branch unordered or less") | |
6140 | (conditional-branch-ctrlr fcb ge F OP_0E OPE3_07 Fge FR-ACCESS "float branch greater or equal") | |
6141 | (conditional-branch-ctrlr fcb lt F OP_0E OPE3_07 Flt FR-ACCESS "float branch less") | |
6142 | (conditional-branch-ctrlr fcb uge F OP_0E OPE3_07 Fuge FR-ACCESS "float branch unordered, greater, equal") | |
6143 | (conditional-branch-ctrlr fcb ug F OP_0E OPE3_07 Fug FR-ACCESS "float branch unordered or greater") | |
6144 | (conditional-branch-ctrlr fcb le F OP_0E OPE3_07 Fle FR-ACCESS "float branch less or equal") | |
6145 | (conditional-branch-ctrlr fcb gt F OP_0E OPE3_07 Fgt FR-ACCESS "float branch greater") | |
6146 | (conditional-branch-ctrlr fcb ule F OP_0E OPE3_07 Fule FR-ACCESS "float branch unordered, less or equal") | |
6147 | (conditional-branch-ctrlr fcb u F OP_0E OPE3_07 Fu FR-ACCESS "float branch unordered") | |
6148 | (conditional-branch-ctrlr fcb o F OP_0E OPE3_07 Fo FR-ACCESS "float branch ordered") | |
6149 | ||
6150 | (define-pmacro (jump-and-link-semantics base offset LI) | |
6151 | (sequence () | |
6152 | (if (eq LI 1) | |
6153 | (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1)) | |
6154 | ; Target address gets aligned here | |
6155 | (set pc (and (add base offset) #xfffffffc)) | |
6156 | (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken | |
6157 | ) | |
6158 | ||
6159 | (dni jmpl | |
6160 | "jump and link" | |
676a64f4 RS |
6161 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
6162 | (FR400-MAJOR I-5) (FR450-MAJOR I-5)) | |
9aab5aa3 AC |
6163 | "jmpl$pack @($GRi,$GRj)" |
6164 | (+ pack (misc-null-1) (LI-off) OP_0C GRi (misc-null-2) GRj) | |
6165 | (jump-and-link-semantics GRi GRj LI) | |
676a64f4 | 6166 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6167 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6168 | ) |
6169 | ||
90219bd0 AO |
6170 | (dann callann "call annotation" SI "call_annotation" "at") |
6171 | ||
9aab5aa3 AC |
6172 | (dni calll |
6173 | "call and link" | |
676a64f4 RS |
6174 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
6175 | (FR400-MAJOR I-5) (FR450-MAJOR I-5)) | |
90219bd0 | 6176 | "calll$pack $callann($GRi,$GRj)" |
9aab5aa3 AC |
6177 | (+ pack (misc-null-1) (LI-on) OP_0C GRi (misc-null-2) GRj) |
6178 | (jump-and-link-semantics GRi GRj LI) | |
676a64f4 | 6179 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
c7a48b9a | 6180 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6181 | ) |
6182 | ||
6183 | (dni jmpil | |
6184 | "jump immediate and link" | |
676a64f4 RS |
6185 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
6186 | (FR400-MAJOR I-5) (FR450-MAJOR I-5)) | |
9aab5aa3 AC |
6187 | "jmpil$pack @($GRi,$s12)" |
6188 | (+ pack (misc-null-1) (LI-off) OP_0D GRi s12) | |
6189 | (jump-and-link-semantics GRi s12 LI) | |
676a64f4 | 6190 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6191 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6192 | ) |
6193 | ||
6194 | (dni callil | |
6195 | "call immediate and link" | |
676a64f4 RS |
6196 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
6197 | (FR400-MAJOR I-5) (FR450-MAJOR I-5)) | |
9aab5aa3 AC |
6198 | "callil$pack @($GRi,$s12)" |
6199 | (+ pack (misc-null-1) (LI-on) OP_0D GRi s12) | |
6200 | (jump-and-link-semantics GRi s12 LI) | |
676a64f4 | 6201 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
c7a48b9a | 6202 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6203 | ) |
6204 | ||
6205 | (dni call | |
6206 | "call and link" | |
676a64f4 RS |
6207 | ((UNIT B0) (FR500-MAJOR B-4) (FR550-MAJOR B-4) |
6208 | (FR400-MAJOR B-4) (FR450-MAJOR B-4)) | |
9aab5aa3 AC |
6209 | "call$pack $label24" |
6210 | (+ pack OP_0F label24) | |
6211 | (sequence () | |
6212 | (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1) | |
6213 | (set pc label24) | |
6214 | (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken | |
676a64f4 | 6215 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6216 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6217 | ) |
6218 | ||
6219 | (dni rett | |
6220 | "return from trap" | |
676a64f4 RS |
6221 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
6222 | (FR400-MAJOR C-2) (FR450-MAJOR C-2) PRIVILEGED) | |
9aab5aa3 AC |
6223 | "rett$pack $debug" |
6224 | (+ pack (misc-null-1) debug OP_05 (rs-null) (s12-null)) | |
6225 | ; frv_rett handles operating vs user mode | |
6226 | (sequence () | |
6227 | (set pc (c-call UWI "frv_rett" pc debug)) | |
6228 | (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken | |
6229 | () | |
6230 | ) | |
6231 | ||
6232 | (dni rei | |
6233 | "run exception instruction" | |
6234 | ((UNIT C) (FR500-MAJOR C-1) (MACH frv) PRIVILEGED) | |
6235 | "rei$pack $eir" | |
6236 | (+ pack (rd-null) OP_37 eir (s12-null)) | |
6237 | (nop) ; for now | |
6238 | () | |
6239 | ) | |
6240 | ||
6241 | (define-pmacro (trap-semantics cond base offset) | |
6242 | (if cond | |
6243 | (sequence () | |
6244 | ; This is defered to frv_itrap because for the breakpoint | |
6245 | ; case we want to change as little of the machine state as | |
6246 | ; possible. | |
6247 | ; | |
6248 | ; PCSR=PC | |
6249 | ; PSR.PS=PSR.S | |
6250 | ; PSR.ET=0 | |
6251 | ; if PSR.ESR==1 | |
6252 | ; SR0 through SR3=GR4 through GR7 | |
6253 | ; TBR.TT=0x80 + ((GRi + s12) & 0x7f) | |
6254 | ; PC=TBR | |
6255 | ; We still should indicate what is modified by this insn. | |
6256 | (clobber (spr-pcsr)) | |
6257 | (clobber psr_ps) | |
6258 | (clobber psr_et) | |
6259 | (clobber tbr_tt) | |
6260 | (if (ne psr_esr (const 0)) | |
6261 | (sequence () | |
6262 | (clobber (spr-sr0)) | |
6263 | (clobber (spr-sr1)) | |
6264 | (clobber (spr-sr2)) | |
6265 | (clobber (spr-sr3)))) | |
6266 | ; frv_itrap handles operating vs user mode | |
6267 | (c-call VOID "frv_itrap" pc base offset))) | |
6268 | ) | |
6269 | ||
6270 | (define-pmacro (trap-r prefix cc i-f op ope cond attr comment) | |
6271 | (dni (.sym prefix cc) | |
6272 | (comment) | |
676a64f4 RS |
6273 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6274 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr) | |
9aab5aa3 AC |
6275 | (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$GRj") |
6276 | (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi (misc-null-3) ope GRj) | |
6277 | (trap-semantics (cond (.sym i-f CCi_2)) GRi GRj) | |
676a64f4 | 6278 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6279 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6280 | ) |
6281 | ) | |
6282 | ||
6283 | (dni tra | |
6284 | "integer trap always" | |
676a64f4 RS |
6285 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6286 | (FR400-MAJOR C-1) (FR450-MAJOR C-1)) | |
9aab5aa3 AC |
6287 | "tra$pack $GRi,$GRj" |
6288 | (+ pack ICC_ra (ICCi_2-null) OP_04 GRi (misc-null-3) OPE4_0 GRj) | |
6289 | (trap-semantics (const BI 1) GRi GRj) | |
676a64f4 | 6290 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6291 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6292 | ) |
6293 | ||
6294 | (dni tno | |
6295 | "integer trap never" | |
676a64f4 RS |
6296 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6297 | (FR400-MAJOR C-1) (FR450-MAJOR C-1)) | |
9aab5aa3 AC |
6298 | "tno$pack" |
6299 | (+ pack ICC_nev (ICCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_0 (GRj-null)) | |
6300 | (trap-semantics (const BI 0) GRi GRj) | |
676a64f4 | 6301 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6302 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6303 | ) |
6304 | ||
6305 | (trap-r t eq I OP_04 OPE4_0 Ieq NA "integer trap equal") | |
6306 | (trap-r t ne I OP_04 OPE4_0 Ine NA "integer trap not equal") | |
6307 | (trap-r t le I OP_04 OPE4_0 Ile NA "integer trap less or equal") | |
6308 | (trap-r t gt I OP_04 OPE4_0 Igt NA "integer trap greater") | |
6309 | (trap-r t lt I OP_04 OPE4_0 Ilt NA "integer trap less") | |
6310 | (trap-r t ge I OP_04 OPE4_0 Ige NA "integer trap greater or equal") | |
6311 | (trap-r t ls I OP_04 OPE4_0 Ils NA "integer trap less or equal unsigned") | |
6312 | (trap-r t hi I OP_04 OPE4_0 Ihi NA "integer trap greater unsigned") | |
6313 | (trap-r t c I OP_04 OPE4_0 Ic NA "integer trap carry set") | |
6314 | (trap-r t nc I OP_04 OPE4_0 Inc NA "integer trap carry clear") | |
6315 | (trap-r t n I OP_04 OPE4_0 In NA "integer trap negative") | |
6316 | (trap-r t p I OP_04 OPE4_0 Ip NA "integer trap positive") | |
6317 | (trap-r t v I OP_04 OPE4_0 Iv NA "integer trap overflow set") | |
6318 | (trap-r t nv I OP_04 OPE4_0 Inv NA "integer trap overflow clear") | |
6319 | ||
6320 | (dni ftra | |
6321 | "float trap always" | |
676a64f4 RS |
6322 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6323 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS) | |
9aab5aa3 AC |
6324 | "ftra$pack $GRi,$GRj" |
6325 | (+ pack FCC_ra (FCCi_2-null) OP_04 GRi (misc-null-3) OPE4_1 GRj) | |
6326 | (trap-semantics (const BI 1) GRi GRj) | |
676a64f4 | 6327 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6328 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6329 | ) |
6330 | ||
6331 | (dni ftno | |
6332 | "flost trap never" | |
676a64f4 RS |
6333 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6334 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS) | |
9aab5aa3 AC |
6335 | "ftno$pack" |
6336 | (+ pack FCC_nev (FCCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_1 (GRj-null)) | |
6337 | (trap-semantics (const BI 0) GRi GRj) | |
676a64f4 | 6338 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6339 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6340 | ) |
6341 | ||
6342 | (trap-r ft ne F OP_04 OPE4_1 Fne FR-ACCESS "float trap not equal") | |
6343 | (trap-r ft eq F OP_04 OPE4_1 Feq FR-ACCESS "float trap equal") | |
6344 | (trap-r ft lg F OP_04 OPE4_1 Flg FR-ACCESS "float trap greater or less") | |
6345 | (trap-r ft ue F OP_04 OPE4_1 Fue FR-ACCESS "float trap unordered or equal") | |
6346 | (trap-r ft ul F OP_04 OPE4_1 Ful FR-ACCESS "float trap unordered or less") | |
6347 | (trap-r ft ge F OP_04 OPE4_1 Fge FR-ACCESS "float trap greater or equal") | |
6348 | (trap-r ft lt F OP_04 OPE4_1 Flt FR-ACCESS "float trap less") | |
6349 | (trap-r ft uge F OP_04 OPE4_1 Fuge FR-ACCESS "float trap unordered greater or equal") | |
6350 | (trap-r ft ug F OP_04 OPE4_1 Fug FR-ACCESS "float trap unordered or greater") | |
6351 | (trap-r ft le F OP_04 OPE4_1 Fle FR-ACCESS "float trap less or equal") | |
6352 | (trap-r ft gt F OP_04 OPE4_1 Fgt FR-ACCESS "float trap greater") | |
6353 | (trap-r ft ule F OP_04 OPE4_1 Fule FR-ACCESS "float trap unordered less or equal") | |
6354 | (trap-r ft u F OP_04 OPE4_1 Fu FR-ACCESS "float trap unordered") | |
6355 | (trap-r ft o F OP_04 OPE4_1 Fo FR-ACCESS "float trap ordered") | |
6356 | ||
6357 | (define-pmacro (trap-immed prefix cc i-f op cond attr comment) | |
6358 | (dni (.sym prefix cc) | |
6359 | (comment) | |
676a64f4 RS |
6360 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6361 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr) | |
9aab5aa3 AC |
6362 | (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$s12") |
6363 | (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi s12) | |
6364 | (trap-semantics (cond (.sym i-f CCi_2)) GRi s12) | |
676a64f4 | 6365 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6366 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6367 | ) |
6368 | ) | |
6369 | ||
6370 | (dni tira | |
6371 | "integer trap always" | |
676a64f4 RS |
6372 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6373 | (FR400-MAJOR C-1) (FR450-MAJOR C-1)) | |
9aab5aa3 AC |
6374 | "tira$pack $GRi,$s12" |
6375 | (+ pack ICC_ra (ICCi_2-null) OP_1C GRi s12) | |
6376 | (trap-semantics (const BI 1) GRi s12) | |
676a64f4 | 6377 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6378 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6379 | ) |
6380 | ||
6381 | (dni tino | |
6382 | "integer trap never" | |
676a64f4 RS |
6383 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6384 | (FR400-MAJOR C-1) (FR450-MAJOR C-1)) | |
9aab5aa3 AC |
6385 | "tino$pack" |
6386 | (+ pack ICC_nev (ICCi_2-null) OP_1C (GRi-null) (s12-null)) | |
6387 | (trap-semantics (const BI 0) GRi s12) | |
676a64f4 | 6388 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6389 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6390 | ) |
6391 | ||
6392 | (trap-immed ti eq I OP_1C Ieq NA "integer trap equal") | |
6393 | (trap-immed ti ne I OP_1C Ine NA "integer trap not equal") | |
6394 | (trap-immed ti le I OP_1C Ile NA "integer trap less or equal") | |
6395 | (trap-immed ti gt I OP_1C Igt NA "integer trap greater") | |
6396 | (trap-immed ti lt I OP_1C Ilt NA "integer trap less") | |
6397 | (trap-immed ti ge I OP_1C Ige NA "integer trap greater or equal") | |
6398 | (trap-immed ti ls I OP_1C Ils NA "integer trap less or equal unsigned") | |
6399 | (trap-immed ti hi I OP_1C Ihi NA "integer trap greater unsigned") | |
6400 | (trap-immed ti c I OP_1C Ic NA "integer trap carry set") | |
6401 | (trap-immed ti nc I OP_1C Inc NA "integer trap carry clear") | |
6402 | (trap-immed ti n I OP_1C In NA "integer trap negative") | |
6403 | (trap-immed ti p I OP_1C Ip NA "integer trap positive") | |
6404 | (trap-immed ti v I OP_1C Iv NA "integer trap overflow set") | |
6405 | (trap-immed ti nv I OP_1C Inv NA "integer trap overflow clear") | |
6406 | ||
6407 | (dni ftira | |
6408 | "float trap always" | |
676a64f4 RS |
6409 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6410 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS) | |
9aab5aa3 AC |
6411 | "ftira$pack $GRi,$s12" |
6412 | (+ pack FCC_ra (ICCi_2-null) OP_1D GRi s12) | |
6413 | (trap-semantics (const BI 1) GRi s12) | |
6414 | ((fr400 (unit u-trap)) | |
ac7c07ac | 6415 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6416 | ) |
6417 | ||
6418 | (dni ftino | |
6419 | "float trap never" | |
676a64f4 RS |
6420 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6421 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS) | |
9aab5aa3 AC |
6422 | "ftino$pack" |
6423 | (+ pack FCC_nev (FCCi_2-null) OP_1D (GRi-null) (s12-null)) | |
6424 | (trap-semantics (const BI 0) GRi s12) | |
676a64f4 | 6425 | ((fr400 (unit u-trap)) (fr450 (unit u-trap)) |
ac7c07ac | 6426 | (fr500 (unit u-trap)) (fr550 (unit u-trap))) |
9aab5aa3 AC |
6427 | ) |
6428 | ||
6429 | (trap-immed fti ne F OP_1D Fne FR-ACCESS "float trap not equal") | |
6430 | (trap-immed fti eq F OP_1D Feq FR-ACCESS "float trap equal") | |
6431 | (trap-immed fti lg F OP_1D Flg FR-ACCESS "float trap greater or less") | |
6432 | (trap-immed fti ue F OP_1D Fue FR-ACCESS "float trap unordered or equal") | |
6433 | (trap-immed fti ul F OP_1D Ful FR-ACCESS "float trap unordered or less") | |
6434 | (trap-immed fti ge F OP_1D Fge FR-ACCESS "float trap greater or equal") | |
6435 | (trap-immed fti lt F OP_1D Flt FR-ACCESS "float trap less") | |
6436 | (trap-immed fti uge F OP_1D Fuge FR-ACCESS "float trap unordered greater or equal") | |
6437 | (trap-immed fti ug F OP_1D Fug FR-ACCESS "float trap unordered or greater") | |
6438 | (trap-immed fti le F OP_1D Fle FR-ACCESS "float trap less or equal") | |
6439 | (trap-immed fti gt F OP_1D Fgt FR-ACCESS "float trap greater") | |
6440 | (trap-immed fti ule F OP_1D Fule FR-ACCESS "float trap unordered less or equal") | |
6441 | (trap-immed fti u F OP_1D Fu FR-ACCESS "float trap unordered") | |
6442 | (trap-immed fti o F OP_1D Fo FR-ACCESS "float trap ordered") | |
6443 | ||
6444 | (dni break | |
6445 | "break trap" | |
676a64f4 RS |
6446 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6447 | (FR400-MAJOR C-1) (FR450-MAJOR C-1)) | |
9aab5aa3 AC |
6448 | "break$pack" |
6449 | (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_3 (GRj-null)) | |
6450 | (sequence () | |
6451 | ; This is defered to frv_break because for the breakpoint | |
6452 | ; case we want to change as little of the machine state as | |
6453 | ; possible. | |
6454 | ; | |
6455 | ; BPCSR=PC | |
6456 | ; BPSR.BS=PSR.S | |
6457 | ; BPSR.BET=PSR.ET | |
6458 | ; PSR.S=1 | |
6459 | ; PSR.ET=0 | |
6460 | ; TBR.TT=0xff | |
6461 | ; PC=TBR | |
6462 | ; We still should indicate what is modified by this insn. | |
6463 | (clobber (spr-bpcsr)) | |
6464 | (clobber bpsr_bs) | |
6465 | (clobber bpsr_bet) | |
6466 | (clobber psr_s) | |
6467 | (clobber psr_et) | |
6468 | (clobber tbr_tt) | |
6469 | (c-call VOID "frv_break")) | |
6470 | () | |
6471 | ) | |
6472 | ||
6473 | (dni mtrap | |
6474 | "media trap" | |
676a64f4 RS |
6475 | ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1) |
6476 | (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS) | |
9aab5aa3 AC |
6477 | "mtrap$pack" |
6478 | (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_2 (GRj-null)) | |
6479 | (c-call VOID "frv_mtrap") | |
6480 | () | |
6481 | ) | |
6482 | ||
6483 | (define-pmacro (condition-code-logic name operation ope comment) | |
6484 | (dni name | |
6485 | (comment) | |
676a64f4 RS |
6486 | ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6) |
6487 | (FR400-MAJOR B-6) (FR450-MAJOR B-6)) | |
9aab5aa3 AC |
6488 | (.str name "$pack $CRi,$CRj,$CRk") |
6489 | (+ pack (misc-null-6) CRk OP_0A (misc-null-7) CRi ope (misc-null-8) CRj) | |
6490 | (set CRk (c-call UQI "@cpu@_cr_logic" operation CRi CRj)) | |
6491 | () | |
6492 | ) | |
6493 | ) | |
6494 | (define-pmacro (op-andcr) 0) | |
6495 | (define-pmacro (op-orcr) 1) | |
6496 | (define-pmacro (op-xorcr) 2) | |
6497 | (define-pmacro (op-nandcr) 3) | |
6498 | (define-pmacro (op-norcr) 4) | |
6499 | (define-pmacro (op-andncr) 5) | |
6500 | (define-pmacro (op-orncr) 6) | |
6501 | (define-pmacro (op-nandncr) 7) | |
6502 | (define-pmacro (op-norncr) 8) | |
6503 | ||
6504 | (define-pmacro (cr-true) 3) | |
6505 | (define-pmacro (cr-false) 2) | |
6506 | (define-pmacro (cr-undefined) 0) | |
6507 | ||
6508 | (condition-code-logic andcr (op-andcr) OPE1_08 "and condition code regs") | |
6509 | (condition-code-logic orcr (op-orcr) OPE1_09 "or condition code regs") | |
6510 | (condition-code-logic xorcr (op-xorcr) OPE1_0A "xor condition code regs") | |
6511 | (condition-code-logic nandcr (op-nandcr) OPE1_0C "nand condition code regs") | |
6512 | (condition-code-logic norcr (op-norcr) OPE1_0D "nor condition code regs") | |
6513 | (condition-code-logic andncr (op-andncr) OPE1_10 "andn condition code regs") | |
6514 | (condition-code-logic orncr (op-orncr) OPE1_11 "orn condition code regs") | |
6515 | (condition-code-logic nandncr (op-nandncr) OPE1_14 "nandn condition code regs") | |
6516 | (condition-code-logic norncr (op-norncr) OPE1_15 "norn condition code regs") | |
6517 | ||
6518 | (dni notcr | |
6519 | ("not cccr register") | |
676a64f4 RS |
6520 | ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6) |
6521 | (FR400-MAJOR B-6) (FR450-MAJOR B-6)) | |
9aab5aa3 AC |
6522 | (.str notcr "$pack $CRj,$CRk") |
6523 | (+ pack (misc-null-6) CRk OP_0A (rs-null) OPE1_0B (misc-null-8) CRj) | |
6524 | (set CRk (xor CRj 1)) | |
6525 | () | |
6526 | ) | |
6527 | ||
6528 | (define-pmacro (check-semantics cond cr) | |
6529 | (if cond (set cr (cr-true)) (set cr (cr-false))) | |
6530 | ) | |
6531 | ||
6532 | (define-pmacro (check-int-condition-code prefix cc op cond comment) | |
6533 | (dni (.sym prefix cc) | |
6534 | (comment) | |
676a64f4 RS |
6535 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6536 | (FR400-MAJOR B-5) (FR450-MAJOR B-5)) | |
9aab5aa3 AC |
6537 | (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int") |
6538 | (+ pack (.sym ICC_ cc) CRj_int op (misc-null-5) ICCi_3) | |
6539 | (check-semantics (cond ICCi_3) CRj_int) | |
676a64f4 | 6540 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6541 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6542 | ) |
6543 | ) | |
6544 | ||
6545 | (dni ckra | |
6546 | "check integer cc always" | |
676a64f4 RS |
6547 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6548 | (FR400-MAJOR B-5) (FR450-MAJOR B-5)) | |
9aab5aa3 AC |
6549 | "ckra$pack $CRj_int" |
6550 | (+ pack ICC_ra CRj_int OP_08 (misc-null-5) (ICCi_3-null)) | |
6551 | (check-semantics (const BI 1) CRj_int) | |
676a64f4 | 6552 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6553 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6554 | ) |
6555 | ||
6556 | (dni ckno | |
6557 | "check integer cc never" | |
676a64f4 RS |
6558 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6559 | (FR400-MAJOR B-5) (FR450-MAJOR B-5)) | |
9aab5aa3 AC |
6560 | "ckno$pack $CRj_int" |
6561 | (+ pack ICC_nev CRj_int OP_08 (misc-null-5) (ICCi_3-null)) | |
6562 | (check-semantics (const BI 0) CRj_int) | |
676a64f4 | 6563 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6564 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6565 | ) |
6566 | ||
6567 | (check-int-condition-code ck eq OP_08 Ieq "check integer cc equal") | |
6568 | (check-int-condition-code ck ne OP_08 Ine "check integer cc not equal") | |
6569 | (check-int-condition-code ck le OP_08 Ile "check integer cc less or equal") | |
6570 | (check-int-condition-code ck gt OP_08 Igt "check integer cc greater") | |
6571 | (check-int-condition-code ck lt OP_08 Ilt "check integer cc less") | |
6572 | (check-int-condition-code ck ge OP_08 Ige "check integer cc greater or equal") | |
6573 | (check-int-condition-code ck ls OP_08 Ils "check integer cc less or equal unsigned") | |
6574 | (check-int-condition-code ck hi OP_08 Ihi "check integer cc greater unsigned") | |
6575 | (check-int-condition-code ck c OP_08 Ic "check integer cc carry set") | |
6576 | (check-int-condition-code ck nc OP_08 Inc "check integer cc carry clear") | |
6577 | (check-int-condition-code ck n OP_08 In "check integer cc negative") | |
6578 | (check-int-condition-code ck p OP_08 Ip "check integer cc positive") | |
6579 | (check-int-condition-code ck v OP_08 Iv "check integer cc overflow set") | |
6580 | (check-int-condition-code ck nv OP_08 Inv "check integer cc overflow clear") | |
6581 | ||
6582 | (define-pmacro (check-float-condition-code prefix cc op cond comment) | |
6583 | (dni (.sym prefix cc) | |
6584 | (comment) | |
676a64f4 RS |
6585 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6586 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS) | |
9aab5aa3 AC |
6587 | (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float") |
6588 | (+ pack (.sym FCC_ cc) CRj_float op (misc-null-5) FCCi_3) | |
6589 | (check-semantics (cond FCCi_3) CRj_float) | |
676a64f4 | 6590 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6591 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6592 | ) |
6593 | ) | |
6594 | ||
6595 | (dni fckra | |
6596 | "check float cc always" | |
676a64f4 RS |
6597 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6598 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS) | |
9aab5aa3 AC |
6599 | "fckra$pack $CRj_float" |
6600 | (+ pack FCC_ra CRj_float OP_09 (misc-null-5) FCCi_3) | |
6601 | (check-semantics (const BI 1) CRj_float) | |
676a64f4 | 6602 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6603 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6604 | ) |
6605 | ||
6606 | (dni fckno | |
6607 | "check float cc never" | |
676a64f4 RS |
6608 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6609 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS) | |
9aab5aa3 AC |
6610 | "fckno$pack $CRj_float" |
6611 | (+ pack FCC_nev CRj_float OP_09 (misc-null-5) FCCi_3) | |
6612 | (check-semantics (const BI 0) CRj_float) | |
676a64f4 | 6613 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6614 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6615 | ) |
6616 | ||
6617 | (check-float-condition-code fck ne OP_09 Fne "check float cc not equal") | |
6618 | (check-float-condition-code fck eq OP_09 Feq "check float cc equal") | |
6619 | (check-float-condition-code fck lg OP_09 Flg "check float cc greater or less") | |
6620 | (check-float-condition-code fck ue OP_09 Fue "check float cc unordered or equal") | |
6621 | (check-float-condition-code fck ul OP_09 Ful "check float cc unordered or less") | |
6622 | (check-float-condition-code fck ge OP_09 Fge "check float cc greater or equal") | |
6623 | (check-float-condition-code fck lt OP_09 Flt "check float cc less") | |
6624 | (check-float-condition-code fck uge OP_09 Fuge "check float cc unordered greater or equal") | |
6625 | (check-float-condition-code fck ug OP_09 Fug "check float cc unordered or greater") | |
6626 | (check-float-condition-code fck le OP_09 Fle "check float cc less or equal") | |
6627 | (check-float-condition-code fck gt OP_09 Fgt "check float cc greater") | |
6628 | (check-float-condition-code fck ule OP_09 Fule "check float cc unordered less or equal") | |
6629 | (check-float-condition-code fck u OP_09 Fu "check float cc unordered") | |
6630 | (check-float-condition-code fck o OP_09 Fo "check float cc ordered") | |
6631 | ||
6632 | (define-pmacro (conditional-check-int-condition-code prefix cc op ope test comment) | |
6633 | (dni (.sym prefix cc) | |
6634 | (comment) | |
676a64f4 RS |
6635 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6636 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL) | |
9aab5aa3 AC |
6637 | (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int,$CCi,$cond") |
6638 | (+ pack (.sym ICC_ cc) CRj_int op (rs-null) CCi cond ope | |
6639 | (misc-null-9) ICCi_3) | |
6640 | (if (eq CCi (or cond 2)) | |
6641 | (check-semantics (test ICCi_3) CRj_int) | |
6642 | (set CRj_int (cr-undefined))) | |
676a64f4 | 6643 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6644 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6645 | ) |
6646 | ) | |
6647 | ||
6648 | (dni cckra | |
6649 | "conditional check integer cc always" | |
676a64f4 RS |
6650 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6651 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL) | |
9aab5aa3 AC |
6652 | "cckra$pack $CRj_int,$CCi,$cond" |
6653 | (+ pack ICC_ra CRj_int OP_6A (rs-null) CCi cond OPE4_0 | |
6654 | (misc-null-9) (ICCi_3-null)) | |
6655 | (if (eq CCi (or cond 2)) | |
6656 | (check-semantics (const BI 1) CRj_int) | |
6657 | (set CRj_int (cr-undefined))) | |
676a64f4 | 6658 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6659 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6660 | ) |
6661 | ||
6662 | (dni cckno | |
6663 | "conditional check integer cc never" | |
676a64f4 RS |
6664 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6665 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL) | |
9aab5aa3 AC |
6666 | "cckno$pack $CRj_int,$CCi,$cond" |
6667 | (+ pack ICC_nev CRj_int OP_6A (rs-null) CCi cond OPE4_0 | |
6668 | (misc-null-9) (ICCi_3-null)) | |
6669 | (if (eq CCi (or cond 2)) | |
6670 | (check-semantics (const BI 0) CRj_int) | |
6671 | (set CRj_int (cr-undefined))) | |
676a64f4 | 6672 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6673 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6674 | ) |
6675 | ||
6676 | (conditional-check-int-condition-code cck eq OP_6A OPE4_0 Ieq "check integer cc equal") | |
6677 | (conditional-check-int-condition-code cck ne OP_6A OPE4_0 Ine "check integer cc not equal") | |
6678 | (conditional-check-int-condition-code cck le OP_6A OPE4_0 Ile "check integer cc less or equal") | |
6679 | (conditional-check-int-condition-code cck gt OP_6A OPE4_0 Igt "check integer cc greater") | |
6680 | (conditional-check-int-condition-code cck lt OP_6A OPE4_0 Ilt "check integer cc less") | |
6681 | (conditional-check-int-condition-code cck ge OP_6A OPE4_0 Ige "check integer cc greater or equal") | |
6682 | (conditional-check-int-condition-code cck ls OP_6A OPE4_0 Ils "check integer cc less or equal unsigned") | |
6683 | (conditional-check-int-condition-code cck hi OP_6A OPE4_0 Ihi "check integer cc greater unsigned") | |
6684 | (conditional-check-int-condition-code cck c OP_6A OPE4_0 Ic "check integer cc carry set") | |
6685 | (conditional-check-int-condition-code cck nc OP_6A OPE4_0 Inc "check integer cc carry clear") | |
6686 | (conditional-check-int-condition-code cck n OP_6A OPE4_0 In "check integer cc negative") | |
6687 | (conditional-check-int-condition-code cck p OP_6A OPE4_0 Ip "check integer cc positive") | |
6688 | (conditional-check-int-condition-code cck v OP_6A OPE4_0 Iv "check integer cc overflow set") | |
6689 | (conditional-check-int-condition-code cck nv OP_6A OPE4_0 Inv "check integer cc overflow clear") | |
6690 | ||
6691 | (define-pmacro (conditional-check-float-condition-code prefix cc op ope test comment) | |
6692 | (dni (.sym prefix cc) | |
6693 | (comment) | |
676a64f4 RS |
6694 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6695 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
6696 | (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float,$CCi,$cond") |
6697 | (+ pack (.sym FCC_ cc) CRj_float op (rs-null) CCi cond ope | |
6698 | (misc-null-9) FCCi_3) | |
6699 | (if (eq CCi (or cond 2)) | |
6700 | (check-semantics (test FCCi_3) CRj_float) | |
6701 | (set CRj_float (cr-undefined))) | |
676a64f4 | 6702 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6703 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6704 | ) |
6705 | ) | |
6706 | ||
6707 | (dni cfckra | |
6708 | "conditional check float cc always" | |
676a64f4 RS |
6709 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6710 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
6711 | "cfckra$pack $CRj_float,$CCi,$cond" |
6712 | (+ pack FCC_ra CRj_float OP_6A (rs-null) CCi cond OPE4_1 | |
6713 | (misc-null-9) (FCCi_3-null)) | |
6714 | (if (eq CCi (or cond 2)) | |
6715 | (check-semantics (const BI 1) CRj_float) | |
6716 | (set CRj_float (cr-undefined))) | |
676a64f4 | 6717 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6718 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6719 | ) |
6720 | ||
6721 | (dni cfckno | |
6722 | "conditional check float cc never" | |
676a64f4 RS |
6723 | ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5) |
6724 | (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS) | |
9aab5aa3 AC |
6725 | "cfckno$pack $CRj_float,$CCi,$cond" |
6726 | (+ pack FCC_nev CRj_float OP_6A (rs-null) CCi cond OPE4_1 | |
6727 | (misc-null-9) (FCCi_3-null)) | |
6728 | (if (eq CCi (or cond 2)) | |
6729 | (check-semantics (const BI 0) CRj_float) | |
6730 | (set CRj_float (cr-undefined))) | |
676a64f4 | 6731 | ((fr400 (unit u-check)) (fr450 (unit u-check)) |
ac7c07ac | 6732 | (fr500 (unit u-check)) (fr550 (unit u-check))) |
9aab5aa3 AC |
6733 | ) |
6734 | ||
6735 | (conditional-check-float-condition-code cfck ne OP_6A OPE4_1 Fne "check float cc not equal") | |
6736 | (conditional-check-float-condition-code cfck eq OP_6A OPE4_1 Feq "check float cc equal") | |
6737 | (conditional-check-float-condition-code cfck lg OP_6A OPE4_1 Flg "check float cc greater or less") | |
6738 | (conditional-check-float-condition-code cfck ue OP_6A OPE4_1 Fue "check float cc unordered or equal") | |
6739 | (conditional-check-float-condition-code cfck ul OP_6A OPE4_1 Ful "check float cc unordered or less") | |
6740 | (conditional-check-float-condition-code cfck ge OP_6A OPE4_1 Fge "check float cc greater or equal") | |
6741 | (conditional-check-float-condition-code cfck lt OP_6A OPE4_1 Flt "check float cc less") | |
6742 | (conditional-check-float-condition-code cfck uge OP_6A OPE4_1 Fuge "check float cc unordered greater or equal") | |
6743 | (conditional-check-float-condition-code cfck ug OP_6A OPE4_1 Fug "check float cc unordered or greater") | |
6744 | (conditional-check-float-condition-code cfck le OP_6A OPE4_1 Fle "check float cc less or equal") | |
6745 | (conditional-check-float-condition-code cfck gt OP_6A OPE4_1 Fgt "check float cc greater") | |
6746 | (conditional-check-float-condition-code cfck ule OP_6A OPE4_1 Fule "check float cc unordered less or equal") | |
6747 | (conditional-check-float-condition-code cfck u OP_6A OPE4_1 Fu "check float cc unordered") | |
6748 | (conditional-check-float-condition-code cfck o OP_6A OPE4_1 Fo "check float cc ordered") | |
6749 | ||
6750 | (dni cjmpl | |
6751 | "conditional jump and link" | |
c7a48b9a | 6752 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
676a64f4 | 6753 | (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL) |
9aab5aa3 AC |
6754 | "cjmpl$pack @($GRi,$GRj),$CCi,$cond" |
6755 | (+ pack (misc-null-1) (LI-off) OP_6A GRi CCi cond OPE4_2 GRj) | |
6756 | (if (eq CCi (or cond 2)) | |
6757 | (jump-and-link-semantics GRi GRj LI)) | |
676a64f4 | 6758 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
ac7c07ac | 6759 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6760 | ) |
6761 | ||
6762 | (dni ccalll | |
6763 | "conditional call and link" | |
c7a48b9a | 6764 | ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6) |
676a64f4 | 6765 | (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL) |
9aab5aa3 AC |
6766 | "ccalll$pack @($GRi,$GRj),$CCi,$cond" |
6767 | (+ pack (misc-null-1) (LI-on) OP_6A GRi CCi cond OPE4_2 GRj) | |
6768 | (if (eq CCi (or cond 2)) | |
6769 | (jump-and-link-semantics GRi GRj LI)) | |
676a64f4 | 6770 | ((fr400 (unit u-branch)) (fr450 (unit u-branch)) |
c7a48b9a | 6771 | (fr500 (unit u-branch)) (fr550 (unit u-branch))) |
9aab5aa3 AC |
6772 | ) |
6773 | ||
6774 | (define-pmacro (cache-invalidate name cache all op ope profile comment) | |
6775 | (dni name | |
6776 | (comment) | |
676a64f4 RS |
6777 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
6778 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6779 | (.str name "$pack @($GRi,$GRj)") |
6780 | (+ pack (rd-null) op GRi ope GRj) | |
6781 | (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) all) | |
6782 | profile | |
6783 | ) | |
6784 | ) | |
6785 | ||
6786 | (cache-invalidate ici insn 0 OP_03 OPE1_38 | |
676a64f4 RS |
6787 | ((fr400 (unit u-ici)) (fr450 (unit u-ici)) |
6788 | (fr500 (unit u-ici)) (fr550 (unit u-ici))) | |
9aab5aa3 AC |
6789 | "invalidate insn cache") |
6790 | (cache-invalidate dci data 0 OP_03 OPE1_3C | |
676a64f4 RS |
6791 | ((fr400 (unit u-dci)) (fr450 (unit u-dci)) |
6792 | (fr500 (unit u-dci)) (fr550 (unit u-dci))) | |
9aab5aa3 AC |
6793 | "invalidate data cache") |
6794 | ||
6795 | (define-pmacro (cache-invalidate-entry name cache op ope profile comment) | |
6796 | (dni name | |
6797 | (comment) | |
676a64f4 RS |
6798 | ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2) |
6799 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6800 | (.str name "$pack @($GRi,$GRj),$ae") |
6801 | (+ pack (misc-null-1) ae op GRi ope GRj) | |
6802 | (if (eq ae 0) | |
6803 | (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) -1) ; Invalid ae setting for this insn | |
6804 | (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) ae)) | |
6805 | profile | |
6806 | ) | |
6807 | ) | |
6808 | ||
6809 | (cache-invalidate-entry icei insn OP_03 OPE1_39 | |
676a64f4 RS |
6810 | ((fr400 (unit u-ici)) (fr450 (unit u-ici)) |
6811 | (fr550 (unit u-ici))) | |
9aab5aa3 AC |
6812 | "invalidate insn cache entry") |
6813 | (cache-invalidate-entry dcei data OP_03 OPE1_3A | |
676a64f4 RS |
6814 | ((fr400 (unit u-dci)) (fr450 (unit u-dci)) |
6815 | (fr550 (unit u-dci))) | |
9aab5aa3 AC |
6816 | "invalidate data cache entry") |
6817 | ||
6818 | (dni dcf | |
6819 | "Data cache flush" | |
676a64f4 RS |
6820 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
6821 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6822 | "dcf$pack @($GRi,$GRj)" |
6823 | (+ pack (rd-null) OP_03 GRi OPE1_3D GRj) | |
6824 | (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) 0) | |
676a64f4 | 6825 | ((fr400 (unit u-dcf)) (fr450 (unit u-dcf)) |
ac7c07ac | 6826 | (fr500 (unit u-dcf)) (fr550 (unit u-dcf))) |
9aab5aa3 AC |
6827 | ) |
6828 | ||
6829 | (dni dcef | |
6830 | "Data cache entry flush" | |
676a64f4 RS |
6831 | ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2) |
6832 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6833 | "dcef$pack @($GRi,$GRj),$ae" |
6834 | (+ pack (misc-null-1) ae OP_03 GRi OPE1_3B GRj) | |
6835 | (if (eq ae 0) | |
6836 | (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) -1) | |
6837 | (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) ae)) | |
676a64f4 | 6838 | ((fr400 (unit u-dcf)) (fr450 (unit u-dcf)) (fr550 (unit u-dcf))) |
9aab5aa3 AC |
6839 | ) |
6840 | ||
6841 | (define-pmacro (write-TLB name insn op ope comment) | |
6842 | (dni name | |
6843 | (comment) | |
6844 | ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED) | |
6845 | (.str insn "$pack $GRk,@($GRi,$GRj)") | |
6846 | (+ pack GRk op GRi ope GRj) | |
6847 | (nop) ; for now | |
6848 | () | |
6849 | ) | |
6850 | ) | |
6851 | ||
6852 | (write-TLB witlb witlb OP_03 OPE1_32 "write for insn TLB") | |
6853 | (write-TLB wdtlb wdtlb OP_03 OPE1_36 "write for data TLB") | |
6854 | ||
6855 | (define-pmacro (invalidate-TLB name insn op ope comment) | |
6856 | (dni name | |
6857 | (comment) | |
6858 | ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED) | |
6859 | (.str insn "$pack @($GRi,$GRj)") | |
6860 | (+ pack (rd-null) op GRi ope GRj) | |
6861 | (nop) ; for now | |
6862 | () | |
6863 | ) | |
6864 | ) | |
6865 | ||
6866 | (invalidate-TLB itlbi itlbi OP_03 OPE1_33 "invalidate insn TLB") | |
6867 | (invalidate-TLB dtlbi dtlbi OP_03 OPE1_37 "invalidate data TLB") | |
6868 | ||
0457efce | 6869 | (define-pmacro (cache-preload name cache pipe attrs op ope profile comment) |
9aab5aa3 AC |
6870 | (dni name |
6871 | (comment) | |
676a64f4 RS |
6872 | (.splice (UNIT pipe) (FR500-MAJOR C-2) |
6873 | (FR400-MAJOR C-2) (.unsplice attrs)) | |
9aab5aa3 AC |
6874 | (.str name "$pack $GRi,$GRj,$lock") |
6875 | (+ pack (misc-null-1) lock op GRi ope GRj) | |
6876 | (c-call VOID (.str "@cpu@_" cache "_cache_preload") GRi GRj lock) | |
6877 | profile | |
6878 | ) | |
6879 | ) | |
6880 | ||
676a64f4 RS |
6881 | (cache-preload icpl insn C ((FR550-MAJOR C-2) (FR450-MAJOR C-2)) OP_03 OPE1_30 |
6882 | ((fr400 (unit u-icpl)) (fr450 (unit u-icpl)) | |
6883 | (fr500 (unit u-icpl)) (fr550 (unit u-icpl))) | |
9aab5aa3 | 6884 | "preload insn cache") |
676a64f4 RS |
6885 | (cache-preload dcpl data DCPL ((FR550-MAJOR I-8) (FR450-MAJOR I-2)) OP_03 OPE1_34 |
6886 | ((fr400 (unit u-dcpl)) (fr450 (unit u-dcpl)) | |
6887 | (fr500 (unit u-dcpl)) (fr550 (unit u-dcpl))) | |
9aab5aa3 AC |
6888 | "preload data cache") |
6889 | ||
6890 | (define-pmacro (cache-unlock name cache op ope profile comment) | |
6891 | (dni name | |
6892 | (comment) | |
676a64f4 RS |
6893 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
6894 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6895 | (.str name "$pack $GRi") |
6896 | (+ pack (rd-null) op GRi ope (GRj-null)) | |
6897 | (c-call VOID (.str "@cpu@_" cache "_cache_unlock") GRi) | |
6898 | profile | |
6899 | ) | |
6900 | ) | |
6901 | ||
6902 | (cache-unlock icul insn OP_03 OPE1_31 | |
676a64f4 RS |
6903 | ((fr400 (unit u-icul)) (fr450 (unit u-icul)) |
6904 | (fr500 (unit u-icul)) (fr550 (unit u-icul))) | |
9aab5aa3 AC |
6905 | "unlock insn cache") |
6906 | (cache-unlock dcul data OP_03 OPE1_35 | |
676a64f4 RS |
6907 | ((fr400 (unit u-dcul)) (fr450 (unit u-dcul)) |
6908 | (fr500 (unit u-dcul)) (fr550 (unit u-dcul))) | |
9aab5aa3 AC |
6909 | "unlock data cache") |
6910 | ||
6911 | (define-pmacro (barrier name insn op ope profile comment) | |
6912 | (dni name | |
6913 | (comment) | |
676a64f4 RS |
6914 | ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2) |
6915 | (FR400-MAJOR C-2) (FR450-MAJOR C-2)) | |
9aab5aa3 AC |
6916 | (.str insn "$pack") |
6917 | (+ pack (rd-null) op (rs-null) ope (GRj-null)) | |
6918 | (nop) ; sufficient implementation | |
6919 | profile | |
6920 | ) | |
6921 | ) | |
6922 | ||
6923 | (barrier bar bar OP_03 OPE1_3E | |
676a64f4 RS |
6924 | ((fr400 (unit u-barrier)) (fr450 (unit u-barrier)) |
6925 | (fr500 (unit u-barrier))) | |
9aab5aa3 AC |
6926 | "barrier") |
6927 | (barrier membar membar OP_03 OPE1_3F | |
676a64f4 RS |
6928 | ((fr400 (unit u-membar)) (fr450 (unit u-membar)) |
6929 | (fr500 (unit u-membar))) | |
9aab5aa3 AC |
6930 | "memory barrier") |
6931 | ||
676a64f4 RS |
6932 | ; Load real address instructions |
6933 | (define-pmacro (load-real-address name insn what op ope) | |
6934 | (dni name | |
6935 | (.str "Load real address of " what) | |
6936 | ((UNIT C) (FR450-MAJOR C-2) (MACH fr450)) | |
6937 | (.str insn "$pack $GRi,$GRk,$LRAE,$LRAD,$LRAS") | |
6938 | (+ pack GRk op GRi ope LRAE LRAD LRAS (LRA-null)) | |
6939 | (nop) ; not simulated | |
6940 | () | |
6941 | ) | |
6942 | ) | |
6943 | ||
6944 | (load-real-address lrai "lrai" "instruction" OP_03 OPE1_20) | |
6945 | (load-real-address lrad "lrad" "data" OP_03 OPE1_21) | |
6946 | ||
6947 | (dni tlbpr | |
6948 | "TLB Probe" | |
6949 | ((UNIT C) (FR450-MAJOR C-2) (MACH fr450)) | |
6950 | "tlbpr$pack $GRi,$GRj,$TLBPRopx,$TLBPRL" | |
6951 | (+ pack (TLBPR-null) TLBPRopx TLBPRL OP_03 GRi OPE1_24 GRj) | |
6952 | (nop) ; not simulated | |
6953 | () | |
6954 | ) | |
6955 | ||
9aab5aa3 AC |
6956 | ; Coprocessor operations |
6957 | (define-pmacro (cop-op num op) | |
6958 | (dni (.sym cop num) | |
6959 | "Coprocessor operation" | |
6960 | ((UNIT C) (FR500-MAJOR C-2) (MACH frv)) | |
6961 | (.str "cop" num "$pack $s6_1,$CPRi,$CPRj,$CPRk") | |
6962 | (+ pack CPRk op CPRi s6_1 CPRj) | |
6963 | (nop) ; sufficient implementation | |
6964 | () | |
6965 | ) | |
6966 | ) | |
6967 | ||
6968 | (cop-op 1 OP_7E) | |
6969 | (cop-op 2 OP_7F) | |
6970 | ||
6971 | (define-pmacro (clear-ne-flag-semantics target_index is_float) | |
6972 | (c-call VOID "@cpu@_clear_ne_flags" target_index is_float) | |
6973 | ) | |
6974 | ||
23600bb3 | 6975 | (define-pmacro (clear-ne-flag-r name op ope reg is_float attr profile comment) |
9aab5aa3 AC |
6976 | (dni name |
6977 | (comment) | |
ac7c07ac | 6978 | ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr) |
9aab5aa3 AC |
6979 | (.str name "$pack $" reg "k") |
6980 | (+ pack (.sym reg k) op (rs-null) ope (GRj-null)) | |
23600bb3 DB |
6981 | (sequence () |
6982 | ; hack to get this referenced for profiling | |
6983 | (c-raw-call VOID "frv_ref_SI" (.sym reg k)) | |
6984 | (clear-ne-flag-semantics (index-of (.sym reg k)) is_float)) | |
6985 | profile | |
9aab5aa3 AC |
6986 | ) |
6987 | ) | |
6988 | ||
23600bb3 | 6989 | (clear-ne-flag-r clrgr OP_0A OPE1_00 GR 0 NA |
ac7c07ac | 6990 | ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr))) |
23600bb3 DB |
6991 | "Clear GR NE flag") |
6992 | (clear-ne-flag-r clrfr OP_0A OPE1_02 FR 1 FR-ACCESS | |
ac7c07ac | 6993 | ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr))) |
23600bb3 | 6994 | "Clear FR NE flag") |
9aab5aa3 | 6995 | |
23600bb3 | 6996 | (define-pmacro (clear-ne-flag-all name op ope is_float attr profile comment) |
9aab5aa3 AC |
6997 | (dni name |
6998 | (comment) | |
ac7c07ac | 6999 | ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr) |
9aab5aa3 AC |
7000 | (.str name "$pack") |
7001 | (+ pack (rd-null) op (rs-null) ope (GRj-null)) | |
7002 | (clear-ne-flag-semantics -1 is_float) | |
23600bb3 | 7003 | profile |
9aab5aa3 AC |
7004 | ) |
7005 | ) | |
7006 | ||
23600bb3 | 7007 | (clear-ne-flag-all clrga OP_0A OPE1_01 0 NA |
ac7c07ac | 7008 | ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr))) |
23600bb3 DB |
7009 | "Clear GR NE flag ALL") |
7010 | (clear-ne-flag-all clrfa OP_0A OPE1_03 1 FR-ACCESS | |
ac7c07ac | 7011 | ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr))) |
23600bb3 | 7012 | "Clear FR NE flag ALL") |
9aab5aa3 AC |
7013 | |
7014 | (define-pmacro (commit-semantics target_index is_float) | |
7015 | (c-call VOID "@cpu@_commit" target_index is_float) | |
7016 | ) | |
7017 | ||
7018 | (define-pmacro (commit-r name op ope reg is_float attr comment) | |
7019 | (dni name | |
7020 | (comment) | |
ac7c07ac | 7021 | ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr) |
9aab5aa3 AC |
7022 | (.str name "$pack $" reg "k") |
7023 | (+ pack (.sym reg k) op (rs-null) ope (GRj-null)) | |
7024 | (commit-semantics (index-of (.sym reg k)) is_float) | |
ac7c07ac | 7025 | ((fr500 (unit u-commit)) (fr550 (unit u-commit))) |
9aab5aa3 AC |
7026 | ) |
7027 | ) | |
7028 | ||
7029 | (commit-r commitgr OP_0A OPE1_04 GR 0 NA "commit exceptions, specific GR") | |
7030 | (commit-r commitfr OP_0A OPE1_06 FR 1 FR-ACCESS "commit exceptions, specific FR") | |
7031 | ||
7032 | (define-pmacro (commit name op ope is_float attr comment) | |
7033 | (dni name | |
7034 | (comment) | |
ac7c07ac | 7035 | ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr) |
9aab5aa3 AC |
7036 | (.str name "$pack") |
7037 | (+ pack (rd-null) op (rs-null) ope (GRj-null)) | |
7038 | (commit-semantics -1 is_float) | |
ac7c07ac | 7039 | ((fr500 (unit u-commit)) (fr550 (unit u-commit))) |
9aab5aa3 AC |
7040 | ) |
7041 | ) | |
7042 | ||
7043 | (commit commitga OP_0A OPE1_05 0 NA "commit exceptions, any GR") | |
7044 | (commit commitfa OP_0A OPE1_07 1 FR-ACCESS "commit exceptions, any FR") | |
7045 | ||
7046 | (define-pmacro (floating-point-conversion | |
7047 | name op ope conv mode src targ attr comment) | |
7048 | (dni name | |
7049 | (comment) | |
0457efce | 7050 | (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr)) |
9aab5aa3 AC |
7051 | (.str name "$pack $" src ",$" targ) |
7052 | (+ pack targ op (rs-null) ope src) | |
7053 | (set targ (conv mode src)) | |
ac7c07ac | 7054 | ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert))) |
9aab5aa3 AC |
7055 | ) |
7056 | ) | |
7057 | ||
0457efce | 7058 | (floating-point-conversion fitos OP_79 OPE1_00 float SF FRintj FRk |
ac7c07ac | 7059 | ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
0457efce DB |
7060 | "Convert Integer to Single") |
7061 | (floating-point-conversion fstoi OP_79 OPE1_01 fix SI FRj FRintk | |
ac7c07ac | 7062 | ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
0457efce DB |
7063 | "Convert Single to Integer") |
7064 | (floating-point-conversion fitod OP_7A OPE1_00 float DF FRintj FRdoublek | |
7065 | ((MACH frv)) | |
7066 | "Convert Integer to Double") | |
7067 | (floating-point-conversion fdtoi OP_7A OPE1_01 fix SI FRdoublej FRintk | |
7068 | ((MACH frv)) | |
7069 | "Convert Double to Integer") | |
9aab5aa3 AC |
7070 | |
7071 | (define-pmacro (floating-point-dual-conversion | |
7072 | name op ope conv mode src src_hw targ targ_hw attr comment) | |
7073 | (dni name | |
7074 | (comment) | |
8caa9169 | 7075 | ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) attr) |
9aab5aa3 AC |
7076 | (.str name "$pack $" src ",$" targ) |
7077 | (+ pack targ op (rs-null) ope src) | |
7078 | (sequence () | |
7079 | (set targ (conv mode src)) | |
7080 | (set (nextreg targ_hw targ 1) | |
7081 | (conv mode (nextreg src_hw src 1)))) | |
7082 | ((fr500 (unit u-float-dual-convert))) | |
7083 | ) | |
7084 | ) | |
7085 | ||
7086 | (floating-point-dual-conversion fditos OP_79 OPE1_10 float SF FRintj h-fr_int FRk h-fr NA "Dual Convert Integer to Single") | |
7087 | (floating-point-dual-conversion fdstoi OP_79 OPE1_11 fix SI FRj h-fr FRintk h-fr_int NA "Dual Convert Single to Integer") | |
7088 | ||
7089 | (define-pmacro (ne-floating-point-dual-conversion | |
7090 | name op ope conv mode src src_hw targ targ_hw attr comment) | |
7091 | (dni name | |
7092 | (comment) | |
8caa9169 | 7093 | ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) NON-EXCEPTING attr) |
9aab5aa3 AC |
7094 | (.str name "$pack $" src ",$" targ) |
7095 | (+ pack targ op (rs-null) ope src) | |
7096 | (sequence () | |
7097 | (c-call VOID "@cpu@_set_ne_index" (index-of targ)) | |
7098 | (set targ (conv mode src)) | |
7099 | (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1)) | |
7100 | (set (nextreg targ_hw targ 1) | |
7101 | (conv mode (nextreg src_hw src 1)))) | |
7102 | ((fr500 (unit u-float-dual-convert))) | |
7103 | ) | |
7104 | ) | |
7105 | ||
7106 | (ne-floating-point-dual-conversion nfditos OP_79 OPE1_30 float SF FRintj h-fr_int FRk h-fr NA "Non excepting dual Convert Integer to Single") | |
7107 | (ne-floating-point-dual-conversion nfdstoi OP_79 OPE1_31 fix SI FRj h-fr FRintk h-fr_int NA "Non excepting dual Convert Single to Integer") | |
7108 | ||
7109 | (define-pmacro (conditional-floating-point-conversion | |
7110 | name op ope conv mode src targ comment) | |
7111 | (dni name | |
7112 | (comment) | |
ac7c07ac | 7113 | ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7114 | (.str name "$pack $" src ",$" targ ",$CCi,$cond") |
7115 | (+ pack targ op (rs-null) CCi cond ope src) | |
7116 | (if (eq CCi (or cond 2)) | |
7117 | (set targ (conv mode src))) | |
ac7c07ac | 7118 | ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert))) |
9aab5aa3 AC |
7119 | ) |
7120 | ) | |
7121 | ||
7122 | (conditional-floating-point-conversion cfitos OP_6B OPE4_0 float SF FRintj FRk "Conditional convert Integer to Single") | |
7123 | (conditional-floating-point-conversion cfstoi OP_6B OPE4_1 fix SI FRj FRintk "Conditional convert Single to Integer") | |
7124 | ||
7125 | (define-pmacro (ne-floating-point-conversion | |
7126 | name op ope conv mode src targ comment) | |
7127 | (dni name | |
7128 | (comment) | |
ac7c07ac | 7129 | ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7130 | (.str name "$pack $" src ",$" targ) |
7131 | (+ pack targ op (rs-null) ope src) | |
7132 | (sequence () | |
7133 | (c-call VOID "@cpu@_set_ne_index" (index-of targ)) | |
7134 | (set targ (conv mode src))) | |
ac7c07ac | 7135 | ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert))) |
9aab5aa3 AC |
7136 | ) |
7137 | ) | |
7138 | ||
7139 | (ne-floating-point-conversion nfitos OP_79 OPE1_20 float SF FRintj FRk "NE convert Integer to Single") | |
7140 | (ne-floating-point-conversion nfstoi OP_79 OPE1_21 fix SI FRj FRintk "NE convert Single to Integer") | |
7141 | ||
7142 | (register-transfer fmovs OP_79 OPE1_02 | |
1340b9a9 | 7143 | FRj FRk FMALL |
ac7c07ac | 7144 | ((FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7145 | ((fr500 (unit u-fr2fr))) |
7146 | "Move Single Float") | |
7147 | (register-transfer fmovd OP_7A OPE1_02 | |
7148 | ; TODO -- unit doesn't handle extra register | |
0457efce DB |
7149 | FRdoublej FRdoublek FM01 |
7150 | ((FR500-MAJOR F-1) (MACH frv)) | |
ac7c07ac | 7151 | ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr))) |
9aab5aa3 AC |
7152 | "Move Double Float") |
7153 | ||
7154 | (dni fdmovs | |
7155 | "Dual move single float" | |
8caa9169 | 7156 | ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1)) |
9aab5aa3 AC |
7157 | "fdmovs$pack $FRj,$FRk" |
7158 | (+ pack FRk OP_79 (rs-null) OPE1_12 FRj) | |
7159 | (sequence () | |
7160 | (set FRk FRj) | |
7161 | (set (nextreg h-fr FRk 1) (nextreg h-fr FRj 1))) | |
7162 | ; TODO -- unit doesn't handle extra register | |
7163 | ((fr500 (unit u-fr2fr))) | |
7164 | ) | |
7165 | ||
ac28a1cb | 7166 | (conditional-register-transfer cfmovs OP_6C OPE4_0 FRj FRk FMALL |
ac7c07ac DB |
7167 | ((FR500-MAJOR F-1) (FR550-MAJOR F-2) |
7168 | (MACH simple,tomcat,fr500,fr550,frv)) | |
7169 | ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr))) | |
9aab5aa3 AC |
7170 | "Conditional move Single Float") |
7171 | ||
7172 | (define-pmacro (floating-point-neg name src targ op ope attr comment) | |
7173 | (dni name | |
7174 | (comment) | |
0457efce | 7175 | (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr)) |
9aab5aa3 AC |
7176 | (.str name "$pack $" src ",$" targ) |
7177 | (+ pack src op (rs-null) ope targ) | |
7178 | (set targ (neg src)) | |
ac7c07ac | 7179 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) |
9aab5aa3 AC |
7180 | ) |
7181 | ) | |
7182 | ||
ac7c07ac | 7183 | (floating-point-neg fnegs FRj FRk OP_79 OPE1_03 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Floating point negate, single") |
0457efce | 7184 | (floating-point-neg fnegd FRdoublej FRdoublek OP_7A OPE1_03 ((MACH frv)) "Floating point negate, double") |
9aab5aa3 AC |
7185 | |
7186 | (dni fdnegs | |
7187 | "Floating point dual negate, single" | |
8caa9169 | 7188 | ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1)) |
9aab5aa3 AC |
7189 | "fdnegs$pack $FRj,$FRk" |
7190 | (+ pack FRk OP_79 (rs-null) OPE1_13 FRj) | |
7191 | (sequence () | |
7192 | (set FRk (neg FRj)) | |
7193 | (set (nextreg h-fr FRk 1) (neg (nextreg h-fr FRj 1)))) | |
7194 | ((fr500 (unit u-float-dual-arith))) | |
7195 | ) | |
7196 | ||
7197 | (dni cfnegs | |
7198 | "Conditional floating point negate, single" | |
ac7c07ac | 7199 | ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7200 | "cfnegs$pack $FRj,$FRk,$CCi,$cond" |
7201 | (+ pack FRj OP_6C (rs-null) CCi cond OPE4_1 FRk) | |
7202 | (if (eq CCi (or cond 2)) | |
7203 | (set FRk (neg FRj))) | |
ac7c07ac | 7204 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) |
9aab5aa3 AC |
7205 | ) |
7206 | ||
7207 | (define-pmacro (float-abs name src targ op ope attr comment) | |
7208 | (dni name | |
7209 | (comment) | |
0457efce | 7210 | (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr)) |
9aab5aa3 AC |
7211 | (.str name "$pack $" src ",$" targ ) |
7212 | (+ pack targ op (rs-null) ope src) | |
7213 | (set targ (abs src)) | |
ac7c07ac | 7214 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) |
9aab5aa3 AC |
7215 | ) |
7216 | ) | |
7217 | ||
ac7c07ac | 7218 | (float-abs fabss FRj FRk OP_79 OPE1_04 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Float absolute value, single") |
0457efce | 7219 | (float-abs fabsd FRdoublej FRdoublek OP_7A OPE1_04 ((MACH frv)) "Float absolute value, double") |
9aab5aa3 AC |
7220 | |
7221 | (dni fdabss | |
7222 | "Floating point dual absolute value, single" | |
8caa9169 | 7223 | ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1)) |
9aab5aa3 AC |
7224 | "fdabss$pack $FRj,$FRk" |
7225 | (+ pack FRk OP_79 (rs-null) OPE1_14 FRj) | |
7226 | (sequence () | |
7227 | (set FRk (abs FRj)) | |
7228 | (set (nextreg h-fr FRk 1) (abs (nextreg h-fr FRj 1)))) | |
7229 | ((fr500 (unit u-float-dual-arith))) | |
7230 | ) | |
7231 | ||
7232 | (dni cfabss | |
7233 | "Conditional floating point absolute value, single" | |
ac7c07ac | 7234 | ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7235 | "cfabss$pack $FRj,$FRk,$CCi,$cond" |
7236 | (+ pack FRj OP_6C (rs-null) CCi cond OPE4_2 FRk) | |
7237 | (if (eq CCi (or cond 2)) | |
7238 | (set FRk (abs FRj))) | |
ac7c07ac | 7239 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) |
9aab5aa3 AC |
7240 | ) |
7241 | ||
7242 | (dni fsqrts | |
7243 | "Square root single" | |
ac7c07ac | 7244 | ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7245 | "fsqrts$pack $FRj,$FRk" |
7246 | (+ pack FRk OP_79 (rs-null) OPE1_05 FRj) | |
7247 | (set FRk (sqrt SF FRj)) | |
ac7c07ac | 7248 | ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt))) |
9aab5aa3 AC |
7249 | ) |
7250 | ||
7251 | (dni fdsqrts | |
7252 | "Dual square root single" | |
7253 | ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4)) | |
7254 | "fdsqrts$pack $FRj,$FRk" | |
7255 | (+ pack FRk OP_79 (rs-null) OPE1_15 FRj) | |
7256 | (sequence () | |
7257 | (set FRk (sqrt SF FRj)) | |
7258 | (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1)))) | |
7259 | ((fr500 (unit u-float-dual-sqrt))) | |
7260 | ) | |
7261 | ||
7262 | (dni nfdsqrts | |
7263 | "Non excepting Dual square root single" | |
7264 | ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4) NON-EXCEPTING) | |
7265 | "nfdsqrts$pack $FRj,$FRk" | |
7266 | (+ pack FRk OP_79 (rs-null) OPE1_35 FRj) | |
7267 | (sequence () | |
7268 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7269 | (set FRk (sqrt SF FRj)) | |
7270 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7271 | (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1)))) | |
7272 | ((fr500 (unit u-float-dual-sqrt))) | |
7273 | ) | |
7274 | ||
7275 | (dni fsqrtd | |
7276 | "Square root double" | |
7277 | ((UNIT FM01) (FR500-MAJOR F-4) (MACH frv)) | |
7278 | "fsqrtd$pack $FRdoublej,$FRdoublek" | |
7279 | (+ pack FRdoublek OP_7A (rs-null) OPE1_05 FRdoublej) | |
7280 | (set FRdoublek (sqrt DF FRdoublej)) | |
7281 | ((fr500 (unit u-float-sqrt))) | |
7282 | ) | |
7283 | ||
7284 | (dni cfsqrts | |
7285 | "Conditional square root single" | |
ac7c07ac | 7286 | ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7287 | "cfsqrts$pack $FRj,$FRk,$CCi,$cond" |
7288 | (+ pack FRk OP_6E (rs-null) CCi cond OPE4_2 FRj) | |
7289 | (if (eq CCi (or cond 2)) | |
7290 | (set FRk (sqrt SF FRj))) | |
ac7c07ac | 7291 | ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt))) |
9aab5aa3 AC |
7292 | ) |
7293 | ||
7294 | (dni nfsqrts | |
7295 | "Non exception square root, single" | |
ac7c07ac | 7296 | ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7297 | "nfsqrts$pack $FRj,$FRk" |
7298 | (+ pack FRk OP_79 (rs-null) OPE1_25 FRj) | |
7299 | (sequence () | |
7300 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7301 | (set FRk (sqrt SF FRj))) | |
ac7c07ac | 7302 | ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt))) |
9aab5aa3 AC |
7303 | ) |
7304 | ||
0457efce | 7305 | (define-pmacro (float-binary-op-s name pipe attr operation op ope comment) |
9aab5aa3 AC |
7306 | (dni name |
7307 | (comment) | |
ac7c07ac | 7308 | (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) (.unsplice attr)) |
9aab5aa3 AC |
7309 | (.str name "$pack $FRi,$FRj,$FRk") |
7310 | (+ pack FRk op FRi ope FRj) | |
7311 | (set FRk (operation FRi FRj)) | |
ac7c07ac | 7312 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) |
9aab5aa3 AC |
7313 | ) |
7314 | ) | |
7315 | ||
ac7c07ac DB |
7316 | (float-binary-op-s fadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_06 "add single float") |
7317 | (float-binary-op-s fsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_07 "sub single float") | |
7318 | (float-binary-op-s fmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_08 "mul single float") | |
9aab5aa3 AC |
7319 | |
7320 | (dni fdivs | |
7321 | "div single float" | |
ac7c07ac | 7322 | ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7323 | "fdivs$pack $FRi,$FRj,$FRk" |
7324 | (+ pack FRk OP_79 FRi OPE1_09 FRj) | |
7325 | (set FRk (div FRi FRj)) | |
ac7c07ac DB |
7326 | ((fr500 (unit u-float-div)) |
7327 | (fr550 (unit u-float-div))) | |
9aab5aa3 AC |
7328 | ) |
7329 | ||
7330 | (define-pmacro (float-binary-op-d name operation op ope major comment) | |
7331 | (dni name | |
7332 | (comment) | |
8caa9169 | 7333 | ((UNIT FMALL) (FR500-MAJOR major) (MACH frv)) |
9aab5aa3 AC |
7334 | (.str name "$pack $FRdoublei,$FRdoublej,$FRdoublek") |
7335 | (+ pack FRdoublek op FRdoublei ope FRdoublej) | |
7336 | (set FRdoublek (operation FRdoublei FRdoublej)) | |
7337 | ((fr500 (unit u-float-arith))) | |
7338 | ) | |
7339 | ) | |
7340 | ||
7341 | (float-binary-op-d faddd add OP_7A OPE1_06 F-2 "add double float") | |
7342 | (float-binary-op-d fsubd sub OP_7A OPE1_07 F-2 "sub double float") | |
7343 | (float-binary-op-d fmuld mul OP_7A OPE1_08 F-3 "mul double float") | |
7344 | (float-binary-op-d fdivd div OP_7A OPE1_09 F-4 "div double float") | |
7345 | ||
d0312406 | 7346 | (define-pmacro (conditional-float-binary-op name pipe attr operation op ope profile comment) |
9aab5aa3 AC |
7347 | (dni name |
7348 | (comment) | |
ac7c07ac | 7349 | (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) |
0457efce | 7350 | (.unsplice attr)) |
9aab5aa3 AC |
7351 | (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond") |
7352 | (+ pack FRk op FRi CCi cond ope FRj) | |
7353 | (if (eq CCi (or cond 2)) | |
7354 | (set FRk (operation FRi FRj))) | |
d0312406 | 7355 | profile |
9aab5aa3 AC |
7356 | ) |
7357 | ) | |
7358 | ||
ac7c07ac DB |
7359 | (conditional-float-binary-op cfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_6D OPE4_0 |
7360 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7361 | "cond add single") |
ac7c07ac DB |
7362 | (conditional-float-binary-op cfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_6D OPE4_1 |
7363 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7364 | "cond sub single") |
ac7c07ac DB |
7365 | (conditional-float-binary-op cfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_6E OPE4_0 |
7366 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7367 | "cond mul single") |
ac7c07ac DB |
7368 | (conditional-float-binary-op cfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_6E OPE4_1 |
7369 | ((fr500 (unit u-float-div)) (fr550 (unit u-float-div))) | |
d0312406 | 7370 | "cond div single") |
9aab5aa3 | 7371 | |
d0312406 | 7372 | (define-pmacro (ne-float-binary-op name pipe attr operation op ope profile comment) |
9aab5aa3 AC |
7373 | (dni name |
7374 | (comment) | |
ac7c07ac | 7375 | (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) |
0457efce | 7376 | (.unsplice attr)) |
9aab5aa3 AC |
7377 | (.str name "$pack $FRi,$FRj,$FRk") |
7378 | (+ pack FRk op FRi ope FRj) | |
7379 | (sequence () | |
7380 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7381 | (set FRk (operation FRi FRj))) | |
d0312406 | 7382 | profile |
9aab5aa3 AC |
7383 | ) |
7384 | ) | |
7385 | ||
ac7c07ac DB |
7386 | (ne-float-binary-op nfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_26 |
7387 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7388 | "ne add single") |
ac7c07ac DB |
7389 | (ne-float-binary-op nfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_27 |
7390 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7391 | "ne sub single") |
ac7c07ac DB |
7392 | (ne-float-binary-op nfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_28 |
7393 | ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith))) | |
d0312406 | 7394 | "ne mul single") |
ac7c07ac DB |
7395 | (ne-float-binary-op nfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_79 OPE1_29 |
7396 | ((fr500 (unit u-float-div)) (fr550 (unit u-float-div))) | |
d0312406 | 7397 | "ne div single") |
9aab5aa3 AC |
7398 | |
7399 | (define-pmacro (fcc-eq) 8) | |
7400 | (define-pmacro (fcc-lt) 4) | |
7401 | (define-pmacro (fcc-gt) 2) | |
7402 | (define-pmacro (fcc-uo) 1) | |
7403 | ||
7404 | (define-pmacro (compare-and-set-fcc arg1 arg2 fcc) | |
7405 | (if (gt arg1 arg2) | |
7406 | (set fcc (fcc-gt)) | |
7407 | (if (eq arg1 arg2) | |
7408 | (set fcc (fcc-eq)) | |
7409 | (if (lt arg1 arg2) | |
7410 | (set fcc (fcc-lt)) | |
7411 | (set fcc (fcc-uo))))) | |
7412 | ) | |
7413 | ||
7414 | (dni fcmps | |
7415 | "compare single float" | |
ac7c07ac | 7416 | ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7417 | "fcmps$pack $FRi,$FRj,$FCCi_2" |
7418 | (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_0A FRj) | |
7419 | (compare-and-set-fcc FRi FRj FCCi_2) | |
ac7c07ac | 7420 | ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare))) |
9aab5aa3 AC |
7421 | ) |
7422 | ||
7423 | (dni fcmpd | |
7424 | "compare double float" | |
8caa9169 | 7425 | ((UNIT FMALL) (FR500-MAJOR F-2) (MACH frv)) |
9aab5aa3 AC |
7426 | "fcmpd$pack $FRdoublei,$FRdoublej,$FCCi_2" |
7427 | (+ pack (cond-null) FCCi_2 OP_7A FRdoublei OPE1_0A FRdoublej) | |
7428 | (compare-and-set-fcc FRdoublei FRdoublej FCCi_2) | |
7429 | ((fr500 (unit u-float-compare))) | |
7430 | ) | |
7431 | ||
7432 | (dni cfcmps | |
7433 | "Conditional compare single, float" | |
ac7c07ac | 7434 | ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7435 | "cfcmps$pack $FRi,$FRj,$FCCi_2,$CCi,$cond" |
7436 | (+ pack (cond-null) FCCi_2 OP_6D FRi CCi cond OPE4_2 FRj) | |
7437 | (if (eq CCi (or cond 2)) | |
7438 | (compare-and-set-fcc FRi FRj FCCi_2)) | |
ac7c07ac | 7439 | ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare))) |
9aab5aa3 AC |
7440 | ) |
7441 | ||
7442 | (dni fdcmps | |
7443 | "float dual compare single" | |
ac7c07ac | 7444 | ((UNIT FMALL) (FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7445 | "fdcmps$pack $FRi,$FRj,$FCCi_2" |
7446 | (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_1A FRj) | |
7447 | (sequence () | |
7448 | (compare-and-set-fcc FRi FRj FCCi_2) | |
7449 | (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1) | |
7450 | (nextreg h-fccr FCCi_2 1))) | |
ac7c07ac | 7451 | ((fr500 (unit u-float-dual-compare)) (fr550 (unit u-float-dual-compare))) |
9aab5aa3 AC |
7452 | ) |
7453 | ||
7454 | (define-pmacro (float-mul-with-add name add_sub arg1 arg2 targ op ope comment) | |
7455 | (dni name | |
7456 | (comment) | |
8caa9169 | 7457 | ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv)) |
9aab5aa3 AC |
7458 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) |
7459 | (+ pack targ op arg1 ope arg2) | |
7460 | (set targ (add_sub (mul arg1 arg2) targ)) | |
7461 | ((fr500 (unit u-float-dual-arith))) | |
7462 | ) | |
7463 | ) | |
7464 | ||
7465 | (float-mul-with-add fmadds add FRi FRj FRk OP_79 OPE1_0B "mul with add, single") | |
7466 | (float-mul-with-add fmsubs sub FRi FRj FRk OP_79 OPE1_0C "mul with sub, single") | |
7467 | ||
7468 | (float-mul-with-add fmaddd add FRdoublei FRdoublej FRdoublek OP_7A OPE1_0B "mul with add, double") | |
7469 | (float-mul-with-add fmsubd sub FRdoublei FRdoublej FRdoublek OP_7A OPE1_0C "mul with sub, double") | |
7470 | ||
7471 | (dni fdmadds | |
7472 | "Float dual multiply with add" | |
8caa9169 | 7473 | ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv)) |
9aab5aa3 AC |
7474 | "fdmadds$pack $FRi,$FRj,$FRk" |
7475 | (+ pack FRk OP_79 FRi OPE1_1B FRj) | |
7476 | (sequence () | |
7477 | (set FRk (add (mul FRi FRj) FRk)) | |
7478 | (set (nextreg h-fr FRk 1) | |
7479 | (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)) | |
7480 | (nextreg h-fr FRk 1)))) | |
7481 | ; TODO dual registers not referenced for profiling | |
7482 | ((fr500 (unit u-float-dual-arith))) | |
7483 | ) | |
7484 | ||
7485 | (dni nfdmadds | |
7486 | "Non excepting float dual multiply with add" | |
8caa9169 | 7487 | ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv)) |
9aab5aa3 AC |
7488 | "nfdmadds$pack $FRi,$FRj,$FRk" |
7489 | (+ pack FRk OP_79 FRi OPE1_3B FRj) | |
7490 | (sequence () | |
7491 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7492 | (set FRk (add (mul FRi FRj) FRk)) | |
7493 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7494 | (set (nextreg h-fr FRk 1) | |
7495 | (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)) | |
7496 | (nextreg h-fr FRk 1)))) | |
7497 | ; TODO dual registers not referenced for profiling | |
7498 | ((fr500 (unit u-float-dual-arith))) | |
7499 | ) | |
7500 | ||
7501 | (define-pmacro (conditional-float-mul-with-add | |
7502 | name add_sub arg1 arg2 targ op ope comment) | |
7503 | (dni name | |
7504 | (comment) | |
8caa9169 | 7505 | ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) CONDITIONAL) |
9aab5aa3 AC |
7506 | (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond") |
7507 | (+ pack FRk op FRi CCi cond ope FRj) | |
7508 | (if (eq CCi (or cond 2)) | |
7509 | (set targ (add_sub (mul arg1 arg2) targ))) | |
7510 | ((fr500 (unit u-float-dual-arith))) | |
7511 | ) | |
7512 | ) | |
7513 | ||
7514 | (conditional-float-mul-with-add cfmadds add FRi FRj FRk OP_6F OPE4_0 "conditional mul with add, single") | |
7515 | (conditional-float-mul-with-add cfmsubs sub FRi FRj FRk OP_6F OPE4_1 "conditional mul with sub, single") | |
7516 | ||
7517 | (define-pmacro (ne-float-mul-with-add name add_sub arg1 arg2 targ op ope comment) | |
7518 | (dni name | |
7519 | (comment) | |
8caa9169 | 7520 | ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) NON-EXCEPTING) |
9aab5aa3 AC |
7521 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) |
7522 | (+ pack targ op arg1 ope arg2) | |
7523 | (sequence () | |
7524 | (c-call VOID "@cpu@_set_ne_index" (index-of targ)) | |
7525 | (set targ (add_sub (mul arg1 arg2) targ))) | |
7526 | ((fr500 (unit u-float-dual-arith))) | |
7527 | ) | |
7528 | ) | |
7529 | ||
7530 | (ne-float-mul-with-add nfmadds add FRi FRj FRk OP_79 OPE1_2B "non excepting mul with add, single") | |
7531 | (ne-float-mul-with-add nfmsubs sub FRi FRj FRk OP_79 OPE1_2C "non excepting mul with sub, single") | |
7532 | ||
7533 | (define-pmacro (float-parallel-mul-add-semantics cond add_sub arg1 arg2 targ) | |
7534 | (if cond | |
7535 | (sequence () | |
7536 | (set targ (mul arg1 arg2)) | |
7537 | (set (nextreg h-fr targ 1) | |
7538 | (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1))))) | |
7539 | ) | |
7540 | ||
7541 | (define-pmacro (float-parallel-mul-add | |
7542 | name add_sub arg1 arg2 targ op ope comment) | |
7543 | (dni name | |
7544 | (comment) | |
ac7c07ac | 7545 | ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7546 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) |
7547 | (+ pack targ op arg1 ope arg2) | |
7548 | (float-parallel-mul-add-semantics 1 add_sub arg1 arg2 targ) | |
ac7c07ac | 7549 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7550 | ) |
7551 | ) | |
7552 | ||
7553 | (float-parallel-mul-add fmas add FRi FRj FRk OP_79 OPE1_0E "parallel mul/add, single") | |
7554 | (float-parallel-mul-add fmss sub FRi FRj FRk OP_79 OPE1_0F "parallel mul/sub, single") | |
7555 | ||
7556 | (define-pmacro (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ) | |
7557 | (sequence () | |
7558 | (set targ (mul arg1 arg2)) | |
7559 | (set (nextreg h-fr targ 1) | |
7560 | (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1))) | |
7561 | (set (nextreg h-fr targ 2) | |
7562 | (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2))) | |
7563 | (set (nextreg h-fr targ 3) | |
7564 | (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3)))) | |
7565 | ) | |
7566 | ||
7567 | (define-pmacro (float-dual-parallel-mul-add | |
7568 | name add_sub arg1 arg2 targ op ope comment) | |
7569 | (dni name | |
7570 | (comment) | |
7571 | ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv)) | |
7572 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) | |
7573 | (+ pack targ op arg1 ope arg2) | |
7574 | (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ) | |
7575 | () | |
7576 | ) | |
7577 | ) | |
7578 | ||
7579 | (float-dual-parallel-mul-add fdmas add FRi FRj FRk OP_79 OPE1_1C "dual parallel mul/add, single") | |
7580 | (float-dual-parallel-mul-add fdmss sub FRi FRj FRk OP_79 OPE1_1D "dual parallel mul/sub, single") | |
7581 | ||
7582 | (define-pmacro (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ) | |
7583 | (sequence () | |
7584 | (c-call VOID "@cpu@_set_ne_index" (index-of targ)) | |
7585 | (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1)) | |
7586 | (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 2)) | |
7587 | (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 3)) | |
7588 | (set targ (mul arg1 arg2)) | |
7589 | (set (nextreg h-fr targ 1) | |
7590 | (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1))) | |
7591 | (set (nextreg h-fr targ 2) | |
7592 | (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2))) | |
7593 | (set (nextreg h-fr targ 3) | |
7594 | (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3)))) | |
7595 | ) | |
7596 | ||
7597 | (define-pmacro (ne-float-dual-parallel-mul-add | |
7598 | name add_sub arg1 arg2 targ op ope comment) | |
7599 | (dni name | |
7600 | (comment) | |
7601 | ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv)) | |
7602 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) | |
7603 | (+ pack targ op arg1 ope arg2) | |
7604 | (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ) | |
7605 | () | |
7606 | ) | |
7607 | ) | |
7608 | ||
7609 | (ne-float-dual-parallel-mul-add nfdmas add FRi FRj FRk OP_79 OPE1_3C "non excepting dual parallel mul/add, single") | |
7610 | (ne-float-dual-parallel-mul-add nfdmss sub FRi FRj FRk OP_79 OPE1_3D "non excepting dual parallel mul/sub, single") | |
7611 | ||
7612 | (define-pmacro (conditional-float-parallel-mul-add name add_sub op ope comment) | |
7613 | (dni name | |
7614 | (comment) | |
ac7c07ac | 7615 | ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) CONDITIONAL (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7616 | (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond") |
7617 | (+ pack FRk op FRi CCi cond ope FRj) | |
7618 | (float-parallel-mul-add-semantics (eq CCi (or cond 2)) | |
7619 | add_sub FRi FRj FRk) | |
ac7c07ac | 7620 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7621 | ) |
7622 | ) | |
7623 | ||
7624 | (conditional-float-parallel-mul-add cfmas add OP_6F OPE4_2 "conditional parallel mul/add, single") | |
7625 | (conditional-float-parallel-mul-add cfmss sub OP_6F OPE4_3 "conditional parallel mul/sub, single") | |
7626 | ||
7627 | (define-pmacro (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ) | |
7628 | (sequence () | |
7629 | (set targ (ftrunc SF (mul DF (fext DF arg1) (fext DF arg2)))) | |
7630 | (set (nextreg h-fr targ 1) | |
7631 | (ftrunc SF (add_sub DF | |
7632 | (fext DF (nextreg h-fr arg1 1)) | |
7633 | (fext DF (nextreg h-fr arg2 1)))))) | |
7634 | ) | |
7635 | ||
7636 | (define-pmacro (float-parallel-mul-add-double | |
7637 | name add_sub arg1 arg2 targ op ope comment) | |
7638 | (dni name | |
7639 | (comment) | |
7640 | ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv)) | |
7641 | (.str name "$pack $" arg1 ",$" arg2 ",$" targ) | |
7642 | (+ pack targ op arg1 ope arg2) | |
7643 | (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ) | |
7644 | () | |
7645 | ) | |
7646 | ) | |
7647 | ||
7648 | (float-parallel-mul-add-double fmad add FRi FRj FRk OP_7A OPE1_0E "parallel mul/add, double") | |
7649 | (float-parallel-mul-add-double fmsd sub FRi FRj FRk OP_7A OPE1_0F "parallel mul/sub, double") | |
7650 | ||
7651 | (define-pmacro (ne-float-parallel-mul-add name add_sub op ope comment) | |
7652 | (dni name | |
7653 | (comment) | |
ac7c07ac | 7654 | ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7655 | (.str name "$pack $FRi,$FRj,$FRk") |
7656 | (+ pack FRk op FRi ope FRj) | |
7657 | (sequence () | |
7658 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7659 | (set FRk (mul FRi FRj)) | |
7660 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7661 | (set (nextreg h-fr FRk 1) | |
7662 | (add_sub (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)))) | |
ac7c07ac | 7663 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7664 | ) |
7665 | ) | |
7666 | ||
7667 | (ne-float-parallel-mul-add nfmas add OP_79 OPE1_2E "ne parallel mul/add,single") | |
7668 | (ne-float-parallel-mul-add nfmss sub OP_79 OPE1_2F "ne parallel mul/sub,single") | |
7669 | ||
0457efce | 7670 | (define-pmacro (float-dual-arith name attr oper1 oper2 op ope comment) |
9aab5aa3 AC |
7671 | (dni name |
7672 | (comment) | |
0457efce | 7673 | (.splice (UNIT FM01) (.unsplice attr)) |
9aab5aa3 AC |
7674 | (.str name "$pack $FRi,$FRj,$FRk") |
7675 | (+ pack FRk op FRi ope FRj) | |
7676 | (sequence () | |
7677 | (set FRk (oper1 FRi FRj)) | |
7678 | (set (nextreg h-fr FRk 1) | |
7679 | (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)))) | |
ac7c07ac | 7680 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7681 | ) |
7682 | ) | |
7683 | ||
ac7c07ac DB |
7684 | (float-dual-arith fdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_16 "dual add, single") |
7685 | (float-dual-arith fdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_17 "dual sub, single") | |
7686 | (float-dual-arith fdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_18 "dual mul, single") | |
7687 | (float-dual-arith fddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_19 "dual div,single") | |
7688 | (float-dual-arith fdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_1E "dual add/sub, single") | |
9aab5aa3 AC |
7689 | |
7690 | (dni fdmulcs | |
7691 | "Float dual cross multiply single" | |
ac7c07ac | 7692 | ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7693 | "fdmulcs$pack $FRi,$FRj,$FRk" |
7694 | (+ pack FRk OP_79 FRi OPE1_1F FRj) | |
7695 | (sequence () | |
7696 | (set FRk (mul FRi (nextreg h-fr FRj 1))) | |
7697 | (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj))) | |
ac7c07ac | 7698 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7699 | ) |
7700 | ||
7701 | (dni nfdmulcs | |
7702 | "NE float dual cross multiply single" | |
ac7c07ac | 7703 | ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
7704 | "nfdmulcs$pack $FRi,$FRj,$FRk" |
7705 | (+ pack FRk OP_79 FRi OPE1_3F FRj) | |
7706 | (sequence () | |
7707 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7708 | (set FRk (mul FRi (nextreg h-fr FRj 1))) | |
7709 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7710 | (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj))) | |
ac7c07ac | 7711 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7712 | ) |
7713 | ||
0457efce | 7714 | (define-pmacro (ne-float-dual-arith name attr oper1 oper2 op ope comment) |
9aab5aa3 AC |
7715 | (dni name |
7716 | (comment) | |
0457efce | 7717 | (.splice (UNIT FM01) (.unsplice attr)) |
9aab5aa3 AC |
7718 | (.str name "$pack $FRi,$FRj,$FRk") |
7719 | (+ pack FRk op FRi ope FRj) | |
7720 | (sequence () | |
7721 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7722 | (set FRk (oper1 FRi FRj)) | |
7723 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7724 | (set (nextreg h-fr FRk 1) | |
7725 | (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)))) | |
ac7c07ac | 7726 | ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith))) |
9aab5aa3 AC |
7727 | ) |
7728 | ) | |
7729 | ||
ac7c07ac DB |
7730 | (ne-float-dual-arith nfdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_36 "ne dual add, single") |
7731 | (ne-float-dual-arith nfdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_37 "ne dual sub, single") | |
7732 | (ne-float-dual-arith nfdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_38 "ne dual mul, single") | |
7733 | (ne-float-dual-arith nfddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_39 "ne dual div,single") | |
7734 | (ne-float-dual-arith nfdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_3E "ne dual add/sub, single") | |
9aab5aa3 AC |
7735 | |
7736 | (dni nfdcmps | |
7737 | "non-excepting dual float compare" | |
7738 | ((UNIT FM01) (FR500-MAJOR F-6) (MACH simple,tomcat,frv)) | |
7739 | "nfdcmps$pack $FRi,$FRj,$FCCi_2" | |
7740 | (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_3A FRj) | |
7741 | (sequence () | |
7742 | (c-call VOID "@cpu@_set_ne_index" (index-of FRk)) | |
7743 | (compare-and-set-fcc FRi FRj FCCi_2) | |
7744 | (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1)) | |
7745 | (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1) | |
7746 | (nextreg h-fccr FCCi_2 1))) | |
7747 | ((fr500 (unit u-float-dual-compare))) | |
7748 | ) | |
7749 | ||
7750 | ; Media Instructions | |
7751 | ; | |
7752 | (define-pmacro (halfword hilo arg offset) | |
7753 | (reg (.sym h-fr_ hilo) (add (index-of arg) offset))) | |
7754 | ||
7755 | (dni mhsetlos | |
7756 | "Media set lower signed 12 bits" | |
676a64f4 RS |
7757 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5) |
7758 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7759 | "mhsetlos$pack $u12,$FRklo" |
7760 | (+ pack FRklo OP_78 OPE1_20 u12) | |
7761 | (set FRklo u12) | |
676a64f4 RS |
7762 | ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo)) |
7763 | (fr550 (unit u-media-set (out FRintk FRklo)))) | |
9aab5aa3 AC |
7764 | ) |
7765 | ||
7766 | (dni mhsethis | |
7767 | "Media set upper signed 12 bits" | |
676a64f4 RS |
7768 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5) |
7769 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7770 | "mhsethis$pack $u12,$FRkhi" |
7771 | (+ pack FRkhi OP_78 OPE1_22 u12) | |
7772 | (set FRkhi u12) | |
676a64f4 RS |
7773 | ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo)) |
7774 | (fr550 (unit u-media-set (out FRintk FRkhi)))) | |
9aab5aa3 AC |
7775 | ) |
7776 | ||
7777 | (dni mhdsets | |
7778 | "Media dual set halfword signed 12 bits" | |
676a64f4 RS |
7779 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5) |
7780 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7781 | "mhdsets$pack $u12,$FRintk" |
7782 | (+ pack FRintk OP_78 OPE1_24 u12) | |
7783 | (sequence () | |
7784 | ; hack to get FRintk passed to modelling functions | |
7785 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
7786 | (set (halfword hi FRintk 0) u12) | |
7787 | (set (halfword lo FRintk 0) u12)) | |
676a64f4 RS |
7788 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
7789 | (fr550 (unit u-media-set))) | |
9aab5aa3 AC |
7790 | ) |
7791 | ||
7792 | (define-pmacro (set-5-semantics target value) | |
7793 | (sequence ((HI tmp)) | |
7794 | (set tmp target) | |
7795 | (set tmp (and tmp #x07ff)) | |
7796 | (set tmp (or tmp (sll (and s5 #x1f) 11))) | |
7797 | (set target tmp)) | |
7798 | ) | |
7799 | ||
7800 | (define-pmacro (media-set-5 name hilo op ope comment) | |
7801 | (dni name | |
7802 | (comment) | |
676a64f4 RS |
7803 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5) |
7804 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7805 | (.str name "$pack $s5,$FRk" hilo) |
7806 | (+ pack (.sym FRk hilo) op (FRi-null) ope (misc-null-11) s5) | |
7807 | (set-5-semantics (.sym FRk hilo) s5) | |
676a64f4 RS |
7808 | ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo)) |
7809 | (fr550 (unit u-media-set (out FRintk (.sym FRk hilo))))) | |
9aab5aa3 AC |
7810 | ) |
7811 | ) | |
7812 | ||
7813 | (media-set-5 mhsetloh lo OP_78 OPE1_21 "Media set upper 5 bits lo") | |
7814 | (media-set-5 mhsethih hi OP_78 OPE1_23 "Media set upper 5 bits hi") | |
7815 | ||
7816 | (dni mhdseth | |
7817 | "Media dual set halfword upper 5 bits" | |
676a64f4 RS |
7818 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5) |
7819 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7820 | "mhdseth$pack $s5,$FRintk" |
7821 | (+ pack FRintk OP_78 (FRi-null) OPE1_25 (misc-null-11) s5) | |
7822 | (sequence () | |
7823 | ; hack to get FRintk passed to modelling functions | |
7824 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
7825 | (set-5-semantics (halfword hi FRintk 0) s5) | |
7826 | (set-5-semantics (halfword lo FRintk 0) s5)) | |
676a64f4 RS |
7827 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
7828 | (fr550 (unit u-media-set))) | |
9aab5aa3 AC |
7829 | ) |
7830 | ||
7831 | (define-pmacro (media-logic-r-r name operation op ope comment) | |
7832 | (dni name | |
7833 | (comment) | |
676a64f4 RS |
7834 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
7835 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7836 | (.str name "$pack $FRinti,$FRintj,$FRintk") |
7837 | (+ pack FRintk op FRinti ope FRintj) | |
7838 | (set FRintk (operation FRinti FRintj)) | |
676a64f4 | 7839 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 7840 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7841 | ) |
7842 | ) | |
7843 | ||
7844 | (media-logic-r-r mand and OP_7B OPE1_00 "and reg/reg") | |
7845 | (media-logic-r-r mor or OP_7B OPE1_01 "or reg/reg") | |
7846 | (media-logic-r-r mxor xor OP_7B OPE1_02 "xor reg/reg") | |
7847 | ||
7848 | (define-pmacro (conditional-media-logic name operation op ope comment) | |
7849 | (dni name | |
7850 | (comment) | |
676a64f4 RS |
7851 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
7852 | (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL) | |
9aab5aa3 AC |
7853 | (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond") |
7854 | (+ pack FRintk op FRinti CCi cond ope FRintj) | |
7855 | (if (eq CCi (or cond 2)) | |
7856 | (set FRintk (operation FRinti FRintj))) | |
676a64f4 | 7857 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 7858 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7859 | ) |
7860 | ) | |
7861 | ||
7862 | (conditional-media-logic cmand and OP_70 OPE4_0 "conditional and reg/reg") | |
7863 | (conditional-media-logic cmor or OP_70 OPE4_1 "conditional or reg/reg") | |
7864 | (conditional-media-logic cmxor xor OP_70 OPE4_2 "conditional xor reg/reg") | |
7865 | ||
7866 | (dni mnot | |
7867 | ("mnot") | |
676a64f4 RS |
7868 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
7869 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7870 | ("mnot$pack $FRintj,$FRintk") |
7871 | (+ pack FRintk OP_7B (rs-null) OPE1_03 FRintj) | |
7872 | (set FRintk (inv FRintj)) | |
676a64f4 | 7873 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 7874 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7875 | ) |
7876 | ||
7877 | (dni cmnot | |
7878 | ("cmnot") | |
676a64f4 RS |
7879 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
7880 | (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL) | |
9aab5aa3 AC |
7881 | ("cmnot$pack $FRintj,$FRintk,$CCi,$cond") |
7882 | (+ pack FRintk OP_70 (rs-null) CCi cond OPE4_3 FRintj) | |
7883 | (if (eq CCi (or cond 2)) | |
7884 | (set FRintk (inv FRintj))) | |
676a64f4 | 7885 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 7886 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7887 | ) |
7888 | ||
7889 | (define-pmacro (media-rotate-r-r name operation op ope comment) | |
7890 | (dni name | |
7891 | (comment) | |
676a64f4 RS |
7892 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
7893 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7894 | (.str name "$pack $FRinti,$u6,$FRintk") |
7895 | (+ pack FRintk op FRinti ope u6) | |
7896 | (set FRintk (operation FRinti (and u6 #x1f))) | |
676a64f4 | 7897 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
ac7c07ac | 7898 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7899 | ) |
7900 | ) | |
7901 | ||
7902 | (media-rotate-r-r mrotli rol OP_7B OPE1_04 "rotate left reg/reg") | |
7903 | (media-rotate-r-r mrotri ror OP_7B OPE1_05 "rotate right reg/reg") | |
7904 | ||
7905 | (define-pmacro (media-cut-r-r name arg op ope comment) | |
7906 | (dni name | |
7907 | (comment) | |
676a64f4 RS |
7908 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
7909 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
9aab5aa3 AC |
7910 | (.str name "$pack $FRinti,$" arg ",$FRintk") |
7911 | (+ pack FRintk op FRinti ope arg) | |
7912 | (set FRintk (c-call SI "@cpu@_cut" FRinti (nextreg h-fr_int FRinti 1) arg)) | |
676a64f4 | 7913 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
ac7c07ac | 7914 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
7915 | ) |
7916 | ) | |
7917 | ||
7918 | (media-cut-r-r mwcut FRintj OP_7B OPE1_06 "media cut") | |
7919 | (media-cut-r-r mwcuti u6 OP_7B OPE1_07 "media cut") | |
7920 | ||
676a64f4 | 7921 | (define-pmacro (media-cut-acc name arg op ope fr450-major comment) |
9aab5aa3 AC |
7922 | (dni name |
7923 | (comment) | |
676a64f4 RS |
7924 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
7925 | (FR400-MAJOR M-1) (FR450-MAJOR fr450-major)) | |
9aab5aa3 AC |
7926 | (.str name "$pack $ACC40Si,$" arg ",$FRintk") |
7927 | (+ pack FRintk op ACC40Si ope arg) | |
7928 | (set FRintk (c-call SI "@cpu@_media_cut" ACC40Si arg)) | |
676a64f4 | 7929 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4)) |
ac7c07ac | 7930 | (fr500 (unit u-media)) (fr550 (unit u-media-3-acc))) |
9aab5aa3 AC |
7931 | ) |
7932 | ) | |
7933 | ||
676a64f4 RS |
7934 | (media-cut-acc mcut FRintj OP_7B OPE1_2C M-1 "media accumulator cut reg") |
7935 | (media-cut-acc mcuti s6 OP_7B OPE1_2E M-5 "media accumulator cut immed") | |
9aab5aa3 | 7936 | |
676a64f4 | 7937 | (define-pmacro (media-cut-acc-ss name arg op ope fr450-major comment) |
9aab5aa3 AC |
7938 | (dni name |
7939 | (comment) | |
676a64f4 RS |
7940 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
7941 | (FR400-MAJOR M-1) (FR450-MAJOR fr450-major)) | |
9aab5aa3 AC |
7942 | (.str name "$pack $ACC40Si,$" arg ",$FRintk") |
7943 | (+ pack FRintk op ACC40Si ope arg) | |
7944 | (set FRintk (c-call SI "@cpu@_media_cut_ss" ACC40Si arg)) | |
676a64f4 | 7945 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4)) |
ac7c07ac | 7946 | (fr500 (unit u-media)) (fr550 (unit u-media-3-acc))) |
9aab5aa3 AC |
7947 | ) |
7948 | ) | |
7949 | ||
676a64f4 RS |
7950 | (media-cut-acc-ss mcutss FRintj OP_7B OPE1_2D M-1 "media accumulator cut reg with saturation") |
7951 | (media-cut-acc-ss mcutssi s6 OP_7B OPE1_2F M-5 "media accumulator cut immed with saturation") | |
9aab5aa3 AC |
7952 | |
7953 | ; Dual Media Instructions | |
7954 | ; | |
7955 | (define-pmacro (register-unaligned register alignment) | |
7956 | (and (index-of register) (sub alignment 1)) | |
7957 | ) | |
7958 | ||
7959 | (dni mdcutssi | |
7960 | "Media dual cut with signed saturation" | |
676a64f4 RS |
7961 | ((UNIT MDCUTSSI) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3) |
7962 | (FR400-MAJOR M-2) (FR450-MAJOR M-6)) | |
36c3ae24 NC |
7963 | "mdcutssi$pack $ACC40Si,$s6,$FRintkeven" |
7964 | (+ pack FRintkeven OP_78 ACC40Si OPE1_0E s6) | |
9aab5aa3 AC |
7965 | (if (register-unaligned ACC40Si 2) |
7966 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
36c3ae24 | 7967 | (if (register-unaligned FRintkeven 2) |
9aab5aa3 AC |
7968 | (c-call VOID "@cpu@_media_register_not_aligned") |
7969 | (sequence () | |
36c3ae24 NC |
7970 | (set FRintkeven (c-call SI "@cpu@_media_cut_ss" ACC40Si s6)) |
7971 | (set (nextreg h-fr_int FRintkeven 1) | |
9aab5aa3 AC |
7972 | (c-call SI "@cpu@_media_cut_ss" |
7973 | (nextreg h-acc40S ACC40Si 1) s6))))) | |
36c3ae24 | 7974 | ((fr400 (unit u-media-4-acc-dual |
676a64f4 RS |
7975 | (out FRintk FRintkeven))) |
7976 | (fr450 (unit u-media-4-acc-dual | |
7977 | (out FRintk FRintkeven))) | |
7978 | (fr550 (unit u-media-3-acc-dual))) | |
9aab5aa3 AC |
7979 | ) |
7980 | ||
7981 | ; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated | |
7982 | ; so it will be passed to the unit modelers. YUCK!!!!! | |
7983 | (define-pmacro (extract-hilo reg1 off1 reg2 off2 arg1hi arg1lo arg2hi arg2lo) | |
7984 | (sequence () | |
7985 | (set arg1hi (add (halfword hi reg1 off1) (mul reg1 0))) | |
7986 | (set arg1lo (add (halfword lo reg1 off1) (mul reg1 0))) | |
7987 | (set arg2hi (add (halfword hi reg2 off2) (mul reg2 0))) | |
7988 | (set arg2lo (add (halfword lo reg2 off2) (mul reg2 0)))) | |
7989 | ) | |
7990 | ||
7991 | (dni maveh | |
7992 | "Media dual average" | |
676a64f4 RS |
7993 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
7994 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
7995 | "maveh$pack $FRinti,$FRintj,$FRintk" |
7996 | (+ pack FRintk OP_7B FRinti OPE1_08 FRintj) | |
7997 | (set FRintk (c-call SI "@cpu@_media_average" FRinti FRintj)) | |
676a64f4 | 7998 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 7999 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8000 | ) |
8001 | ||
8002 | (define-pmacro (media-dual-shift name operation op ope profile comment) | |
8003 | (dni name | |
8004 | (comment) | |
676a64f4 RS |
8005 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
8006 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8007 | (.str name "$pack $FRinti,$u6,$FRintk") |
8008 | (+ pack FRintk op FRinti ope u6) | |
8009 | (sequence () | |
8010 | ; hack to get these referenced for profiling | |
8011 | (set FRinti (c-raw-call SI "frv_ref_SI" FRinti)) | |
8012 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
8013 | (set (halfword hi FRintk 0) | |
8014 | (operation (halfword hi FRinti 0) (and u6 #xf))) | |
8015 | (set (halfword lo FRintk 0) | |
8016 | (operation (halfword lo FRinti 0) (and u6 #xf)))) | |
8017 | profile | |
8018 | ) | |
8019 | ) | |
8020 | ||
8021 | (media-dual-shift msllhi sll OP_7B OPE1_09 | |
676a64f4 RS |
8022 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
8023 | (fr500 (unit u-media)) (fr550 (unit u-media))) | |
9aab5aa3 AC |
8024 | "Media dual shift left logical") |
8025 | (media-dual-shift msrlhi srl OP_7B OPE1_0A | |
676a64f4 RS |
8026 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
8027 | (fr500 (unit u-media)) (fr550 (unit u-media))) | |
9aab5aa3 AC |
8028 | "Media dual shift right logical") |
8029 | (media-dual-shift msrahi sra OP_7B OPE1_0B | |
676a64f4 RS |
8030 | ((fr400 (unit u-media-6)) (fr450 (unit u-media-6)) |
8031 | (fr500 (unit u-media)) (fr550 (unit u-media))) | |
9aab5aa3 AC |
8032 | "Media dual shift right arithmetic") |
8033 | ||
8034 | (define-pmacro (media-dual-word-rotate-r-r name operation op ope comment) | |
8035 | (dni name | |
8036 | (comment) | |
676a64f4 RS |
8037 | ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3) |
8038 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
8039 | (.str name "$pack $FRintieven,$s6,$FRintkeven") |
8040 | (+ pack FRintkeven op FRintieven ope s6) | |
8041 | (if (orif (register-unaligned FRintieven 2) | |
8042 | (register-unaligned FRintkeven 2)) | |
9aab5aa3 AC |
8043 | (c-call VOID "@cpu@_media_register_not_aligned") |
8044 | (sequence () | |
36c3ae24 NC |
8045 | (set FRintkeven (operation FRintieven (and s6 #x1f))) |
8046 | (set (nextreg h-fr_int FRintkeven 1) | |
8047 | (operation (nextreg h-fr_int FRintieven 1) | |
75798298 | 8048 | (and s6 #x1f))))) |
36c3ae24 NC |
8049 | ((fr400 (unit u-media-3-quad |
8050 | (in FRinti FRintieven) | |
676a64f4 RS |
8051 | (out FRintk FRintkeven))) |
8052 | (fr450 (unit u-media-3-quad | |
8053 | (in FRinti FRintieven) | |
8054 | (out FRintk FRintkeven))) | |
8055 | (fr550 (unit u-media-quad))) | |
9aab5aa3 AC |
8056 | ) |
8057 | ) | |
8058 | ||
8059 | (media-dual-word-rotate-r-r mdrotli rol OP_78 OPE1_0B "rotate left reg/reg") | |
8060 | ||
8061 | (dni mcplhi | |
ac7c07ac | 8062 | "Media bit concatenate, halfword" |
676a64f4 RS |
8063 | ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3) |
8064 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
9aab5aa3 AC |
8065 | "mcplhi$pack $FRinti,$u6,$FRintk" |
8066 | (+ pack FRintk OP_78 FRinti OPE1_0C u6) | |
8067 | (sequence ((HI arg1) (HI arg2) (HI shift)) | |
8068 | (set FRinti (c-raw-call SI "frv_ref_SI" FRinti)) | |
8069 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
8070 | (set shift (and u6 #xf)) | |
8071 | (set arg1 (sll (halfword hi FRinti 0) shift)) | |
8072 | (if (ne shift 0) | |
8073 | (sequence () | |
8074 | (set arg2 (halfword hi FRinti 1)) | |
8075 | (set arg2 (srl HI (sll HI arg2 (sub 15 shift)) | |
8076 | (sub 15 shift))) | |
8077 | (set arg1 (or HI arg1 arg2)))) | |
8078 | (set (halfword hi FRintk 0) arg1)) | |
676a64f4 RS |
8079 | ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual)) |
8080 | (fr550 (unit u-media-3-dual))) | |
9aab5aa3 AC |
8081 | ) |
8082 | ||
8083 | (dni mcpli | |
ac7c07ac | 8084 | "Media bit concatenate, word" |
676a64f4 RS |
8085 | ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3) |
8086 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
9aab5aa3 AC |
8087 | "mcpli$pack $FRinti,$u6,$FRintk" |
8088 | (+ pack FRintk OP_78 FRinti OPE1_0D u6) | |
8089 | (sequence ((SI tmp) (SI shift)) | |
8090 | (set shift (and u6 #x1f)) | |
8091 | (set tmp (sll FRinti shift)) | |
8092 | (if (ne shift 0) | |
8093 | (sequence ((SI tmp1)) | |
8094 | (set tmp1 (srl (sll (nextreg h-fr_int FRinti 1) | |
8095 | (sub 31 shift)) | |
8096 | (sub 31 shift))) | |
8097 | (set tmp (or tmp tmp1)))) | |
8098 | (set FRintk tmp)) | |
676a64f4 RS |
8099 | ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual)) |
8100 | (fr550 (unit u-media-3-dual))) | |
9aab5aa3 AC |
8101 | ) |
8102 | ||
8103 | (define-pmacro (saturate arg max min result) | |
8104 | (if (gt arg max) | |
8105 | (set result max) | |
8106 | (if (lt arg min) | |
8107 | (set result min) | |
8108 | (set result arg))) | |
8109 | ) | |
8110 | ||
8111 | (dni msaths | |
8112 | "Media dual saturation signed" | |
676a64f4 RS |
8113 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8114 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8115 | "msaths$pack $FRinti,$FRintj,$FRintk" |
8116 | (+ pack FRintk OP_7B FRinti OPE1_0C FRintj) | |
8117 | (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo)) | |
8118 | (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo) | |
8119 | (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 0)) | |
8120 | (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 0))) | |
676a64f4 | 8121 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 8122 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8123 | ) |
8124 | ||
8125 | (dni mqsaths | |
8126 | "Media quad saturation signed" | |
676a64f4 RS |
8127 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2) |
8128 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
8129 | "mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven" |
8130 | (+ pack FRintkeven OP_78 FRintieven OPE1_0F FRintjeven) | |
8131 | (if (orif (register-unaligned FRintieven 2) | |
8132 | (orif (register-unaligned FRintjeven 2) | |
8133 | (register-unaligned FRintkeven 2))) | |
9aab5aa3 AC |
8134 | (c-call VOID "@cpu@_media_register_not_aligned") |
8135 | (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo)) | |
36c3ae24 NC |
8136 | ; hack to get FRintkeven referenced as a target for profiling |
8137 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
8138 | (extract-hilo FRintieven 0 FRintjeven 0 argihi argilo argjhi argjlo) | |
8139 | (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 0)) | |
8140 | (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 0)) | |
8141 | (extract-hilo FRintieven 1 FRintjeven 1 argihi argilo argjhi argjlo) | |
8142 | (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 1)) | |
8143 | (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 1)))) | |
8144 | ((fr400 (unit u-media-1-quad | |
8145 | (in FRinti FRintieven) | |
8146 | (in FRintj FRintjeven) | |
676a64f4 RS |
8147 | (out FRintk FRintkeven))) |
8148 | (fr450 (unit u-media-1-quad | |
8149 | (in FRinti FRintieven) | |
8150 | (in FRintj FRintjeven) | |
8151 | (out FRintk FRintkeven))) | |
8152 | (fr550 (unit u-media-quad))) | |
9aab5aa3 AC |
8153 | ) |
8154 | ||
8155 | (define-pmacro (saturate-unsigned arg max result) | |
8156 | (if (gt arg max) | |
8157 | (set result max) | |
8158 | (set result arg)) | |
8159 | ) | |
8160 | ||
8161 | (dni msathu | |
8162 | "Media dual saturation unsigned" | |
676a64f4 RS |
8163 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8164 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8165 | "msathu$pack $FRinti,$FRintj,$FRintk" |
8166 | (+ pack FRintk OP_7B FRinti OPE1_0D FRintj) | |
8167 | (sequence ((UHI argihi) (UHI argilo) (UHI argjhi) (UHI argjlo)) | |
8168 | (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo) | |
8169 | (saturate-unsigned argihi argjhi (halfword hi FRintk 0)) | |
8170 | (saturate-unsigned argilo argjlo (halfword lo FRintk 0))) | |
676a64f4 | 8171 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 8172 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8173 | ) |
8174 | ||
8175 | (define-pmacro (media-dual-compare name mode op ope comment) | |
8176 | (dni name | |
8177 | (comment) | |
676a64f4 RS |
8178 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8179 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8180 | (.str name "$pack $FRinti,$FRintj,$FCCk") |
8181 | (+ pack (cond-null) FCCk op FRinti ope FRintj) | |
8182 | (if (register-unaligned FCCk 2) | |
8183 | (c-call VOID "@cpu@_media_cr_not_aligned") | |
8184 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
8185 | (extract-hilo FRinti 0 FRintj 0 | |
8186 | argihi argilo argjhi argjlo) | |
8187 | (compare-and-set-fcc argihi argjhi FCCk) | |
8188 | (compare-and-set-fcc argilo argjlo (nextreg h-fccr FCCk 1)))) | |
8189 | ; TODO - doesn't handle second FCC | |
676a64f4 | 8190 | ((fr400 (unit u-media-7)) (fr450 (unit u-media-7)) |
ac7c07ac | 8191 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8192 | ) |
8193 | ) | |
8194 | ||
8195 | (media-dual-compare mcmpsh HI OP_7B OPE1_0E "Media dual compare signed") | |
8196 | (media-dual-compare mcmpuh UHI OP_7B OPE1_0F "Media dual compare unsigned") | |
8197 | ||
8198 | ; Bits for the MSR.SIE field | |
8199 | (define-pmacro (msr-sie-nil) 0) | |
8200 | (define-pmacro (msr-sie-fri-hi) 8) | |
8201 | (define-pmacro (msr-sie-fri-lo) 4) | |
8202 | (define-pmacro (msr-sie-fri-1-hi) 2) | |
8203 | (define-pmacro (msr-sie-fri-1-lo) 1) | |
8204 | (define-pmacro (msr-sie-acci) 8) | |
8205 | (define-pmacro (msr-sie-acci-1) 4) | |
8206 | (define-pmacro (msr-sie-acci-2) 2) | |
8207 | (define-pmacro (msr-sie-acci-3) 1) | |
8208 | ||
8209 | (define-pmacro (saturate-v arg max min sie result) | |
8210 | (if (gt DI arg max) | |
8211 | (sequence () | |
8212 | (set result max) | |
8213 | (c-call VOID "@cpu@_media_overflow" sie)) | |
8214 | (if (lt DI arg min) | |
8215 | (sequence () | |
8216 | (set result min) | |
8217 | (c-call VOID "@cpu@_media_overflow" sie)) | |
8218 | (set result arg))) | |
8219 | ) | |
8220 | ||
8221 | (dni mabshs | |
8222 | "Media dual absolute value, halfword" | |
676a64f4 RS |
8223 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2) |
8224 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8225 | "mabshs$pack $FRintj,$FRintk" |
8226 | (+ pack FRintk OP_78 (FRi-null) OPE1_0A FRintj) | |
8227 | (sequence ((HI arghi) (HI arglo)) | |
8228 | (set FRintj (c-raw-call SI "frv_ref_SI" FRintj)) | |
8229 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
8230 | (set arghi (halfword hi FRintj 0)) | |
8231 | (set arglo (halfword lo FRintj 0)) | |
6347aad8 HPN |
8232 | ; We extend the argument before the abs operation so we can |
8233 | ; notice -32768 overflowing as 32768. | |
8234 | (saturate-v (abs (ext DI arghi)) 32767 -32768 (msr-sie-fri-hi) | |
9aab5aa3 | 8235 | (halfword hi FRintk 0)) |
6347aad8 | 8236 | (saturate-v (abs (ext DI arglo)) 32767 -32768 (msr-sie-fri-lo) |
9aab5aa3 | 8237 | (halfword lo FRintk 0))) |
676a64f4 RS |
8238 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
8239 | (fr550 (unit u-media))) | |
9aab5aa3 AC |
8240 | ) |
8241 | ||
6347aad8 HPN |
8242 | ; How to extend from a mode to get the intended signedness. |
8243 | (define-pmacro (DI-ext-HI x) (ext DI x)) | |
8244 | (define-pmacro (DI-ext-UHI x) (zext DI x)) | |
8245 | (define-pmacro (DI-ext-DI x) x) | |
8246 | ||
9aab5aa3 AC |
8247 | (define-pmacro (media-arith-sat-semantics |
8248 | operation arg1 arg2 res mode max min sie) | |
8249 | (sequence ((DI tmp)) | |
6347aad8 HPN |
8250 | ; Make sure we saturate at max/min against a value that is |
8251 | ; sign- or zero-extended appropriately from "mode". | |
8252 | (set tmp (operation DI | |
8253 | ((.sym DI-ext- mode) arg1) ((.sym DI-ext- mode) arg2))) | |
9aab5aa3 AC |
8254 | (saturate-v tmp max min sie res)) |
8255 | ) | |
8256 | ||
8257 | (define-pmacro (media-dual-arith-sat-semantics operation mode max min) | |
8258 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
8259 | (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo) | |
8260 | (media-arith-sat-semantics operation argihi argjhi | |
8261 | (halfword hi FRintk 0) mode max min | |
8262 | (msr-sie-fri-hi)) | |
8263 | (media-arith-sat-semantics operation argilo argjlo | |
8264 | (halfword lo FRintk 0) mode max min | |
8265 | (msr-sie-fri-lo))) | |
8266 | ) | |
8267 | ||
8268 | (define-pmacro (media-dual-arith-sat name operation mode max min op ope comment) | |
8269 | (dni name | |
8270 | (comment) | |
676a64f4 RS |
8271 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8272 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
8273 | (.str name "$pack $FRinti,$FRintj,$FRintk") |
8274 | (+ pack FRintk op FRinti ope FRintj) | |
8275 | (media-dual-arith-sat-semantics operation mode max min) | |
676a64f4 | 8276 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 8277 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8278 | ) |
8279 | ) | |
8280 | ||
8281 | (media-dual-arith-sat maddhss add HI 32767 -32768 OP_7B OPE1_10 "Media dual add signed with saturation") | |
8282 | (media-dual-arith-sat maddhus add UHI 65535 0 OP_7B OPE1_11 "Media dual add unsigned with saturation") | |
8283 | ||
8284 | (media-dual-arith-sat msubhss sub HI 32767 -32768 OP_7B OPE1_12 "Media dual sub signed with saturation") | |
8285 | (media-dual-arith-sat msubhus sub UHI 65535 0 OP_7B OPE1_13 "Media dual sub unsigned with saturation") | |
8286 | ||
8287 | (define-pmacro (conditional-media-dual-arith-sat | |
8288 | name operation mode max min op ope comment) | |
8289 | (dni name | |
8290 | (comment) | |
676a64f4 RS |
8291 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8292 | (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL) | |
9aab5aa3 AC |
8293 | (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond") |
8294 | (+ pack FRintk op FRinti CCi cond ope FRintj) | |
8295 | (if (eq CCi (or cond 2)) | |
8296 | (media-dual-arith-sat-semantics operation mode max min)) | |
676a64f4 | 8297 | ((fr400 (unit u-media-1)) (fr450 (unit u-media-1)) |
ac7c07ac | 8298 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
8299 | ) |
8300 | ) | |
8301 | ||
8302 | (conditional-media-dual-arith-sat cmaddhss add HI 32767 -32768 OP_71 OPE4_0 "Conditional Media dual add signed with saturation") | |
8303 | (conditional-media-dual-arith-sat cmaddhus add UHI 65535 0 OP_71 OPE4_1 "Conditional Media dual add unsigned with saturation") | |
8304 | ||
8305 | (conditional-media-dual-arith-sat cmsubhss sub HI 32767 -32768 OP_71 OPE4_2 "Conditional Media dual sub signed with saturation") | |
8306 | (conditional-media-dual-arith-sat cmsubhus sub UHI 65535 0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation") | |
8307 | ||
8308 | (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min) | |
36c3ae24 NC |
8309 | (if (orif (register-unaligned FRintieven 2) |
8310 | (orif (register-unaligned FRintjeven 2) | |
8311 | (register-unaligned FRintkeven 2))) | |
9aab5aa3 AC |
8312 | (c-call VOID "@cpu@_media_register_not_aligned") |
8313 | (if cond | |
8314 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
36c3ae24 NC |
8315 | ; hack to get FRintkeven referenced as a target for profiling |
8316 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
8317 | (extract-hilo FRintieven 0 FRintjeven 0 | |
9aab5aa3 AC |
8318 | argihi argilo argjhi argjlo) |
8319 | (media-arith-sat-semantics operation argihi argjhi | |
36c3ae24 | 8320 | (halfword hi FRintkeven 0) mode |
9aab5aa3 AC |
8321 | max min (msr-sie-fri-hi)) |
8322 | (media-arith-sat-semantics operation argilo argjlo | |
36c3ae24 | 8323 | (halfword lo FRintkeven 0) mode |
9aab5aa3 | 8324 | max min (msr-sie-fri-lo)) |
36c3ae24 | 8325 | (extract-hilo FRintieven 1 FRintjeven 1 |
9aab5aa3 AC |
8326 | argihi argilo argjhi argjlo) |
8327 | (media-arith-sat-semantics operation argihi argjhi | |
36c3ae24 | 8328 | (halfword hi FRintkeven 1) mode |
9aab5aa3 AC |
8329 | max min (msr-sie-fri-1-hi)) |
8330 | (media-arith-sat-semantics operation argilo argjlo | |
36c3ae24 | 8331 | (halfword lo FRintkeven 1) mode |
9aab5aa3 AC |
8332 | max min (msr-sie-fri-1-lo))))) |
8333 | ) | |
8334 | ||
8335 | (define-pmacro (media-quad-arith-sat name operation mode max min op ope comment) | |
8336 | (dni name | |
8337 | (comment) | |
676a64f4 RS |
8338 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8339 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
8340 | (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven") |
8341 | (+ pack FRintkeven op FRintieven ope FRintjeven) | |
9aab5aa3 | 8342 | (media-quad-arith-sat-semantics 1 operation mode max min) |
36c3ae24 NC |
8343 | ((fr400 (unit u-media-1-quad |
8344 | (in FRinti FRintieven) | |
8345 | (in FRintj FRintjeven) | |
741a7751 | 8346 | (out FRintk FRintkeven))) |
676a64f4 RS |
8347 | (fr450 (unit u-media-1-quad |
8348 | (in FRinti FRintieven) | |
8349 | (in FRintj FRintjeven) | |
8350 | (out FRintk FRintkeven))) | |
36c3ae24 NC |
8351 | (fr500 (unit u-media-quad-arith |
8352 | (in FRinti FRintieven) | |
8353 | (in FRintj FRintjeven) | |
ac7c07ac | 8354 | (out FRintk FRintkeven))) (fr550 (unit u-media-quad))) |
9aab5aa3 AC |
8355 | ) |
8356 | ) | |
8357 | ||
8358 | (media-quad-arith-sat mqaddhss add HI 32767 -32768 OP_7B OPE1_18 "Media quad add signed with saturation") | |
8359 | (media-quad-arith-sat mqaddhus add UHI 65535 0 OP_7B OPE1_19 "Media quad add unsigned with saturation") | |
8360 | ||
8361 | (media-quad-arith-sat mqsubhss sub HI 32767 -32768 OP_7B OPE1_1A "Media quad sub signed with saturation") | |
8362 | (media-quad-arith-sat mqsubhus sub UHI 65535 0 OP_7B OPE1_1B "Media quad sub unsigned with saturation") | |
8363 | ||
8364 | (define-pmacro (conditional-media-quad-arith-sat | |
8365 | name operation mode max min op ope comment) | |
8366 | (dni name | |
8367 | (comment) | |
676a64f4 RS |
8368 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2) |
8369 | (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL) | |
36c3ae24 NC |
8370 | (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond") |
8371 | (+ pack FRintkeven op FRintieven CCi cond ope FRintjeven) | |
9aab5aa3 AC |
8372 | (media-quad-arith-sat-semantics (eq CCi (or cond 2)) |
8373 | operation mode max min) | |
36c3ae24 NC |
8374 | ((fr400 (unit u-media-1-quad |
8375 | (in FRinti FRintieven) | |
8376 | (in FRintj FRintjeven) | |
741a7751 | 8377 | (out FRintk FRintkeven))) |
676a64f4 RS |
8378 | (fr450 (unit u-media-1-quad |
8379 | (in FRinti FRintieven) | |
8380 | (in FRintj FRintjeven) | |
8381 | (out FRintk FRintkeven))) | |
36c3ae24 NC |
8382 | (fr500 (unit u-media-quad-arith |
8383 | (in FRinti FRintieven) | |
8384 | (in FRintj FRintjeven) | |
ac7c07ac | 8385 | (out FRintk FRintkeven))) (fr550 (unit u-media-quad))) |
9aab5aa3 AC |
8386 | ) |
8387 | ) | |
8388 | ||
8389 | (conditional-media-quad-arith-sat cmqaddhss add HI 32767 -32768 OP_73 OPE4_0 "Conditional Media quad add signed with saturation") | |
8390 | (conditional-media-quad-arith-sat cmqaddhus add UHI 65535 0 OP_73 OPE4_1 "Conditional Media quad add unsigned with saturation") | |
8391 | ||
8392 | (conditional-media-quad-arith-sat cmqsubhss sub HI 32767 -32768 OP_73 OPE4_2 "Conditional Media quad sub signed with saturation") | |
8393 | (conditional-media-quad-arith-sat cmqsubhus sub UHI 65535 0 OP_73 OPE4_3 "Conditional Media quad sub unsigned with saturation") | |
8394 | ||
676a64f4 RS |
8395 | ;; Return A if |A| > |B| and B is positive. Return -A if |A| > |B| and |
8396 | ;; B is negative, saturating 0x8000 as 0x7fff. Return 0 otherwise. | |
8397 | (define-pmacro (media-low-clear-semantics a b) | |
8398 | (cond HI | |
8399 | ((le UHI (abs a) (abs b)) 0) | |
8400 | ((le HI 0 b) a) | |
8401 | ((eq HI a -32768) 32767) | |
8402 | (else (neg a)))) | |
8403 | ||
8404 | ;; Return A if -|B| < A < |B|. Return -B if A <= -|B|, saturating 0x8000 | |
8405 | ;; as 0x7fff. Return B if A >= |B|. | |
8406 | (define-pmacro (media-scope-limit-semantics a b) | |
8407 | (cond HI | |
8408 | ((andif (gt HI b -32768) | |
8409 | (ge HI a (abs b))) b) | |
8410 | ((gt HI a (neg (abs b))) a) | |
8411 | ((eq HI b -32768) 32767) | |
8412 | (else (neg b)))) | |
8413 | ||
8414 | (define-pmacro (media-quad-limit name operation op ope comment) | |
8415 | (dni name | |
8416 | comment | |
8417 | ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2)) | |
8418 | (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven") | |
8419 | (+ pack FRintkeven op FRintieven ope FRintjeven) | |
8420 | (if (orif (register-unaligned FRintieven 2) | |
8421 | (orif (register-unaligned FRintjeven 2) | |
8422 | (register-unaligned FRintkeven 2))) | |
8423 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8424 | (sequence ((HI a1) (HI a2) (HI a3) (HI a4) | |
8425 | (HI b1) (HI b2) (HI b3) (HI b4)) | |
8426 | ; hack to get FRintkeven referenced as a target | |
8427 | ; for profiling | |
8428 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
8429 | (extract-hilo FRintieven 0 FRintjeven 0 a1 a2 b1 b2) | |
8430 | (extract-hilo FRintieven 1 FRintjeven 1 a3 a4 b3 b4) | |
8431 | (set (halfword hi FRintkeven 0) (operation a1 b1)) | |
8432 | (set (halfword lo FRintkeven 0) (operation a2 b2)) | |
8433 | (set (halfword hi FRintkeven 1) (operation a3 b3)) | |
8434 | (set (halfword lo FRintkeven 1) (operation a4 b4)))) | |
8435 | ((fr450 (unit u-media-1-quad | |
8436 | (in FRinti FRintieven) | |
8437 | (in FRintj FRintjeven) | |
8438 | (out FRintk FRintkeven)))) | |
8439 | ) | |
8440 | ) | |
8441 | ||
8442 | (media-quad-limit mqlclrhs media-low-clear-semantics OP_78 OPE1_10 | |
8443 | "Media quad low clear") | |
8444 | (media-quad-limit mqlmths media-scope-limit-semantics OP_78 OPE1_14 | |
8445 | "Media quad scope limitation") | |
8446 | ||
8447 | (define-pmacro (media-quad-shift name operation op ope comment) | |
8448 | (dni name | |
8449 | (comment) | |
8450 | ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2)) | |
8451 | (.str name "$pack $FRintieven,$u6,$FRintkeven") | |
8452 | (+ pack FRintkeven op FRintieven ope u6) | |
8453 | (if (orif (register-unaligned FRintieven 2) | |
8454 | (register-unaligned FRintkeven 2)) | |
8455 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8456 | (sequence () | |
8457 | ; hack to get these referenced for profiling | |
8458 | (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven)) | |
8459 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
8460 | (set (halfword hi FRintkeven 0) | |
8461 | (operation HI (halfword hi FRintieven 0) | |
8462 | (and u6 #xf))) | |
8463 | (set (halfword lo FRintkeven 0) | |
8464 | (operation HI (halfword lo FRintieven 0) | |
8465 | (and u6 #xf))) | |
8466 | (set (halfword hi FRintkeven 1) | |
8467 | (operation HI (halfword hi FRintieven 1) | |
8468 | (and u6 #xf))) | |
8469 | (set (halfword lo FRintkeven 1) | |
8470 | (operation HI (halfword lo FRintieven 1) | |
8471 | (and u6 #xf))))) | |
8472 | ((fr450 (unit u-media-3-quad | |
8473 | (in FRinti FRintieven) | |
8474 | (in FRintj FRintieven) | |
8475 | (out FRintk FRintkeven)))) | |
8476 | ) | |
8477 | ) | |
8478 | ||
8479 | (media-quad-shift mqsllhi sll OP_78 OPE1_11 "Media quad left shift") | |
8480 | (media-quad-shift mqsrahi sra OP_78 OPE1_13 "Media quad right shift") | |
8481 | ||
9aab5aa3 AC |
8482 | (define-pmacro (media-acc-arith-sat name operation mode max min op ope comment) |
8483 | (dni name | |
8484 | (comment) | |
676a64f4 RS |
8485 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
8486 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
8487 | (.str name "$pack $ACC40Si,$ACC40Sk") |
8488 | (+ pack ACC40Sk op ACC40Si ope (ACCj-null)) | |
ac7c07ac DB |
8489 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si)) |
8490 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) | |
8491 | (if (register-unaligned ACC40Si 2) | |
8492 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8493 | (media-arith-sat-semantics operation ACC40Si | |
8494 | (nextreg h-acc40S ACC40Si 1) | |
8495 | ACC40Sk mode max min (msr-sie-acci))))) | |
676a64f4 RS |
8496 | ((fr400 (unit u-media-2-acc)) (fr450 (unit u-media-2-acc)) |
8497 | (fr550 (unit u-media-4-acc))) | |
9aab5aa3 AC |
8498 | ) |
8499 | ) | |
8500 | ||
8501 | (media-acc-arith-sat maddaccs add DI #x7fffffffff (inv DI #x7fffffffff) | |
8502 | OP_78 OPE1_04 "Media accumulator addition") | |
8503 | (media-acc-arith-sat msubaccs sub DI #x7fffffffff (inv DI #x7fffffffff) | |
8504 | OP_78 OPE1_05 "Media accumulator subtraction") | |
8505 | ||
8506 | (define-pmacro (media-dual-acc-arith-sat name operation mode max min op ope | |
8507 | comment) | |
8508 | (dni name | |
8509 | (comment) | |
676a64f4 RS |
8510 | ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
8511 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
9aab5aa3 AC |
8512 | (.str name "$pack $ACC40Si,$ACC40Sk") |
8513 | (+ pack ACC40Sk op ACC40Si ope (ACCj-null)) | |
ac7c07ac DB |
8514 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si)) |
8515 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) | |
8516 | (if (register-unaligned ACC40Si 4) | |
8517 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8518 | (if (register-unaligned ACC40Sk 2) | |
8519 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8520 | (sequence () | |
8521 | (media-arith-sat-semantics operation ACC40Si | |
8522 | (nextreg h-acc40S ACC40Si 1) | |
8523 | ACC40Sk mode max min | |
8524 | (msr-sie-acci)) | |
8525 | (media-arith-sat-semantics operation | |
8526 | (nextreg h-acc40S ACC40Si 2) | |
8527 | (nextreg h-acc40S ACC40Si 3) | |
8528 | (nextreg h-acc40S ACC40Sk 1) | |
8529 | mode max min | |
8530 | (msr-sie-acci-1))))))) | |
676a64f4 RS |
8531 | ((fr400 (unit u-media-2-acc-dual)) (fr450 (unit u-media-2-acc-dual)) |
8532 | (fr550 (unit u-media-4-acc-dual))) | |
9aab5aa3 AC |
8533 | ) |
8534 | ) | |
8535 | ||
8536 | (media-dual-acc-arith-sat mdaddaccs add DI #x7fffffffff (inv DI #x7fffffffff) | |
8537 | OP_78 OPE1_06 "Media accumulator addition") | |
8538 | (media-dual-acc-arith-sat mdsubaccs sub DI #x7fffffffff (inv DI #x7fffffffff) | |
8539 | OP_78 OPE1_07 "Media accumulator subtraction") | |
8540 | ||
8541 | (dni masaccs | |
8542 | "Media add and subtract signed accumulator with saturation" | |
676a64f4 RS |
8543 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
8544 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
8545 | "masaccs$pack $ACC40Si,$ACC40Sk" |
8546 | (+ pack ACC40Sk OP_78 ACC40Si OPE1_08 (ACCj-null)) | |
ac7c07ac DB |
8547 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si)) |
8548 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) | |
8549 | (if (register-unaligned ACC40Si 2) | |
8550 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8551 | (if (register-unaligned ACC40Sk 2) | |
8552 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8553 | (sequence () | |
8554 | (media-arith-sat-semantics add ACC40Si | |
8555 | (nextreg h-acc40S ACC40Si 1) | |
8556 | ACC40Sk DI | |
8557 | #x7fffffffff | |
8558 | (inv DI #x7fffffffff) | |
8559 | (msr-sie-acci)) | |
8560 | (media-arith-sat-semantics sub ACC40Si | |
8561 | (nextreg h-acc40S ACC40Si 1) | |
8562 | (nextreg h-acc40S ACC40Sk 1) | |
8563 | DI | |
8564 | #x7fffffffff | |
8565 | (inv DI #x7fffffffff) | |
8566 | (msr-sie-acci-1))))))) | |
676a64f4 RS |
8567 | ((fr400 (unit u-media-2-add-sub)) (fr450 (unit u-media-2-add-sub)) |
8568 | (fr550 (unit u-media-4-add-sub))) | |
9aab5aa3 AC |
8569 | ) |
8570 | ||
8571 | (dni mdasaccs | |
8572 | "Media add and subtract signed accumulator with saturation" | |
676a64f4 RS |
8573 | ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
8574 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
9aab5aa3 AC |
8575 | "mdasaccs$pack $ACC40Si,$ACC40Sk" |
8576 | (+ pack ACC40Sk OP_78 ACC40Si OPE1_09 (ACCj-null)) | |
ac7c07ac DB |
8577 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si)) |
8578 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) | |
8579 | (if (register-unaligned ACC40Si 4) | |
8580 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8581 | (if (register-unaligned ACC40Sk 4) | |
8582 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8583 | (sequence () | |
8584 | (media-arith-sat-semantics add ACC40Si | |
8585 | (nextreg h-acc40S ACC40Si 1) | |
8586 | ACC40Sk DI | |
8587 | #x7fffffffff | |
8588 | (inv DI #x7fffffffff) | |
8589 | (msr-sie-acci)) | |
8590 | (media-arith-sat-semantics sub ACC40Si | |
8591 | (nextreg h-acc40S ACC40Si 1) | |
8592 | (nextreg h-acc40S ACC40Sk 1) | |
8593 | DI | |
8594 | #x7fffffffff | |
8595 | (inv DI #x7fffffffff) | |
8596 | (msr-sie-acci-1)) | |
8597 | (media-arith-sat-semantics add | |
8598 | (nextreg h-acc40S ACC40Si 2) | |
8599 | (nextreg h-acc40S ACC40Si 3) | |
8600 | (nextreg h-acc40S ACC40Sk 2) | |
8601 | DI | |
8602 | #x7fffffffff | |
8603 | (inv DI #x7fffffffff) | |
8604 | (msr-sie-acci-2)) | |
8605 | (media-arith-sat-semantics sub | |
8606 | (nextreg h-acc40S ACC40Si 2) | |
8607 | (nextreg h-acc40S ACC40Si 3) | |
8608 | (nextreg h-acc40S ACC40Sk 3) | |
8609 | DI | |
8610 | #x7fffffffff | |
8611 | (inv DI #x7fffffffff) | |
8612 | (msr-sie-acci-3))))))) | |
676a64f4 RS |
8613 | ((fr400 (unit u-media-2-add-sub-dual)) |
8614 | (fr450 (unit u-media-2-add-sub-dual)) | |
8615 | (fr550 (unit u-media-4-add-sub-dual))) | |
9aab5aa3 AC |
8616 | ) |
8617 | ||
8618 | (define-pmacro (media-multiply-semantics conv arg1 arg2 res) | |
8619 | (set res (mul DI (conv DI arg1) (conv DI arg2))) | |
8620 | ) | |
8621 | ||
8622 | (define-pmacro (media-dual-multiply-semantics cond mode conv rhs1 rhs2) | |
ac7c07ac DB |
8623 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
8624 | (if (register-unaligned ACC40Sk 2) | |
8625 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8626 | (if cond | |
8627 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
8628 | (extract-hilo FRinti 0 FRintj 0 | |
8629 | argihi argilo argjhi argjlo) | |
8630 | (media-multiply-semantics conv argihi rhs1 ACC40Sk) | |
8631 | (media-multiply-semantics conv argilo rhs2 | |
8632 | (nextreg h-acc40S ACC40Sk 1)))))) | |
9aab5aa3 AC |
8633 | ) |
8634 | ||
8635 | (define-pmacro (media-dual-multiply name mode conv rhs1 rhs2 op ope comment) | |
8636 | (dni name | |
8637 | (comment) | |
676a64f4 RS |
8638 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8639 | (FR400-MAJOR M-1) (FR450-MAJOR M-3) PRESERVE-OVF) | |
9aab5aa3 AC |
8640 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk") |
8641 | (+ pack ACC40Sk op FRinti ope FRintj) | |
8642 | (media-dual-multiply-semantics 1 mode conv rhs1 rhs2) | |
676a64f4 | 8643 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 8644 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
8645 | ) |
8646 | ) | |
8647 | ||
8648 | (media-dual-multiply mmulhs HI ext argjhi argjlo OP_7B OPE1_14 "Media dual multiply signed") | |
8649 | (media-dual-multiply mmulhu UHI zext argjhi argjlo OP_7B OPE1_15 "Media dual multiply unsigned") | |
8650 | ||
8651 | (media-dual-multiply mmulxhs HI ext argjlo argjhi OP_7B OPE1_28 "Media dual cross multiply signed") | |
8652 | (media-dual-multiply mmulxhu UHI zext argjlo argjhi OP_7B OPE1_29 "Media dual cross multiply unsigned") | |
8653 | ||
8654 | (define-pmacro (conditional-media-dual-multiply | |
8655 | name mode conv rhs1 rhs2 op ope comment) | |
8656 | (dni name | |
8657 | (comment) | |
676a64f4 RS |
8658 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8659 | (FR400-MAJOR M-1) (FR450-MAJOR M-3) | |
9aab5aa3 AC |
8660 | PRESERVE-OVF CONDITIONAL) |
8661 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond") | |
8662 | (+ pack ACC40Sk op FRinti CCi cond ope FRintj) | |
8663 | (media-dual-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2) | |
676a64f4 | 8664 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 8665 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
8666 | ) |
8667 | ) | |
8668 | ||
8669 | (conditional-media-dual-multiply cmmulhs HI ext argjhi argjlo OP_72 OPE4_0 "Conditional Media dual multiply signed") | |
8670 | (conditional-media-dual-multiply cmmulhu UHI zext argjhi argjlo OP_72 OPE4_1 "Conditional Media dual multiply unsigned") | |
8671 | ||
8672 | (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2) | |
ac7c07ac DB |
8673 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
8674 | (if (register-unaligned ACC40Sk 4) | |
8675 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8676 | (if (orif (register-unaligned FRintieven 2) | |
8677 | (register-unaligned FRintjeven 2)) | |
8678 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8679 | (if cond | |
8680 | (sequence ((mode argihi) (mode argilo) | |
8681 | (mode argjhi) (mode argjlo)) | |
8682 | (extract-hilo FRintieven 0 FRintjeven 0 | |
8683 | argihi argilo argjhi argjlo) | |
8684 | (media-multiply-semantics conv argihi rhs1 ACC40Sk) | |
8685 | (media-multiply-semantics conv argilo rhs2 | |
8686 | (nextreg h-acc40S ACC40Sk 1)) | |
8687 | (extract-hilo FRintieven 1 FRintjeven 1 | |
8688 | argihi argilo argjhi argjlo) | |
8689 | (media-multiply-semantics conv argihi rhs1 | |
8690 | (nextreg h-acc40S ACC40Sk 2)) | |
8691 | (media-multiply-semantics conv argilo rhs2 | |
8692 | (nextreg h-acc40S ACC40Sk 3))))))) | |
9aab5aa3 AC |
8693 | ) |
8694 | ||
8695 | (define-pmacro (media-quad-multiply name mode conv rhs1 rhs2 op ope comment) | |
8696 | (dni name | |
8697 | (comment) | |
676a64f4 RS |
8698 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8699 | (FR400-MAJOR M-2) (FR450-MAJOR M-4) PRESERVE-OVF) | |
36c3ae24 NC |
8700 | (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk") |
8701 | (+ pack ACC40Sk op FRintieven ope FRintjeven) | |
9aab5aa3 | 8702 | (media-quad-multiply-semantics 1 mode conv rhs1 rhs2) |
36c3ae24 NC |
8703 | ((fr400 (unit u-media-2-quad |
8704 | (in FRinti FRintieven) | |
8705 | (in FRintj FRintjeven))) | |
676a64f4 RS |
8706 | (fr450 (unit u-media-2-quad |
8707 | (in FRinti FRintieven) | |
8708 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
8709 | (fr500 (unit u-media-quad-mul |
8710 | (in FRinti FRintieven) | |
ac7c07ac | 8711 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
8712 | ) |
8713 | ) | |
8714 | ||
8715 | (media-quad-multiply mqmulhs HI ext argjhi argjlo OP_7B OPE1_1C "Media quad multiply signed") | |
8716 | (media-quad-multiply mqmulhu UHI zext argjhi argjlo OP_7B OPE1_1D "Media quad multiply unsigned") | |
8717 | ||
8718 | (media-quad-multiply mqmulxhs HI ext argjlo argjhi OP_7B OPE1_2A "Media quad cross multiply signed") | |
8719 | (media-quad-multiply mqmulxhu UHI zext argjlo argjhi OP_7B OPE1_2B "Media quad cross multiply unsigned") | |
8720 | ||
8721 | (define-pmacro (conditional-media-quad-multiply | |
8722 | name mode conv rhs1 rhs2 op ope comment) | |
8723 | (dni name | |
8724 | (comment) | |
676a64f4 RS |
8725 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8726 | (FR400-MAJOR M-2) (FR450-MAJOR M-4) | |
9aab5aa3 | 8727 | PRESERVE-OVF CONDITIONAL) |
36c3ae24 NC |
8728 | (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond") |
8729 | (+ pack ACC40Sk op FRintieven CCi cond ope FRintjeven) | |
9aab5aa3 | 8730 | (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2) |
36c3ae24 NC |
8731 | ((fr400 (unit u-media-2-quad |
8732 | (in FRinti FRintieven) | |
8733 | (in FRintj FRintjeven))) | |
676a64f4 RS |
8734 | (fr450 (unit u-media-2-quad |
8735 | (in FRinti FRintieven) | |
8736 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
8737 | (fr500 (unit u-media-quad-mul |
8738 | (in FRinti FRintieven) | |
ac7c07ac | 8739 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
8740 | ) |
8741 | ) | |
8742 | ||
8743 | (conditional-media-quad-multiply cmqmulhs HI ext argjhi argjlo OP_74 OPE4_0 "Conditional Media quad multiply signed") | |
8744 | (conditional-media-quad-multiply cmqmulhu UHI zext argjhi argjlo OP_74 OPE4_1 "Conditional Media quad multiply unsigned") | |
8745 | ||
8746 | (define-pmacro (media-multiply-acc-semantics | |
8747 | conv arg1 addop arg2 res max min sie) | |
8748 | (sequence ((DI tmp)) | |
8749 | (set tmp (addop res (mul DI (conv DI arg1) (conv DI arg2)))) | |
8750 | (saturate-v tmp max min sie res)) | |
8751 | ) | |
8752 | ||
8753 | (define-pmacro (media-dual-multiply-acc-semantics | |
8754 | cond mode conv addop rhw res max min) | |
ac7c07ac DB |
8755 | (if (c-call SI "@cpu@_check_acc_range" (index-of res)) |
8756 | (if (register-unaligned res 2) | |
8757 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8758 | (if cond | |
8759 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
8760 | (extract-hilo FRinti 0 FRintj 0 | |
8761 | argihi argilo argjhi argjlo) | |
8762 | (media-multiply-acc-semantics conv argihi addop argjhi | |
8763 | res | |
8764 | max min (msr-sie-acci)) | |
8765 | (media-multiply-acc-semantics conv argilo addop argjlo | |
8766 | (nextreg rhw res 1) | |
8767 | max min (msr-sie-acci-1)))))) | |
9aab5aa3 AC |
8768 | ) |
8769 | ||
8770 | (define-pmacro (media-dual-multiply-acc | |
8771 | name mode conv addop rhw res max min op ope comment) | |
8772 | (dni name | |
8773 | (comment) | |
676a64f4 RS |
8774 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8775 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
8776 | (.str name "$pack $FRinti,$FRintj,$" res) |
8777 | (+ pack res op FRinti ope FRintj) | |
8778 | (media-dual-multiply-acc-semantics 1 mode conv addop rhw res max min) | |
676a64f4 | 8779 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 8780 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
8781 | ) |
8782 | ) | |
8783 | ||
8784 | (media-dual-multiply-acc mmachs HI ext add h-acc40S ACC40Sk | |
8785 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8786 | OP_7B OPE1_16 | |
8787 | "Media dual multiply and accumulate signed") | |
8788 | ||
8789 | (media-dual-multiply-acc mmachu UHI zext add h-acc40U ACC40Uk | |
8790 | (const DI #xffffffffff) (const DI 0) | |
8791 | OP_7B OPE1_17 | |
8792 | "Media dual multiply and accumulate unsigned") | |
8793 | ||
8794 | (media-dual-multiply-acc mmrdhs HI ext sub h-acc40S ACC40Sk | |
8795 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8796 | OP_7B OPE1_30 | |
8797 | "Media dual multiply and reduce signed") | |
8798 | ||
8799 | (media-dual-multiply-acc mmrdhu UHI zext sub h-acc40U ACC40Uk | |
8800 | (const DI #xffffffffff) (const DI 0) | |
8801 | OP_7B OPE1_31 | |
8802 | "Media dual multiply and reduce unsigned") | |
8803 | ||
8804 | (define-pmacro (conditional-media-dual-multiply-acc | |
8805 | name mode conv addop rhw res max min op ope comment) | |
8806 | (dni name | |
8807 | (comment) | |
676a64f4 RS |
8808 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8809 | (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL) | |
9aab5aa3 AC |
8810 | (.str name "$pack $FRinti,$FRintj,$" res ",$CCi,$cond") |
8811 | (+ pack res op FRinti CCi cond ope FRintj) | |
8812 | (media-dual-multiply-acc-semantics (eq CCi (or cond 2)) | |
8813 | mode conv addop rhw res max min) | |
676a64f4 | 8814 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 8815 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
8816 | ) |
8817 | ) | |
8818 | ||
8819 | (conditional-media-dual-multiply-acc cmmachs HI ext add h-acc40S ACC40Sk | |
8820 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8821 | OP_72 OPE4_2 | |
8822 | "Conditional Media dual multiply and accumulate signed") | |
8823 | ||
8824 | (conditional-media-dual-multiply-acc cmmachu UHI zext add h-acc40U ACC40Uk | |
8825 | (const DI #xffffffffff) (const DI 0) | |
8826 | OP_72 OPE4_3 | |
8827 | "Conditional Media dual multiply and accumulate unsigned") | |
8828 | ||
8829 | (define-pmacro (media-quad-multiply-acc-semantics | |
8830 | cond mode conv addop rhw res max min) | |
ac7c07ac DB |
8831 | (if (c-call SI "@cpu@_check_acc_range" (index-of res)) |
8832 | (if (register-unaligned res 4) | |
8833 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8834 | (if (orif (register-unaligned FRintieven 2) | |
8835 | (register-unaligned FRintjeven 2)) | |
8836 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8837 | (if cond | |
8838 | (sequence ((mode argihi) (mode argilo) | |
8839 | (mode argjhi) (mode argjlo)) | |
8840 | (extract-hilo FRintieven 0 FRintjeven 0 | |
8841 | argihi argilo argjhi argjlo) | |
8842 | (media-multiply-acc-semantics conv argihi addop argjhi | |
8843 | res | |
8844 | max min (msr-sie-acci)) | |
8845 | (media-multiply-acc-semantics conv argilo addop argjlo | |
8846 | (nextreg rhw res 1) | |
8847 | max min (msr-sie-acci-1)) | |
8848 | (extract-hilo FRintieven 1 FRintjeven 1 | |
8849 | argihi argilo argjhi argjlo) | |
8850 | (media-multiply-acc-semantics conv argihi addop argjhi | |
8851 | (nextreg rhw res 2) | |
8852 | max min (msr-sie-acci-2)) | |
8853 | (media-multiply-acc-semantics conv argilo addop argjlo | |
8854 | (nextreg rhw res 3) | |
8855 | max min | |
8856 | (msr-sie-acci-3))))))) | |
9aab5aa3 AC |
8857 | ) |
8858 | ||
8859 | (define-pmacro (media-quad-multiply-acc | |
8860 | name mode conv addop rhw res max min op ope comment) | |
8861 | (dni name | |
8862 | (comment) | |
676a64f4 RS |
8863 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8864 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
8865 | (.str name "$pack $FRintieven,$FRintjeven,$" res) |
8866 | (+ pack res op FRintieven ope FRintjeven) | |
9aab5aa3 | 8867 | (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min) |
36c3ae24 NC |
8868 | ((fr400 (unit u-media-2-quad |
8869 | (in FRinti FRintieven) | |
8870 | (in FRintj FRintjeven))) | |
676a64f4 RS |
8871 | (fr450 (unit u-media-2-quad |
8872 | (in FRinti FRintieven) | |
8873 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
8874 | (fr500 (unit u-media-quad-mul |
8875 | (in FRinti FRintieven) | |
ac7c07ac | 8876 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
8877 | ) |
8878 | ) | |
8879 | ||
8880 | (media-quad-multiply-acc mqmachs HI ext add h-acc40S ACC40Sk | |
8881 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8882 | OP_7B OPE1_1E | |
8883 | "Media quad multiply and accumulate signed") | |
8884 | ||
8885 | (media-quad-multiply-acc mqmachu UHI zext add h-acc40U ACC40Uk | |
8886 | (const DI #xffffffffff) (const DI 0) | |
8887 | OP_7B OPE1_1F | |
8888 | "Media quad multiply and accumulate unsigned") | |
8889 | ||
8890 | (define-pmacro (conditional-media-quad-multiply-acc | |
8891 | name mode conv addop rhw res max min op ope comment) | |
8892 | (dni name | |
8893 | (comment) | |
676a64f4 RS |
8894 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
8895 | (FR400-MAJOR M-2) (FR450-MAJOR M-4) CONDITIONAL) | |
36c3ae24 NC |
8896 | (.str name "$pack $FRintieven,$FRintjeven,$" res ",$CCi,$cond") |
8897 | (+ pack res op FRintieven CCi cond ope FRintjeven) | |
9aab5aa3 AC |
8898 | (media-quad-multiply-acc-semantics (eq CCi (or cond 2)) |
8899 | mode conv addop rhw res max min) | |
36c3ae24 NC |
8900 | ((fr400 (unit u-media-2-quad |
8901 | (in FRinti FRintieven) | |
8902 | (in FRintj FRintjeven))) | |
676a64f4 RS |
8903 | (fr450 (unit u-media-2-quad |
8904 | (in FRinti FRintieven) | |
8905 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
8906 | (fr500 (unit u-media-quad-mul |
8907 | (in FRinti FRintieven) | |
ac7c07ac | 8908 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
8909 | ) |
8910 | ) | |
8911 | ||
8912 | (conditional-media-quad-multiply-acc cmqmachs HI ext add h-acc40S ACC40Sk | |
8913 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8914 | OP_74 OPE4_2 | |
8915 | "Conditional Media quad multiply and accumulate signed") | |
8916 | ||
8917 | (conditional-media-quad-multiply-acc cmqmachu UHI zext add h-acc40U ACC40Uk | |
8918 | (const DI #xffffffffff) (const DI 0) | |
8919 | OP_74 OPE4_3 | |
8920 | "Conditional media quad multiply and accumulate unsigned") | |
8921 | ||
8922 | (define-pmacro (media-quad-multiply-cross-acc-semantics | |
8923 | cond mode conv addop rhw res max min) | |
ac7c07ac DB |
8924 | (if (c-call SI "@cpu@_check_acc_range" (index-of res)) |
8925 | (if (register-unaligned res 4) | |
8926 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8927 | (if (orif (register-unaligned FRintieven 2) | |
8928 | (register-unaligned FRintjeven 2)) | |
8929 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8930 | (if cond | |
8931 | (sequence ((mode argihi) (mode argilo) | |
8932 | (mode argjhi) (mode argjlo)) | |
8933 | (extract-hilo FRintieven 0 FRintjeven 0 | |
8934 | argihi argilo argjhi argjlo) | |
8935 | (media-multiply-acc-semantics conv argihi addop argjhi | |
8936 | (nextreg rhw res 2) | |
8937 | max min (msr-sie-acci-2)) | |
8938 | (media-multiply-acc-semantics conv argilo addop argjlo | |
8939 | (nextreg rhw res 3) | |
8940 | max min (msr-sie-acci-3)) | |
8941 | (extract-hilo FRintieven 1 FRintjeven 1 | |
8942 | argihi argilo argjhi argjlo) | |
8943 | (media-multiply-acc-semantics conv argihi addop argjhi | |
8944 | res | |
8945 | max min (msr-sie-acci)) | |
8946 | (media-multiply-acc-semantics conv argilo addop argjlo | |
8947 | (nextreg rhw res 1) | |
8948 | max min | |
8949 | (msr-sie-acci-1))))))) | |
9aab5aa3 AC |
8950 | ) |
8951 | ||
8952 | (define-pmacro (media-quad-multiply-cross-acc | |
8953 | name mode conv addop rhw res max min op ope comment) | |
8954 | (dni name | |
8955 | (comment) | |
676a64f4 RS |
8956 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
8957 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
8958 | (.str name "$pack $FRintieven,$FRintjeven,$" res) |
8959 | (+ pack res op FRintieven ope FRintjeven) | |
9aab5aa3 AC |
8960 | (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res |
8961 | max min) | |
36c3ae24 NC |
8962 | ((fr400 (unit u-media-2-quad |
8963 | (in FRinti FRintieven) | |
676a64f4 RS |
8964 | (in FRintj FRintjeven))) |
8965 | (fr450 (unit u-media-2-quad | |
8966 | (in FRinti FRintieven) | |
8967 | (in FRintj FRintjeven))) | |
8968 | (fr550 (unit u-media-4-quad))) | |
9aab5aa3 AC |
8969 | ) |
8970 | ) | |
8971 | ||
8972 | (media-quad-multiply-cross-acc mqxmachs HI ext add h-acc40S ACC40Sk | |
8973 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
8974 | OP_78 OPE1_00 | |
8975 | "Media quad multiply and cross accumulate signed") | |
8976 | ||
8977 | (define-pmacro (media-quad-cross-multiply-cross-acc-semantics | |
8978 | cond mode conv addop rhw res max min) | |
ac7c07ac DB |
8979 | (if (c-call SI "@cpu@_check_acc_range" (index-of res)) |
8980 | (if (register-unaligned res 4) | |
8981 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
8982 | (if (orif (register-unaligned FRintieven 2) | |
8983 | (register-unaligned FRintjeven 2)) | |
8984 | (c-call VOID "@cpu@_media_register_not_aligned") | |
8985 | (if cond | |
8986 | (sequence ((mode argihi) (mode argilo) | |
8987 | (mode argjhi) (mode argjlo)) | |
8988 | (extract-hilo FRintieven 0 FRintjeven 0 | |
8989 | argihi argilo argjhi argjlo) | |
8990 | (media-multiply-acc-semantics conv argihi addop argjlo | |
8991 | (nextreg rhw res 2) | |
8992 | max min (msr-sie-acci-2)) | |
8993 | (media-multiply-acc-semantics conv argilo addop argjhi | |
8994 | (nextreg rhw res 3) | |
8995 | max min (msr-sie-acci-3)) | |
8996 | (extract-hilo FRintieven 1 FRintjeven 1 | |
8997 | argihi argilo argjhi argjlo) | |
8998 | (media-multiply-acc-semantics conv argihi addop argjlo | |
8999 | res | |
9000 | max min (msr-sie-acci)) | |
9001 | (media-multiply-acc-semantics conv argilo addop argjhi | |
9002 | (nextreg rhw res 1) | |
9003 | max min | |
9004 | (msr-sie-acci-1))))))) | |
9aab5aa3 AC |
9005 | ) |
9006 | ||
9007 | (define-pmacro (media-quad-cross-multiply-cross-acc | |
9008 | name mode conv addop rhw res max min op ope comment) | |
9009 | (dni name | |
9010 | (comment) | |
676a64f4 RS |
9011 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
9012 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
9013 | (.str name "$pack $FRintieven,$FRintjeven,$" res) |
9014 | (+ pack res op FRintieven ope FRintjeven) | |
9aab5aa3 AC |
9015 | (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res |
9016 | max min) | |
36c3ae24 NC |
9017 | ((fr400 (unit u-media-2-quad |
9018 | (in FRinti FRintieven) | |
676a64f4 RS |
9019 | (in FRintj FRintjeven))) |
9020 | (fr450 (unit u-media-2-quad | |
9021 | (in FRinti FRintieven) | |
9022 | (in FRintj FRintjeven))) | |
9023 | (fr550 (unit u-media-4-quad))) | |
9aab5aa3 AC |
9024 | ) |
9025 | ) | |
9026 | ||
9027 | (media-quad-cross-multiply-cross-acc mqxmacxhs HI ext add h-acc40S ACC40Sk | |
9028 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9029 | OP_78 OPE1_01 | |
9030 | "Media quad cross multiply and cross accumulate signed") | |
9031 | ||
9032 | (define-pmacro (media-quad-cross-multiply-acc-semantics | |
9033 | cond mode conv addop rhw res max min) | |
ac7c07ac DB |
9034 | (if (c-call SI "@cpu@_check_acc_range" (index-of res)) |
9035 | (if (register-unaligned res 4) | |
9036 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
9037 | (if (orif (register-unaligned FRintieven 2) | |
9038 | (register-unaligned FRintjeven 2)) | |
9039 | (c-call VOID "@cpu@_media_register_not_aligned") | |
9040 | (if cond | |
9041 | (sequence ((mode argihi) (mode argilo) | |
9042 | (mode argjhi) (mode argjlo)) | |
9043 | (extract-hilo FRintieven 0 FRintjeven 0 | |
9044 | argihi argilo argjhi argjlo) | |
9045 | (media-multiply-acc-semantics conv argihi addop argjlo | |
9046 | res | |
9047 | max min (msr-sie-acci)) | |
9048 | (media-multiply-acc-semantics conv argilo addop argjhi | |
9049 | (nextreg rhw res 1) | |
9050 | max min (msr-sie-acci-1)) | |
9051 | (extract-hilo FRintieven 1 FRintjeven 1 | |
9052 | argihi argilo argjhi argjlo) | |
9053 | (media-multiply-acc-semantics conv argihi addop argjlo | |
9054 | (nextreg rhw res 2) | |
9055 | max min (msr-sie-acci-2)) | |
9056 | (media-multiply-acc-semantics conv argilo addop argjhi | |
9057 | (nextreg rhw res 3) | |
9058 | max min | |
9059 | (msr-sie-acci-3))))))) | |
9aab5aa3 AC |
9060 | ) |
9061 | ||
9062 | (define-pmacro (media-quad-cross-multiply-acc | |
9063 | name mode conv addop rhw res max min op ope comment) | |
9064 | (dni name | |
9065 | (comment) | |
676a64f4 RS |
9066 | ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4) |
9067 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
9068 | (.str name "$pack $FRintieven,$FRintjeven,$" res) |
9069 | (+ pack res op FRintieven ope FRintjeven) | |
9aab5aa3 AC |
9070 | (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res |
9071 | max min) | |
36c3ae24 NC |
9072 | ((fr400 (unit u-media-2-quad |
9073 | (in FRinti FRintieven) | |
676a64f4 RS |
9074 | (in FRintj FRintjeven))) |
9075 | (fr450 (unit u-media-2-quad | |
9076 | (in FRinti FRintieven) | |
9077 | (in FRintj FRintjeven))) | |
9078 | (fr550 (unit u-media-4-quad))) | |
9aab5aa3 AC |
9079 | ) |
9080 | ) | |
9081 | ||
9082 | (media-quad-cross-multiply-acc mqmacxhs HI ext add h-acc40S ACC40Sk | |
9083 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9084 | OP_78 OPE1_02 | |
9085 | "Media quad cross multiply and accumulate signed") | |
9086 | ||
9087 | (define-pmacro (media-complex-semantics | |
9088 | conv lhs1 rhs1 lhs2 rhs2 res max min sie) | |
9089 | (sequence ((DI tmp1) (DI tmp2)) | |
9090 | (media-multiply-semantics conv lhs1 rhs1 tmp1) | |
9091 | (media-multiply-semantics conv lhs2 rhs2 tmp2) | |
9092 | (set tmp1 (sub tmp1 tmp2)) | |
9093 | (saturate-v tmp1 max min sie res)) | |
9094 | ) | |
9095 | ||
9096 | (define-pmacro (media-complex-semantics-i | |
9097 | conv lhs1 rhs1 lhs2 rhs2 res max min sie) | |
9098 | (sequence ((DI tmp1) (DI tmp2)) | |
9099 | (media-multiply-semantics conv lhs1 rhs1 tmp1) | |
9100 | (media-multiply-semantics conv lhs2 rhs2 tmp2) | |
9101 | (set tmp1 (add tmp1 tmp2)) | |
9102 | (saturate-v tmp1 max min sie res)) | |
9103 | ) | |
9104 | ||
9105 | (define-pmacro (media-dual-complex-semantics mode conv rhs1 rhs2 max min) | |
ac7c07ac DB |
9106 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
9107 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
9108 | (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo) | |
9109 | (media-complex-semantics conv argihi rhs1 argilo rhs2 ACC40Sk | |
9110 | max min (msr-sie-acci)))) | |
9aab5aa3 AC |
9111 | ) |
9112 | ||
9113 | (define-pmacro (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min) | |
ac7c07ac DB |
9114 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
9115 | (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo)) | |
9116 | (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo) | |
9117 | (media-complex-semantics-i conv argihi rhs1 argilo rhs2 ACC40Sk | |
9118 | max min (msr-sie-acci)))) | |
9aab5aa3 AC |
9119 | ) |
9120 | ||
9121 | (define-pmacro (media-dual-complex | |
9122 | name mode conv rhs1 rhs2 max min op ope comment) | |
9123 | (dni name | |
9124 | (comment) | |
676a64f4 RS |
9125 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9126 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
9127 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk") |
9128 | (+ pack ACC40Sk op FRinti ope FRintj) | |
9129 | (media-dual-complex-semantics mode conv rhs1 rhs2 max min) | |
676a64f4 | 9130 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 9131 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
9132 | ) |
9133 | ) | |
9134 | ||
9135 | (define-pmacro (media-dual-complex-i | |
9136 | name mode conv rhs1 rhs2 max min op ope comment) | |
9137 | (dni name | |
9138 | (comment) | |
676a64f4 RS |
9139 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9140 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
9141 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk") |
9142 | (+ pack ACC40Sk op FRinti ope FRintj) | |
9143 | (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min) | |
676a64f4 | 9144 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 9145 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
9146 | ) |
9147 | ) | |
9148 | ||
9149 | (media-dual-complex mcpxrs HI ext argjhi argjlo | |
9150 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9151 | OP_7B OPE1_20 | |
9152 | "Media dual complex real signed with saturation") | |
9153 | ||
9154 | (media-dual-complex mcpxru UHI zext argjhi argjlo | |
9155 | (const DI #xffffffffff) (const DI 0) | |
9156 | OP_7B OPE1_21 | |
9157 | "Media dual complex real unsigned with saturation") | |
9158 | ||
9159 | (media-dual-complex-i mcpxis HI ext argjlo argjhi | |
9160 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9161 | OP_7B OPE1_22 | |
9162 | "Media dual complex imaginary signed with saturation") | |
9163 | ||
9164 | (media-dual-complex-i mcpxiu UHI zext argjlo argjhi | |
9165 | (const DI #xffffffffff) (const DI 0) | |
9166 | OP_7B OPE1_23 | |
9167 | "Media dual complex imaginary unsigned with saturation") | |
9168 | ||
9169 | (define-pmacro (conditional-media-dual-complex | |
9170 | name mode conv rhs1 rhs2 max min op ope comment) | |
9171 | (dni name | |
9172 | (comment) | |
676a64f4 RS |
9173 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9174 | (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL) | |
9aab5aa3 AC |
9175 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond") |
9176 | (+ pack ACC40Sk op FRinti CCi cond ope FRintj) | |
9177 | (if (eq CCi (or cond 2)) | |
9178 | (media-dual-complex-semantics mode conv rhs1 rhs2 max min)) | |
676a64f4 | 9179 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 9180 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
9181 | ) |
9182 | ) | |
9183 | ||
9184 | (define-pmacro (conditional-media-dual-complex-i | |
9185 | name mode conv rhs1 rhs2 max min op ope comment) | |
9186 | (dni name | |
9187 | (comment) | |
676a64f4 RS |
9188 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9189 | (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL) | |
9aab5aa3 AC |
9190 | (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond") |
9191 | (+ pack ACC40Sk op FRinti CCi cond ope FRintj) | |
9192 | (if (eq CCi (or cond 2)) | |
9193 | (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)) | |
676a64f4 | 9194 | ((fr400 (unit u-media-2)) (fr450 (unit u-media-2)) |
ac7c07ac | 9195 | (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4))) |
9aab5aa3 AC |
9196 | ) |
9197 | ) | |
9198 | ||
9199 | (conditional-media-dual-complex cmcpxrs HI ext argjhi argjlo | |
9200 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9201 | OP_75 OPE4_0 | |
9202 | "Conditional Media dual complex real signed with saturation") | |
9203 | ||
9204 | (conditional-media-dual-complex cmcpxru UHI zext argjhi argjlo | |
9205 | (const DI #xffffffffff) (const DI 0) | |
9206 | OP_75 OPE4_1 | |
9207 | "Conditional Media dual complex real unsigned with saturation") | |
9208 | ||
9209 | (conditional-media-dual-complex-i cmcpxis HI ext argjlo argjhi | |
9210 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9211 | OP_75 OPE4_2 | |
9212 | "Conditional Media dual complex imaginary signed with saturation") | |
9213 | ||
9214 | (conditional-media-dual-complex-i cmcpxiu UHI zext argjlo argjhi | |
9215 | (const DI #xffffffffff) (const DI 0) | |
9216 | OP_75 OPE4_3 | |
9217 | "Conditional Media dual complex imaginary unsigned with saturation") | |
9218 | ||
9219 | (define-pmacro (media-quad-complex | |
9220 | name mode conv rhs1 rhs2 max min op ope comment) | |
9221 | (dni name | |
9222 | (comment) | |
676a64f4 RS |
9223 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9224 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
9225 | (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk") |
9226 | (+ pack ACC40Sk op FRintieven ope FRintjeven) | |
ac7c07ac DB |
9227 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
9228 | (if (register-unaligned ACC40Sk 2) | |
9229 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
9230 | (if (orif (register-unaligned FRintieven 2) | |
9231 | (register-unaligned FRintjeven 2)) | |
9232 | (c-call VOID "@cpu@_media_register_not_aligned") | |
9233 | (sequence ((mode argihi) (mode argilo) | |
9234 | (mode argjhi) (mode argjlo)) | |
9235 | (extract-hilo FRintieven 0 FRintjeven 0 | |
9236 | argihi argilo argjhi argjlo) | |
9237 | (media-complex-semantics conv argihi rhs1 argilo rhs2 | |
9238 | ACC40Sk | |
9239 | max min (msr-sie-acci)) | |
9240 | (extract-hilo FRintieven 1 FRintjeven 1 | |
9241 | argihi argilo argjhi argjlo) | |
9242 | (media-complex-semantics conv argihi rhs1 argilo rhs2 | |
9243 | (nextreg h-acc40S ACC40Sk 1) | |
9244 | max min (msr-sie-acci-1)))))) | |
36c3ae24 NC |
9245 | ((fr400 (unit u-media-2-quad |
9246 | (in FRinti FRintieven) | |
9247 | (in FRintj FRintjeven))) | |
676a64f4 RS |
9248 | (fr450 (unit u-media-2-quad |
9249 | (in FRinti FRintieven) | |
9250 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
9251 | (fr500 (unit u-media-quad-complex |
9252 | (in FRinti FRintieven) | |
ac7c07ac | 9253 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
9254 | ) |
9255 | ) | |
9256 | ||
9257 | (define-pmacro (media-quad-complex-i | |
9258 | name mode conv rhs1 rhs2 max min op ope comment) | |
9259 | (dni name | |
9260 | (comment) | |
676a64f4 RS |
9261 | ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4) |
9262 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
36c3ae24 NC |
9263 | (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk") |
9264 | (+ pack ACC40Sk op FRintieven ope FRintjeven) | |
ac7c07ac DB |
9265 | (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk)) |
9266 | (if (register-unaligned ACC40Sk 2) | |
9267 | (c-call VOID "@cpu@_media_acc_not_aligned") | |
9268 | (if (orif (register-unaligned FRintieven 2) | |
9269 | (register-unaligned FRintjeven 2)) | |
9270 | (c-call VOID "@cpu@_media_register_not_aligned") | |
9271 | (sequence ((mode argihi) (mode argilo) | |
9272 | (mode argjhi) (mode argjlo)) | |
9273 | (extract-hilo FRintieven 0 FRintjeven 0 | |
9274 | argihi argilo argjhi argjlo) | |
9275 | (media-complex-semantics-i conv argihi rhs1 argilo rhs2 | |
9276 | ACC40Sk | |
9277 | max min (msr-sie-acci)) | |
9278 | (extract-hilo FRintieven 1 FRintjeven 1 | |
9279 | argihi argilo argjhi argjlo) | |
9280 | (media-complex-semantics-i conv argihi rhs1 argilo rhs2 | |
9281 | (nextreg h-acc40S ACC40Sk 1) | |
9282 | max min (msr-sie-acci-1)))))) | |
36c3ae24 NC |
9283 | ((fr400 (unit u-media-2-quad |
9284 | (in FRinti FRintieven) | |
9285 | (in FRintj FRintjeven))) | |
676a64f4 RS |
9286 | (fr450 (unit u-media-2-quad |
9287 | (in FRinti FRintieven) | |
9288 | (in FRintj FRintjeven))) | |
36c3ae24 NC |
9289 | (fr500 (unit u-media-quad-complex |
9290 | (in FRinti FRintieven) | |
ac7c07ac | 9291 | (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad))) |
9aab5aa3 AC |
9292 | ) |
9293 | ) | |
9294 | ||
9295 | (media-quad-complex mqcpxrs HI ext argjhi argjlo | |
9296 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9297 | OP_7B OPE1_24 | |
9298 | "Media quad complex real signed with saturation") | |
9299 | ||
9300 | (media-quad-complex mqcpxru UHI zext argjhi argjlo | |
9301 | (const DI #xffffffffff) (const DI 0) | |
9302 | OP_7B OPE1_25 | |
9303 | "Media quad complex real unsigned with saturation") | |
9304 | ||
9305 | (media-quad-complex-i mqcpxis HI ext argjlo argjhi | |
9306 | (const DI #x7fffffffff) (const DI #xffffff8000000000) | |
9307 | OP_7B OPE1_26 | |
9308 | "Media quad complex imaginary signed with saturation") | |
9309 | ||
9310 | (media-quad-complex-i mqcpxiu UHI zext argjlo argjhi | |
9311 | (const DI #xffffffffff) (const DI 0) | |
9312 | OP_7B OPE1_27 | |
9313 | "Media quad complex imaginary unsigned with saturation") | |
9314 | ||
9315 | (define-pmacro (media-pack src1 src2 targ offset) | |
9316 | (sequence () | |
9317 | (set (halfword hi targ offset) (halfword lo src1 offset)) | |
9318 | (set (halfword lo targ offset) (halfword lo src2 offset))) | |
9319 | ) | |
9320 | ||
9321 | (define-pmacro (media-expand-halfword-to-word-semantics cond) | |
9322 | (if cond | |
9323 | (sequence ((UHI tmp)) | |
9324 | (if (and u6 1) | |
9325 | (set tmp (halfword lo FRinti 0)) | |
9326 | (set tmp (halfword hi FRinti 0))) | |
9327 | (set (halfword hi FRintk 0) tmp) | |
9328 | (set (halfword lo FRintk 0) tmp))) | |
9329 | ) | |
9330 | ||
9331 | (dni mexpdhw | |
9332 | "Media expand halfword to word" | |
676a64f4 RS |
9333 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9334 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
9335 | "mexpdhw$pack $FRinti,$u6,$FRintk" |
9336 | (+ pack FRintk OP_7B FRinti OPE1_32 u6) | |
9337 | (media-expand-halfword-to-word-semantics 1) | |
676a64f4 | 9338 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
ac7c07ac | 9339 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
9340 | ) |
9341 | ||
9342 | (dni cmexpdhw | |
9343 | "Conditional media expand halfword to word" | |
676a64f4 RS |
9344 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9345 | (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL) | |
9aab5aa3 AC |
9346 | "cmexpdhw$pack $FRinti,$u6,$FRintk,$CCi,$cond" |
9347 | (+ pack FRintk OP_76 FRinti CCi cond OPE4_2 u6) | |
9348 | (media-expand-halfword-to-word-semantics (eq CCi (or cond 2))) | |
676a64f4 | 9349 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
ac7c07ac | 9350 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
9351 | ) |
9352 | ||
9353 | (define-pmacro (media-expand-halfword-to-double-semantics cond) | |
36c3ae24 | 9354 | (if (register-unaligned FRintkeven 2) |
9aab5aa3 AC |
9355 | (c-call VOID "@cpu@_media_register_not_aligned") |
9356 | (if cond | |
9357 | (sequence ((UHI tmp)) | |
36c3ae24 NC |
9358 | ; a hack to get FRintkeven referenced for profiling |
9359 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
9aab5aa3 AC |
9360 | (if (and u6 1) |
9361 | (set tmp (halfword lo FRinti 0)) | |
9362 | (set tmp (halfword hi FRinti 0))) | |
36c3ae24 NC |
9363 | (set (halfword hi FRintkeven 0) tmp) |
9364 | (set (halfword lo FRintkeven 0) tmp) | |
9365 | (set (halfword hi FRintkeven 1) tmp) | |
9366 | (set (halfword lo FRintkeven 1) tmp)))) | |
9aab5aa3 AC |
9367 | ) |
9368 | ||
9369 | (dni mexpdhd | |
9370 | "Media expand halfword to double" | |
676a64f4 RS |
9371 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9372 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
9373 | "mexpdhd$pack $FRinti,$u6,$FRintkeven" |
9374 | (+ pack FRintkeven OP_7B FRinti OPE1_33 u6) | |
9aab5aa3 | 9375 | (media-expand-halfword-to-double-semantics 1) |
36c3ae24 | 9376 | ((fr400 (unit u-media-dual-expand |
676a64f4 RS |
9377 | (out FRintk FRintkeven))) |
9378 | (fr450 (unit u-media-dual-expand | |
9379 | (out FRintk FRintkeven))) | |
36c3ae24 | 9380 | (fr500 (unit u-media-dual-expand |
676a64f4 RS |
9381 | (out FRintk FRintkeven))) |
9382 | (fr550 (unit u-media-dual-expand))) | |
9aab5aa3 AC |
9383 | ) |
9384 | ||
9385 | (dni cmexpdhd | |
9386 | "Conditional media expand halfword to double" | |
676a64f4 RS |
9387 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9388 | (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL) | |
36c3ae24 NC |
9389 | "cmexpdhd$pack $FRinti,$u6,$FRintkeven,$CCi,$cond" |
9390 | (+ pack FRintkeven OP_76 FRinti CCi cond OPE4_3 u6) | |
9aab5aa3 | 9391 | (media-expand-halfword-to-double-semantics (eq CCi (or cond 2))) |
36c3ae24 NC |
9392 | ((fr400 (unit u-media-dual-expand |
9393 | (out FRintk FRintkeven))) | |
676a64f4 RS |
9394 | (fr450 (unit u-media-dual-expand |
9395 | (out FRintk FRintkeven))) | |
36c3ae24 | 9396 | (fr500 (unit u-media-dual-expand |
676a64f4 RS |
9397 | (out FRintk FRintkeven))) |
9398 | (fr550 (unit u-media-dual-expand))) | |
9aab5aa3 AC |
9399 | ) |
9400 | ||
9401 | (dni mpackh | |
9402 | "Media halfword pack" | |
676a64f4 RS |
9403 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9404 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
9aab5aa3 AC |
9405 | "mpackh$pack $FRinti,$FRintj,$FRintk" |
9406 | (+ pack FRintk OP_7B FRinti OPE1_34 FRintj) | |
9407 | (media-pack FRinti FRintj FRintk 0) | |
676a64f4 | 9408 | ((fr400 (unit u-media-3)) (fr450 (unit u-media-3)) |
ac7c07ac | 9409 | (fr500 (unit u-media)) (fr550 (unit u-media))) |
9aab5aa3 AC |
9410 | ) |
9411 | ||
9412 | (dni mdpackh | |
9413 | "Media dual pack" | |
676a64f4 RS |
9414 | ((UNIT FM01) (FR500-MAJOR M-5) (FR550-MAJOR M-3) |
9415 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
9416 | "mdpackh$pack $FRintieven,$FRintjeven,$FRintkeven" |
9417 | (+ pack FRintkeven OP_7B FRintieven OPE1_36 FRintjeven) | |
9418 | (if (orif (register-unaligned FRintieven 2) | |
9419 | (orif (register-unaligned FRintjeven 2) | |
9420 | (register-unaligned FRintkeven 2))) | |
9aab5aa3 AC |
9421 | (c-call VOID "@cpu@_media_register_not_aligned") |
9422 | (sequence () | |
9423 | ; hack to get these referenced for profiling | |
36c3ae24 NC |
9424 | (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven)) |
9425 | (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven)) | |
9426 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
9427 | (media-pack FRintieven FRintjeven FRintkeven 0) | |
9428 | (media-pack FRintieven FRintjeven FRintkeven 1))) | |
9429 | ((fr400 (unit u-media-3-quad | |
9430 | (in FRinti FRintieven) | |
9431 | (in FRintj FRintjeven) | |
9432 | (out FRintk FRintkeven))) | |
676a64f4 RS |
9433 | (fr450 (unit u-media-3-quad |
9434 | (in FRinti FRintieven) | |
9435 | (in FRintj FRintjeven) | |
9436 | (out FRintk FRintkeven))) | |
36c3ae24 NC |
9437 | (fr500 (unit u-media-quad-arith |
9438 | (in FRinti FRintieven) | |
9439 | (in FRintj FRintjeven) | |
676a64f4 RS |
9440 | (out FRintk FRintkeven))) |
9441 | (fr550 (unit u-media-quad))) | |
9aab5aa3 AC |
9442 | ) |
9443 | ||
9444 | (define-pmacro (media-unpack src soff targ toff) | |
9445 | (sequence () | |
9446 | (set (halfword hi targ toff) (halfword hi src soff)) | |
9447 | (set (halfword lo targ toff) (halfword hi src soff)) | |
9448 | (set (halfword hi targ (add toff 1)) (halfword lo src soff)) | |
9449 | (set (halfword lo targ (add toff 1)) (halfword lo src soff))) | |
9450 | ) | |
9451 | ||
9452 | (dni munpackh | |
9453 | "Media halfword unpack" | |
676a64f4 RS |
9454 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9455 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
9456 | "munpackh$pack $FRinti,$FRintkeven" |
9457 | (+ pack FRintkeven OP_7B FRinti OPE1_35 (FRj-null)) | |
9458 | (if (register-unaligned FRintkeven 2) | |
9aab5aa3 AC |
9459 | (c-call VOID "@cpu@_media_register_not_aligned") |
9460 | (sequence () | |
9461 | ; hack to get these referenced for profiling | |
9462 | (set FRinti (c-raw-call SI "frv_ref_SI" FRinti)) | |
36c3ae24 NC |
9463 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) |
9464 | (media-unpack FRinti 0 FRintkeven 0))) | |
9465 | ((fr400 (unit u-media-dual-expand | |
9466 | (out FRintk FRintkeven))) | |
676a64f4 RS |
9467 | (fr450 (unit u-media-dual-expand |
9468 | (out FRintk FRintkeven))) | |
36c3ae24 | 9469 | (fr500 (unit u-media-dual-expand |
676a64f4 RS |
9470 | (out FRintk FRintkeven))) |
9471 | (fr550 (unit u-media-dual-expand))) | |
9aab5aa3 AC |
9472 | ) |
9473 | ||
9474 | (dni mdunpackh | |
9475 | "Media dual unpack" | |
9476 | ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv)) | |
36c3ae24 NC |
9477 | "mdunpackh$pack $FRintieven,$FRintk" |
9478 | (+ pack FRintk OP_7B FRintieven OPE1_37 (FRj-null)) | |
9479 | (if (orif (register-unaligned FRintieven 2) (register-unaligned FRintk 4)) | |
9aab5aa3 AC |
9480 | (c-call VOID "@cpu@_media_register_not_aligned") |
9481 | (sequence () | |
9482 | ; hack to get these referenced for profiling | |
36c3ae24 | 9483 | (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven)) |
9aab5aa3 | 9484 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) |
36c3ae24 NC |
9485 | (media-unpack FRintieven 0 FRintk 0) |
9486 | (media-unpack FRintieven 1 FRintk 2))) | |
9487 | ((fr500 (unit u-media-dual-unpack | |
9488 | (in FRinti FRintieven)))) | |
9aab5aa3 AC |
9489 | ) |
9490 | ||
9491 | (define-pmacro (ubyte num arg offset) | |
9492 | (reg (.sym h-fr_ num) (add (index-of arg) offset))) | |
9493 | ||
9494 | (define-pmacro (mbtoh-semantics cond) | |
36c3ae24 | 9495 | (if (register-unaligned FRintkeven 2) |
9aab5aa3 AC |
9496 | (c-call VOID "@cpu@_media_register_not_aligned") |
9497 | (if cond | |
9498 | (sequence () | |
36c3ae24 NC |
9499 | (set (halfword hi FRintkeven 0) (ubyte 3 FRintj 0)) |
9500 | (set (halfword lo FRintkeven 0) (ubyte 2 FRintj 0)) | |
9501 | (set (halfword hi FRintkeven 1) (ubyte 1 FRintj 0)) | |
9502 | (set (halfword lo FRintkeven 1) (ubyte 0 FRintj 0))))) | |
9aab5aa3 AC |
9503 | ) |
9504 | ||
9505 | (dni mbtoh | |
9506 | "Media convert byte to halfword" | |
676a64f4 RS |
9507 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9508 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
9509 | "mbtoh$pack $FRintj,$FRintkeven" |
9510 | (+ pack FRintkeven OP_7B (FRi-null) OPE1_38 FRintj) | |
9aab5aa3 AC |
9511 | (sequence () |
9512 | ; hack to get these referenced for profiling | |
9513 | (set FRintj (c-raw-call SI "frv_ref_SI" FRintj)) | |
36c3ae24 | 9514 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) |
9aab5aa3 | 9515 | (mbtoh-semantics 1)) |
36c3ae24 | 9516 | ((fr400 (unit u-media-dual-expand |
6d9ab561 | 9517 | (out FRintk FRintkeven))) |
676a64f4 RS |
9518 | (fr450 (unit u-media-dual-expand |
9519 | (out FRintk FRintkeven))) | |
36c3ae24 | 9520 | (fr500 (unit u-media-dual-btoh |
676a64f4 RS |
9521 | (out FRintk FRintkeven))) |
9522 | (fr550 (unit u-media-dual-expand))) | |
9aab5aa3 AC |
9523 | ) |
9524 | ||
9525 | (dni cmbtoh | |
9526 | "Conditional media convert byte to halfword" | |
676a64f4 RS |
9527 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9528 | (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL) | |
36c3ae24 NC |
9529 | "cmbtoh$pack $FRintj,$FRintkeven,$CCi,$cond" |
9530 | (+ pack FRintkeven OP_77 (FRi-null) CCi cond OPE4_0 FRintj) | |
6d9ab561 NC |
9531 | (sequence () |
9532 | ; hack to get these referenced for profiling | |
9533 | (set FRintj (c-raw-call SI "frv_ref_SI" FRintj)) | |
9534 | (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven)) | |
9535 | (mbtoh-semantics (eq CCi (or cond 2)))) | |
36c3ae24 NC |
9536 | ((fr400 (unit u-media-dual-expand |
9537 | (out FRintk FRintkeven))) | |
676a64f4 RS |
9538 | (fr450 (unit u-media-dual-expand |
9539 | (out FRintk FRintkeven))) | |
36c3ae24 | 9540 | (fr500 (unit u-media-dual-btoh |
676a64f4 RS |
9541 | (out FRintk FRintkeven))) |
9542 | (fr550 (unit u-media-dual-expand | |
9543 | (in FRinti FRintj)))) | |
9aab5aa3 AC |
9544 | ) |
9545 | ||
9546 | (define-pmacro (mhtob-semantics cond) | |
36c3ae24 | 9547 | (if (register-unaligned FRintjeven 2) |
9aab5aa3 AC |
9548 | (c-call VOID "@cpu@_media_register_not_aligned") |
9549 | (if cond | |
9550 | (sequence () | |
36c3ae24 NC |
9551 | (set (ubyte 3 FRintk 0) (halfword hi FRintjeven 0)) |
9552 | (set (ubyte 2 FRintk 0) (halfword lo FRintjeven 0)) | |
9553 | (set (ubyte 1 FRintk 0) (halfword hi FRintjeven 1)) | |
9554 | (set (ubyte 0 FRintk 0) (halfword lo FRintjeven 1))))) | |
9aab5aa3 AC |
9555 | ) |
9556 | ||
9557 | (dni mhtob | |
9558 | "Media convert halfword to byte" | |
676a64f4 RS |
9559 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9560 | (FR400-MAJOR M-2) (FR450-MAJOR M-2)) | |
36c3ae24 NC |
9561 | "mhtob$pack $FRintjeven,$FRintk" |
9562 | (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintjeven) | |
9aab5aa3 AC |
9563 | (sequence () |
9564 | ; hack to get these referenced for profiling | |
36c3ae24 | 9565 | (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven)) |
9aab5aa3 AC |
9566 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) |
9567 | (mhtob-semantics 1)) | |
36c3ae24 NC |
9568 | ((fr400 (unit u-media-dual-htob |
9569 | (in FRintj FRintjeven))) | |
676a64f4 RS |
9570 | (fr450 (unit u-media-dual-htob |
9571 | (in FRintj FRintjeven))) | |
36c3ae24 | 9572 | (fr500 (unit u-media-dual-htob |
676a64f4 RS |
9573 | (in FRintj FRintjeven))) |
9574 | (fr550 (unit u-media-3-dual | |
9575 | (in FRinti FRintjeven)))) | |
9aab5aa3 AC |
9576 | ) |
9577 | ||
9578 | (dni cmhtob | |
9579 | "Conditional media convert halfword to byte" | |
676a64f4 RS |
9580 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9581 | (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL) | |
36c3ae24 NC |
9582 | "cmhtob$pack $FRintjeven,$FRintk,$CCi,$cond" |
9583 | (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintjeven) | |
9aab5aa3 AC |
9584 | (sequence () |
9585 | ; hack to get these referenced for profiling | |
36c3ae24 | 9586 | (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven)) |
9aab5aa3 AC |
9587 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) |
9588 | (mhtob-semantics (eq CCi (or cond 2)))) | |
36c3ae24 NC |
9589 | ((fr400 (unit u-media-dual-htob |
9590 | (in FRintj FRintjeven))) | |
676a64f4 RS |
9591 | (fr450 (unit u-media-dual-htob |
9592 | (in FRintj FRintjeven))) | |
36c3ae24 | 9593 | (fr500 (unit u-media-dual-htob |
676a64f4 RS |
9594 | (in FRintj FRintjeven))) |
9595 | (fr550 (unit u-media-3-dual | |
9596 | (in FRinti FRintjeven)))) | |
9aab5aa3 AC |
9597 | ) |
9598 | ||
9599 | (define-pmacro (mbtohe-semantics cond) | |
9600 | (if (register-unaligned FRintk 4) | |
9601 | (c-call VOID "@cpu@_media_register_not_aligned") | |
9602 | (if cond | |
9603 | (sequence () | |
9604 | (set (halfword hi FRintk 0) (ubyte 3 FRintj 0)) | |
9605 | (set (halfword lo FRintk 0) (ubyte 3 FRintj 0)) | |
9606 | (set (halfword hi FRintk 1) (ubyte 2 FRintj 0)) | |
9607 | (set (halfword lo FRintk 1) (ubyte 2 FRintj 0)) | |
9608 | (set (halfword hi FRintk 2) (ubyte 1 FRintj 0)) | |
9609 | (set (halfword lo FRintk 2) (ubyte 1 FRintj 0)) | |
9610 | (set (halfword hi FRintk 3) (ubyte 0 FRintj 0)) | |
9611 | (set (halfword lo FRintk 3) (ubyte 0 FRintj 0))))) | |
9612 | ) | |
9613 | ||
9614 | (dni mbtohe | |
9615 | "Media convert byte to halfword extended" | |
9616 | ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv)) | |
9617 | "mbtohe$pack $FRintj,$FRintk" | |
9618 | (+ pack FRintk OP_7B (FRi-null) OPE1_3A FRintj) | |
9619 | (sequence () | |
9620 | ; hack to get these referenced for profiling | |
9621 | (set FRintj (c-raw-call SI "frv_ref_SI" FRintj)) | |
9622 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
9623 | (mbtohe-semantics 1)) | |
9624 | ((fr500 (unit u-media-dual-btohe))) | |
9625 | ) | |
9626 | ||
9627 | (dni cmbtohe | |
9628 | "Conditional media convert byte to halfword extended" | |
9629 | ((UNIT FM01) (FR500-MAJOR M-7) CONDITIONAL (MACH simple,tomcat,frv)) | |
9630 | "cmbtohe$pack $FRintj,$FRintk,$CCi,$cond" | |
9631 | (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_2 FRintj) | |
9632 | (sequence () | |
9633 | ; hack to get these referenced for profiling | |
9634 | (set FRintj (c-raw-call SI "frv_ref_SI" FRintj)) | |
9635 | (set FRintk (c-raw-call SI "frv_ref_SI" FRintk)) | |
9636 | (mbtohe-semantics (eq CCi (or cond 2)))) | |
9637 | ((fr500 (unit u-media-dual-btohe))) | |
9638 | ) | |
9639 | ||
8caa9169 DB |
9640 | ; Media NOP |
9641 | ; A special case of mclracc | |
9642 | (dni mnop "Media nop" | |
676a64f4 RS |
9643 | ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-1) |
9644 | (FR400-MAJOR M-1) (FR450-MAJOR M-1)) | |
8caa9169 DB |
9645 | "mnop$pack" |
9646 | (+ pack (f-ACC40Sk 63) OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null)) | |
9647 | (nop) | |
9648 | () | |
9649 | ) | |
9650 | ||
9651 | ; mclracc with #A==0 | |
9652 | (dni mclracc-0 | |
9653 | "Media clear accumulator(s)" | |
676a64f4 RS |
9654 | ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3) |
9655 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
8caa9169 DB |
9656 | "mclracc$pack $ACC40Sk,$A0" |
9657 | (+ pack ACC40Sk OP_7B (f-A 0) (misc-null-10) OPE1_3B (FRj-null)) | |
9658 | (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 0) | |
676a64f4 | 9659 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4)) |
ac7c07ac | 9660 | (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc))) |
8caa9169 DB |
9661 | ) |
9662 | ||
9663 | ; mclracc with #A==1 | |
9664 | (dni mclracc-1 | |
9aab5aa3 | 9665 | "Media clear accumulator(s)" |
676a64f4 RS |
9666 | ((UNIT MCLRACC-1) (FR500-MAJOR M-6) (FR550-MAJOR M-3) |
9667 | (FR400-MAJOR M-2) (FR450-MAJOR M-4)) | |
8caa9169 DB |
9668 | "mclracc$pack $ACC40Sk,$A1" |
9669 | (+ pack ACC40Sk OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null)) | |
9670 | (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 1) | |
676a64f4 | 9671 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4-mclracca)) |
ac7c07ac | 9672 | (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc))) |
9aab5aa3 AC |
9673 | ) |
9674 | ||
9675 | (dni mrdacc | |
9676 | "Media read accumulator" | |
676a64f4 RS |
9677 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9678 | (FR400-MAJOR M-1) (FR450-MAJOR M-5)) | |
9aab5aa3 AC |
9679 | "mrdacc$pack $ACC40Si,$FRintk" |
9680 | (+ pack FRintk OP_7B ACC40Si OPE1_3C (FRj-null)) | |
9681 | (set FRintk ACC40Si) | |
676a64f4 | 9682 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4)) |
ac7c07ac | 9683 | (fr500 (unit u-media)) (fr550 (unit u-media-3-acc))) |
9aab5aa3 AC |
9684 | ) |
9685 | ||
9686 | (dni mrdaccg | |
9687 | "Media read accumulator guard" | |
676a64f4 RS |
9688 | ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3) |
9689 | (FR400-MAJOR M-1) (FR450-MAJOR M-5)) | |
9aab5aa3 AC |
9690 | "mrdaccg$pack $ACCGi,$FRintk" |
9691 | (+ pack FRintk OP_7B ACCGi OPE1_3E (FRj-null)) | |
9692 | (set FRintk ACCGi) | |
676a64f4 | 9693 | ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg)) |
ac7c07ac | 9694 | (fr500 (unit u-media)) (fr550 (unit u-media-3-acc (in ACC40Si ACCGi)))) |
9aab5aa3 AC |
9695 | ) |
9696 | ||
9697 | (dni mwtacc | |
9698 | "Media write accumulator" | |
676a64f4 RS |
9699 | ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3) |
9700 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
9701 | "mwtacc$pack $FRinti,$ACC40Sk" |
9702 | (+ pack ACC40Sk OP_7B FRinti OPE1_3D (FRj-null)) | |
9703 | (set ACC40Sk (or (and ACC40Sk (const DI #xffffffff00000000)) | |
9704 | FRinti)) | |
676a64f4 | 9705 | ((fr400 (unit u-media-4)) (fr450 (unit u-media-4)) |
ac7c07ac | 9706 | (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc))) |
9aab5aa3 AC |
9707 | ) |
9708 | ||
9709 | (dni mwtaccg | |
9710 | "Media write accumulator guard" | |
676a64f4 RS |
9711 | ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3) |
9712 | (FR400-MAJOR M-1) (FR450-MAJOR M-3)) | |
9aab5aa3 AC |
9713 | "mwtaccg$pack $FRinti,$ACCGk" |
9714 | (+ pack ACCGk OP_7B FRinti OPE1_3F (FRj-null)) | |
d0312406 DB |
9715 | (sequence () |
9716 | ; hack to get these referenced for profiling | |
9717 | (c-raw-call VOID "frv_ref_SI" ACCGk) | |
9718 | (set ACCGk FRinti)) | |
676a64f4 | 9719 | ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg)) |
ac7c07ac | 9720 | (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc (in ACC40Sk ACCGk)))) |
9aab5aa3 AC |
9721 | ) |
9722 | ||
9723 | (define-pmacro (media-cop num op) | |
9724 | (dni (.sym mcop num) | |
9725 | "Media custom instruction" | |
9726 | ((UNIT FM01) (FR500-MAJOR M-1) (MACH frv)) | |
9727 | (.str "mcop" num "$pack $FRi,$FRj,$FRk") | |
9728 | (+ pack FRk op FRi OPE1_00 FRj) | |
9729 | (c-call VOID "@cpu@_media_cop" num) | |
9730 | () | |
9731 | ) | |
9732 | ) | |
9733 | ||
9734 | (media-cop 1 OP_7C) | |
9735 | (media-cop 2 OP_7D) | |
9736 | ||
9737 | ; nop | |
9738 | ; A nop is defined to be a "ori gr0,0,gr0" | |
9739 | ; This needn't be a macro-insn, but making it one greatly simplifies decode.c | |
9740 | ; On the other hand spending a little time in the decoder is often worth it. | |
9741 | ; | |
9742 | (dnmi nop "nop" | |
676a64f4 | 9743 | ((UNIT IALL) (FR500-MAJOR I-1) (FR400-MAJOR I-1) (FR450-MAJOR I-1)) |
9aab5aa3 AC |
9744 | "nop$pack" |
9745 | (emit ori pack (GRi 0) (s12 0) (GRk 0)) | |
9746 | ) | |
9747 | ||
9748 | ; Floating point NOP | |
9749 | (dni fnop | |
9750 | "Floating point nop" | |
ac7c07ac | 9751 | ((UNIT FMALL) (FR500-MAJOR F-8) (FR550-MAJOR F-1) (MACH simple,tomcat,fr500,fr550,frv)) |
9aab5aa3 AC |
9752 | "fnop$pack" |
9753 | (+ pack (rd-null) OP_79 (FRi-null) OPE1_0D (FRj-null)) | |
9754 | (nop) | |
9755 | () | |
9756 | ) | |
9757 | ||
9aab5aa3 AC |
9758 | ; A return instruction |
9759 | (dnmi ret "return" | |
676a64f4 RS |
9760 | (NO-DIS (UNIT B01) (FR500-MAJOR B-3) |
9761 | (FR400-MAJOR B-3) (FR450-MAJOR B-3)) | |
9aab5aa3 AC |
9762 | "ret$pack" |
9763 | (emit bralr pack (hint_taken 2)) | |
9764 | ) | |
9765 | ||
9766 | (dnmi cmp "compare" | |
676a64f4 RS |
9767 | (NO-DIS (UNIT IALL) (FR500-MAJOR I-1) |
9768 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
9769 | "cmp$pack $GRi,$GRj,$ICCi_1" |
9770 | (emit subcc pack GRi GRj (GRk 0) ICCi_1) | |
9771 | ) | |
9772 | ||
9773 | (dnmi cmpi "compare immediate" | |
676a64f4 RS |
9774 | (NO-DIS (UNIT IALL) (FR500-MAJOR I-1) |
9775 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
9776 | "cmpi$pack $GRi,$s10,$ICCi_1" |
9777 | (emit subicc pack GRi s10 (GRk 0) ICCi_1) | |
9778 | ) | |
9779 | ||
9780 | (dnmi ccmp "conditional compare" | |
676a64f4 RS |
9781 | (NO-DIS (UNIT IALL) (FR500-MAJOR I-1) |
9782 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
9783 | "ccmp$pack $GRi,$GRj,$CCi,$cond" |
9784 | (emit csubcc pack GRi GRj (GRk 0) CCi cond) | |
9785 | ) | |
9786 | ||
9787 | (dnmi mov "move" | |
676a64f4 RS |
9788 | (NO-DIS (UNIT IALL) (FR500-MAJOR I-1) |
9789 | (FR400-MAJOR I-1) (FR450-MAJOR I-1)) | |
9aab5aa3 AC |
9790 | "mov$pack $GRi,$GRk" |
9791 | (emit ori pack GRi (s12 0) GRk) | |
9792 | ) | |
9793 | ||
9794 | (dnmi cmov "conditional move" | |
676a64f4 RS |
9795 | (NO-DIS (UNIT IALL) (FR500-MAJOR I-1) |
9796 | (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL) | |
9aab5aa3 AC |
9797 | "cmov$pack $GRi,$GRk,$CCi,$cond" |
9798 | (emit cor pack GRi (GRj 0) GRk CCi cond) | |
9799 | ) |