1 ; Fujitsu FRV opcode support, for GNU Binutils. -*- Scheme -*-
3 ; Copyright 2000, 2001, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
5 ; Contributed by Red Hat Inc; developed under contract from Fujitsu.
7 ; This file is part of the GNU Binutils.
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
11 ; the Free Software Foundation; either version 3 of the License, or
12 ; (at your option) any later version.
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.
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
21 ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24 (include "simplify.inc")
26 ; define-arch must appear first
29 (name frv) ; name of cpu architecture
30 (comment "Fujitsu FRV")
32 (machs frv fr550 fr500 fr450 fr400 tomcat simple)
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.
42 (parallel-insns 8) ; The frv executes up to 8 insns at a time.
45 ; Cpu family definitions.
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.
52 (comment "Fujitsu FRV base family")
57 ; Generic FR-V machine. Supports the entire architecture
60 (comment "Generic FRV cpu")
64 (name frv) (comment "Generic FRV model") (attrs)
67 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
69 ; `state' is a list of variables for recording model state
72 (unit u-exec "Execution Unit" ()
77 () ; profile action (default)
88 (name fr550) (comment "FR550 model") (attrs)
91 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
93 ; `state' is a list of variables for recording model state
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
108 ; Basic unit for instructions with no latency penalties
109 (unit u-exec "Execution Unit" ()
114 () ; profile action (default)
116 ; Basic integer insn unit
117 (unit u-integer "Integer Unit" ()
120 ((GRi INT -1) (GRj INT -1)) ; inputs
121 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
122 () ; profile action (default)
124 ; Integer multiplication unit
125 (unit u-imul "Integer Multiplication Unit" ()
128 ((GRi INT -1) (GRj INT -1)) ; inputs
129 ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
130 () ; profile action (default)
132 ; Integer division unit
133 (unit u-idiv "Integer Division Unit" ()
136 ((GRi INT -1) (GRj INT -1)) ; inputs
137 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
138 () ; profile action (default)
141 (unit u-branch "Branch Unit" ()
144 ((GRi INT -1) (GRj INT -1)
145 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
147 () ; profile action (default)
150 (unit u-trap "Trap Unit" ()
153 ((GRi INT -1) (GRj INT -1)
154 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
156 () ; profile action (default)
158 ; Condition code check unit
159 (unit u-check "Check Unit" ()
162 ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
164 () ; profile action (default)
166 ; Float Arithmetic unit
167 (unit u-float-arith "Float Arithmetic unit" ()
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)
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
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)
186 (unit u-float-div "Float Div unit" ()
189 ((FRi INT -1) (FRj INT -1)) ; inputs
190 ((FRk INT -1)) ; outputs
191 () ; profile action (default)
193 ; Float Square Root unit
194 (unit u-float-sqrt "Float Square Root unit" ()
197 ((FRj INT -1) (FRdoublej INT -1)) ; inputs
198 ((FRk INT -1) (FRdoublek INT -1)) ; outputs
199 () ; profile action (default)
202 (unit u-float-compare "Float Compare unit" ()
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)
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
215 ((FRi INT -1) (FRj INT -1)) ; inputs
216 ((FCCi_2 INT -1)) ; outputs
217 () ; profile action (default)
220 (unit u-fr2gr "FR Move to GR Unit" ()
223 ((FRintk INT -1)) ; inputs
224 ((GRj INT -1)) ; outputs
225 () ; profile action (default)
228 (unit u-gr2fr "GR Move to FR Unit" ()
231 ((GRj INT -1)) ; inputs
232 ((FRintk INT -1)) ; outputs
233 () ; profile action (default)
235 ; SPR Move to GR unit
236 (unit u-spr2gr "SPR Move to GR Unit" ()
239 ((spr INT -1)) ; inputs
240 ((GRj INT -1)) ; outputs
241 () ; profile action (default)
243 ; GR Move to SPR unit
244 (unit u-gr2spr "GR Move to SPR Unit" ()
247 ((GRj INT -1)) ; inputs
248 ((spr INT -1)) ; outputs
249 () ; profile action (default)
252 (unit u-set-hilo "GR Set Half" ()
256 ((GRkhi INT -1) (GRklo INT -1)) ; outputs
257 () ; profile action (default)
260 (unit u-gr-load "GR Load Unit" ()
263 ((GRi INT -1) (GRj INT -1)) ; inputs
264 ((GRk INT -1) (GRdoublek INT -1)) ; outputs
265 () ; profile action (default)
268 (unit u-gr-store "GR Store Unit" ()
271 ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
273 () ; profile action (default)
276 (unit u-fr-load "FR Load Unit" ()
279 ((GRi INT -1) (GRj INT -1)) ; inputs
280 ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
281 () ; profile action (default)
284 (unit u-fr-store "FR Store Unit" ()
287 ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
289 () ; profile action (default)
292 (unit u-swap "Swap Unit" ()
295 ((GRi INT -1) (GRj INT -1)) ; inputs
296 ((GRk INT -1)) ; outputs
297 () ; profile action (default)
300 (unit u-fr2fr "FR Move to FR Unit" ()
303 ((FRi INT -1)) ; inputs
304 ((FRk INT -1)) ; outputs
305 () ; profile action (default)
308 (unit u-clrgr "Clrgr Unit" ()
311 ((GRk INT -1)) ; inputs
313 () ; profile action (default)
316 (unit u-clrfr "Clrfr Unit" ()
319 ((FRk INT -1)) ; inputs
321 () ; profile action (default)
323 ; Insn cache invalidate unit
324 (unit u-ici "Insn cache invalidate unit" ()
327 ((GRi INT -1) (GRj INT -1)) ; inputs
329 () ; profile action (default)
331 ; Data cache invalidate unit
332 (unit u-dci "Data cache invalidate unit" ()
335 ((GRi INT -1) (GRj INT -1)) ; inputs
337 () ; profile action (default)
339 ; Data cache flush unit
340 (unit u-dcf "Data cache flush unit" ()
343 ((GRi INT -1) (GRj INT -1)) ; inputs
345 () ; profile action (default)
347 ; Insn cache preload unit
348 (unit u-icpl "Insn cache preload unit" ()
351 ((GRi INT -1) (GRj INT -1)) ; inputs
353 () ; profile action (default)
355 ; Data cache preload unit
356 (unit u-dcpl "Data cache preload unit" ()
359 ((GRi INT -1) (GRj INT -1)) ; inputs
361 () ; profile action (default)
363 ; Insn cache unlock unit
364 (unit u-icul "Insn cache unlock unit" ()
367 ((GRi INT -1) (GRj INT -1)) ; inputs
369 () ; profile action (default)
371 ; Data cache unlock unit
372 (unit u-dcul "Data cache unlock unit" ()
375 ((GRi INT -1) (GRj INT -1)) ; inputs
377 () ; profile action (default)
380 (unit u-commit "Commit Unit" ()
383 ((GRk INT -1) (FRk INT -1)) ; inputs
385 () ; profile action (default)
387 ; Float Conversion unit
388 (unit u-float-convert "Float Conversion unit" ()
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)
396 (unit u-media "Media unit" ()
399 ((FRinti INT -1) (FRintj INT -1)) ; inputs
400 ((FRintk INT -1)) ; outputs
401 () ; profile action (default)
403 (unit u-media-quad "Media-quad unit" ()
406 ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
407 ((FRintkeven INT -1)) ; outputs
408 () ; profile action (default)
410 (unit u-media-dual-expand "Media Dual Expand unit" ()
413 ((FRinti INT -1)) ; inputs
414 ((FRintkeven INT -1)) ; outputs
415 () ; profile action (default)
417 (unit u-media-3-dual "Media-3-dual unit" ()
420 ((FRinti INT -1)) ; inputs
421 ((FRintk INT -1)) ; outputs
422 () ; profile action (default)
424 (unit u-media-3-acc "Media unit for M-3 using ACC" ()
427 ((FRintj INT -1) (ACC40Si INT -1)) ; inputs
428 ((FRintk INT -1)) ; outputs
429 () ; profile action (default)
431 (unit u-media-3-acc-dual "Media-3-acc-dual unit" ()
434 ((ACC40Si INT -1)) ; inputs
435 ((FRintkeven INT -1)) ; outputs
436 () ; profile action (default)
438 (unit u-media-3-wtacc "Media-3-wtacc unit" ()
441 ((FRinti INT -1) (ACC40Sk INT -1)) ; inputs
443 () ; profile action (default)
445 (unit u-media-3-mclracc "Media-3-mclracc unit" ()
450 () ; profile action (default)
452 (unit u-media-set "Media set" ()
456 ((FRintk INT -1)) ; outputs
457 () ; profile action (default)
459 (unit u-media-4 "Media-4 unit" ()
462 ((FRinti INT -1) (FRintj INT -1)) ; inputs
463 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
464 () ; profile action (default)
466 (unit u-media-4-acc "Media-4-acc unit" ()
469 ((ACC40Si INT -1)) ; inputs
470 ((ACC40Sk INT -1)) ; outputs
471 () ; profile action (default)
473 (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
476 ((ACC40Si INT -1)) ; inputs
477 ((ACC40Sk INT -1)) ; outputs
478 () ; profile action (default)
480 (unit u-media-4-add-sub "Media-4-add-sub unit" ()
483 ((ACC40Si INT -1)) ; inputs
484 ((ACC40Sk INT -1)) ; outputs
485 () ; profile action (default)
487 (unit u-media-4-add-sub-dual "Media-4-add-sub-dual unit" ()
490 ((ACC40Si INT -1)) ; inputs
491 ((ACC40Sk INT -1)) ; outputs
492 () ; profile action (default)
494 (unit u-media-4-quad "Media-4-quad unit" ()
497 ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
498 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
499 () ; profile action (default)
506 (comment "FR500 cpu")
510 (name fr500) (comment "FR500 model") (attrs)
513 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
515 ; `state' is a list of variables for recording model state
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
526 ; Basic unit for instructions with no latency penalties
527 (unit u-exec "Execution Unit" ()
532 () ; profile action (default)
534 ; Basic integer insn unit
535 (unit u-integer "Integer Unit" ()
538 ((GRi INT -1) (GRj INT -1)) ; inputs
539 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
540 () ; profile action (default)
542 ; Integer multiplication unit
543 (unit u-imul "Integer Multiplication Unit" ()
546 ((GRi INT -1) (GRj INT -1)) ; inputs
547 ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
548 () ; profile action (default)
550 ; Integer division unit
551 (unit u-idiv "Integer Division Unit" ()
554 ((GRi INT -1) (GRj INT -1)) ; inputs
555 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
556 () ; profile action (default)
559 (unit u-branch "Branch Unit" ()
562 ((GRi INT -1) (GRj INT -1)
563 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
565 () ; profile action (default)
568 (unit u-trap "Trap Unit" ()
571 ((GRi INT -1) (GRj INT -1)
572 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
574 () ; profile action (default)
576 ; Condition code check unit
577 (unit u-check "Check Unit" ()
580 ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
582 () ; profile action (default)
585 (unit u-clrgr "Clrgr Unit" ()
588 ((GRk INT -1)) ; inputs
590 () ; profile action (default)
593 (unit u-clrfr "Clrfr Unit" ()
596 ((FRk INT -1)) ; inputs
598 () ; profile action (default)
601 (unit u-set-hilo "GR Set Half" ()
605 ((GRkhi INT -1) (GRklo INT -1)) ; outputs
606 () ; profile action (default)
608 ; GR load unit -- TODO doesn't handle quad
609 (unit u-gr-load "GR Load Unit" ()
612 ((GRi INT -1) (GRj INT -1)) ; inputs
613 ((GRk INT -1) (GRdoublek INT -1)) ; outputs
614 () ; profile action (default)
616 ; GR store unit -- TODO doesn't handle quad
617 (unit u-gr-store "GR Store Unit" ()
620 ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
622 () ; profile action (default)
624 ; GR recovering store unit -- TODO doesn't handle quad
625 (unit u-gr-r-store "GR Recovering Store Unit" ()
628 ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
630 () ; profile action (default)
632 ; FR load unit -- TODO doesn't handle quad
633 (unit u-fr-load "FR Load Unit" ()
636 ((GRi INT -1) (GRj INT -1)) ; inputs
637 ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
638 () ; profile action (default)
640 ; FR store unit -- TODO doesn't handle quad
641 (unit u-fr-store "FR Store Unit" ()
644 ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
646 () ; profile action (default)
648 ; FR recovering store unit -- TODO doesn't handle quad
649 (unit u-fr-r-store "FR Recovering Store Unit" ()
652 ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
654 () ; profile action (default)
657 (unit u-swap "Swap Unit" ()
660 ((GRi INT -1) (GRj INT -1)) ; inputs
661 ((GRk INT -1)) ; outputs
662 () ; profile action (default)
665 (unit u-fr2fr "FR Move to FR Unit" ()
668 ((FRi INT -1)) ; inputs
669 ((FRk INT -1)) ; outputs
670 () ; profile action (default)
673 (unit u-fr2gr "FR Move to GR Unit" ()
676 ((FRintk INT -1)) ; inputs
677 ((GRj INT -1)) ; outputs
678 () ; profile action (default)
680 ; SPR Move to GR unit
681 (unit u-spr2gr "SPR Move to GR Unit" ()
684 ((spr INT -1)) ; inputs
685 ((GRj INT -1)) ; outputs
686 () ; profile action (default)
689 (unit u-gr2fr "GR Move to FR Unit" ()
692 ((GRj INT -1)) ; inputs
693 ((FRintk INT -1)) ; outputs
694 () ; profile action (default)
696 ; GR Move to SPR unit
697 (unit u-gr2spr "GR Move to SPR Unit" ()
700 ((GRj INT -1)) ; inputs
701 ((spr INT -1)) ; outputs
702 () ; profile action (default)
704 ; Float Arithmetic unit
705 (unit u-float-arith "Float Arithmetic unit" ()
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)
713 ; Float Dual Arithmetic unit
714 (unit u-float-dual-arith "Float Arithmetic unit" ()
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)
723 (unit u-float-div "Float Div unit" ()
726 ((FRi INT -1) (FRj INT -1)) ; inputs
727 ((FRk INT -1)) ; outputs
728 () ; profile action (default)
730 ; Float Square Root unit
731 (unit u-float-sqrt "Float Square Root unit" ()
734 ((FRj INT -1) (FRdoublej INT -1)) ; inputs
735 ((FRk INT -1) (FRdoublek INT -1)) ; outputs
736 () ; profile action (default)
738 ; Float Dual Square Root unit
739 (unit u-float-dual-sqrt "Float Dual Square Root unit" ()
742 ((FRj INT -1)) ; inputs
743 ((FRk INT -1)) ; outputs
744 () ; profile action (default)
747 (unit u-float-compare "Float Compare unit" ()
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)
755 ; Dual Float Compare unit
756 (unit u-float-dual-compare "Float Dual Compare unit" ()
759 ((FRi INT -1) (FRj INT -1)) ; inputs
760 ((FCCi_2 INT -1)) ; outputs
761 () ; profile action (default)
763 ; Float Conversion unit
764 (unit u-float-convert "Float Conversion unit" ()
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)
771 ; Dual Float Conversion unit
772 (unit u-float-dual-convert "Float Dual Conversion unit" ()
775 ((FRj INT -1) (FRintj INT -1)) ; inputs
776 ((FRk INT -1) (FRintk INT -1)) ; outputs
777 () ; profile action (default)
780 (unit u-media "Media unit" ()
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)
787 ; Media Quad Arithmetic unit
788 (unit u-media-quad-arith "Media Quad Arithmetic unit" ()
791 ((FRinti INT -1) (FRintj INT -1)) ; inputs
792 ((FRintk INT -1)) ; outputs
793 () ; profile action (default)
795 ; Media Dual Multiplication unit
796 (unit u-media-dual-mul "Media Dual Multiplication unit" ()
799 ((FRinti INT -1) (FRintj INT -1)) ; inputs
800 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
801 () ; profile action (default)
803 ; Media Quad Multiplication unit
804 (unit u-media-quad-mul "Media Quad Multiplication unit" ()
807 ((FRinti INT -1) (FRintj INT -1)) ; inputs
808 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
809 () ; profile action (default)
811 ; Media Quad Complex unit
812 (unit u-media-quad-complex "Media Quad Complex unit" ()
815 ((FRinti INT -1) (FRintj INT -1)) ; inputs
816 ((ACC40Sk INT -1)) ; outputs
817 () ; profile action (default)
819 ; Media Dual Expand unit
820 (unit u-media-dual-expand "Media Dual Expand unit" ()
823 ((FRinti INT -1)) ; inputs
824 ((FRintk INT -1)) ; outputs
825 () ; profile action (default)
827 ; Media Dual Unpack unit
828 (unit u-media-dual-unpack "Media Dual Unpack unit" ()
831 ((FRinti INT -1)) ; inputs
832 ((FRintk INT -1)) ; outputs
833 () ; profile action (default)
835 ; Media Dual byte to half unit
836 (unit u-media-dual-btoh "Media Byte to byte" ()
839 ((FRintj INT -1)) ; inputs
840 ((FRintk INT -1)) ; outputs
841 () ; profile action (default)
843 ; Media Dual half to byte unit
844 (unit u-media-dual-htob "Media Half to byte" ()
847 ((FRintj INT -1)) ; inputs
848 ((FRintk INT -1)) ; outputs
849 () ; profile action (default)
851 ; Media Dual byte to half unit extended
852 (unit u-media-dual-btohe "Media Byte to byte extended" ()
855 ((FRintj INT -1)) ; inputs
856 ((FRintk INT -1)) ; outputs
857 () ; profile action (default)
860 (unit u-barrier "Barrier unit" ()
865 () ; profile action (default)
867 ; Memory Barrier unit
868 (unit u-membar "Memory Barrier unit" ()
873 () ; profile action (default)
875 ; Insn cache invalidate unit
876 (unit u-ici "Insn cache invalidate unit" ()
879 ((GRi INT -1) (GRj INT -1)) ; inputs
881 () ; profile action (default)
883 ; Data cache invalidate unit
884 (unit u-dci "Data cache invalidate unit" ()
887 ((GRi INT -1) (GRj INT -1)) ; inputs
889 () ; profile action (default)
891 ; Data cache flush unit
892 (unit u-dcf "Data cache flush unit" ()
895 ((GRi INT -1) (GRj INT -1)) ; inputs
897 () ; profile action (default)
899 ; Insn cache preload unit
900 (unit u-icpl "Insn cache preload unit" ()
903 ((GRi INT -1) (GRj INT -1)) ; inputs
905 () ; profile action (default)
907 ; Data cache preload unit
908 (unit u-dcpl "Data cache preload unit" ()
911 ((GRi INT -1) (GRj INT -1)) ; inputs
913 () ; profile action (default)
915 ; Insn cache unlock unit
916 (unit u-icul "Insn cache unlock unit" ()
919 ((GRi INT -1) (GRj INT -1)) ; inputs
921 () ; profile action (default)
923 ; Data cache unlock unit
924 (unit u-dcul "Data cache unlock unit" ()
927 ((GRi INT -1) (GRj INT -1)) ; inputs
929 () ; profile action (default)
932 (unit u-commit "Commit Unit" ()
935 ((GRk INT -1) (FRk INT -1)) ; inputs
937 () ; profile action (default)
941 ; Tomcat machine. Early version of fr500 machine
944 (comment "Tomcat -- early version of fr500")
948 (name tomcat) (comment "Tomcat model") (attrs)
951 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
953 ; `state' is a list of variables for recording model state
956 (unit u-exec "Execution Unit" ()
961 () ; profile action (default)
968 (comment "FR400 cpu")
972 (name fr400) (comment "FR400 model") (attrs)
974 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
975 ; `state' is a list of variables for recording model state
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
990 (unit u-exec "Execution Unit" ()
995 () ; profile action (default)
997 ; Basic integer insn unit
998 (unit u-integer "Integer Unit" ()
1001 ((GRi INT -1) (GRj INT -1)) ; inputs
1002 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1003 () ; profile action (default)
1005 ; Integer multiplication unit
1006 (unit u-imul "Integer Multiplication Unit" ()
1009 ((GRi INT -1) (GRj INT -1)) ; inputs
1010 ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
1011 () ; profile action (default)
1013 ; Integer division unit
1014 (unit u-idiv "Integer Division Unit" ()
1017 ((GRi INT -1) (GRj INT -1)) ; inputs
1018 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1019 () ; profile action (default)
1022 (unit u-branch "Branch Unit" ()
1025 ((GRi INT -1) (GRj INT -1)
1026 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1028 () ; profile action (default)
1031 (unit u-trap "Trap Unit" ()
1034 ((GRi INT -1) (GRj INT -1)
1035 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1037 () ; profile action (default)
1039 ; Condition code check unit
1040 (unit u-check "Check Unit" ()
1043 ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
1045 () ; profile action (default)
1048 (unit u-set-hilo "GR Set Half" ()
1052 ((GRkhi INT -1) (GRklo INT -1)) ; outputs
1053 () ; profile action (default)
1055 ; GR load unit -- TODO doesn't handle quad
1056 (unit u-gr-load "GR Load Unit" ()
1059 ((GRi INT -1) (GRj INT -1)) ; inputs
1060 ((GRk INT -1) (GRdoublek INT -1)) ; outputs
1061 () ; profile action (default)
1063 ; GR store unit -- TODO doesn't handle quad
1064 (unit u-gr-store "GR Store Unit" ()
1067 ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
1069 () ; profile action (default)
1071 ; FR load unit -- TODO doesn't handle quad
1072 (unit u-fr-load "FR Load Unit" ()
1075 ((GRi INT -1) (GRj INT -1)) ; inputs
1076 ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
1077 () ; profile action (default)
1079 ; FR store unit -- TODO doesn't handle quad
1080 (unit u-fr-store "FR Store Unit" ()
1083 ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
1085 () ; profile action (default)
1088 (unit u-swap "Swap Unit" ()
1091 ((GRi INT -1) (GRj INT -1)) ; inputs
1092 ((GRk INT -1)) ; outputs
1093 () ; profile action (default)
1095 ; FR Move to GR unit
1096 (unit u-fr2gr "FR Move to GR Unit" ()
1099 ((FRintk INT -1)) ; inputs
1100 ((GRj INT -1)) ; outputs
1101 () ; profile action (default)
1103 ; SPR Move to GR unit
1104 (unit u-spr2gr "SPR Move to GR Unit" ()
1107 ((spr INT -1)) ; inputs
1108 ((GRj INT -1)) ; outputs
1109 () ; profile action (default)
1111 ; GR Move to FR unit
1112 (unit u-gr2fr "GR Move to FR Unit" ()
1115 ((GRj INT -1)) ; inputs
1116 ((FRintk INT -1)) ; outputs
1117 () ; profile action (default)
1119 ; GR Move to SPR unit
1120 (unit u-gr2spr "GR Move to SPR Unit" ()
1123 ((GRj INT -1)) ; inputs
1124 ((spr INT -1)) ; outputs
1125 () ; profile action (default)
1127 ; Media unit M1 -- see table 13-8 in the fr400 LSI
1128 (unit u-media-1 "Media-1 unit" ()
1131 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1132 ((FRintk INT -1)) ; outputs
1133 () ; profile action (default)
1135 (unit u-media-1-quad "Media-1-quad unit" ()
1138 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1139 ((FRintk INT -1)) ; outputs
1140 () ; profile action (default)
1142 (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
1146 ((FRkhi INT -1) (FRklo INT -1)) ; outputs
1147 () ; profile action (default)
1149 ; Media unit M2 -- see table 13-8 in the fr400 LSI
1150 (unit u-media-2 "Media-2 unit" ()
1153 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1154 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1155 () ; profile action (default)
1157 (unit u-media-2-quad "Media-2-quad unit" ()
1160 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1161 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1162 () ; profile action (default)
1164 (unit u-media-2-acc "Media-2-acc unit" ()
1167 ((ACC40Si INT -1)) ; inputs
1168 ((ACC40Sk INT -1)) ; outputs
1169 () ; profile action (default)
1171 (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
1174 ((ACC40Si INT -1)) ; inputs
1175 ((ACC40Sk INT -1)) ; outputs
1176 () ; profile action (default)
1178 (unit u-media-2-add-sub "Media-2-add-sub unit" ()
1181 ((ACC40Si INT -1)) ; inputs
1182 ((ACC40Sk INT -1)) ; outputs
1183 () ; profile action (default)
1185 (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
1188 ((ACC40Si INT -1)) ; inputs
1189 ((ACC40Sk INT -1)) ; outputs
1190 () ; profile action (default)
1192 ; Media unit M3 -- see table 13-8 in the fr400 LSI
1193 (unit u-media-3 "Media-3 unit" ()
1196 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1197 ((FRintk INT -1)) ; outputs
1198 () ; profile action (default)
1200 (unit u-media-3-dual "Media-3-dual unit" ()
1203 ((FRinti INT -1)) ; inputs
1204 ((FRintk INT -1)) ; outputs
1205 () ; profile action (default)
1207 (unit u-media-3-quad "Media-3-quad unit" ()
1210 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1211 ((FRintk INT -1)) ; outputs
1212 () ; profile action (default)
1214 ; Media unit M4 -- see table 13-8 in the fr400 LSI
1215 (unit u-media-4 "Media-4 unit" ()
1218 ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
1219 ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
1220 () ; profile action (default)
1222 (unit u-media-4-accg "Media-4-accg unit" ()
1225 ((ACCGi INT -1) (FRinti INT -1)) ; inputs
1226 ((ACCGk INT -1) (FRintk INT -1)) ; outputs
1227 () ; profile action (default)
1229 (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
1232 ((ACC40Si INT -1)) ; inputs
1233 ((FRintk INT -1)) ; outputs
1234 () ; profile action (default)
1236 ; Media unit M6 -- see table 13-8 in the fr400 LSI
1237 (unit u-media-6 "Media-6 unit" ()
1240 ((FRinti INT -1)) ; inputs
1241 ((FRintk INT -1)) ; outputs
1242 () ; profile action (default)
1244 ; Media unit M7 -- see table 13-8 in the fr400 LSI
1245 (unit u-media-7 "Media-1 unit" ()
1248 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1249 ((FCCk INT -1)) ; outputs
1250 () ; profile action (default)
1252 ; Media Dual Expand unit
1253 (unit u-media-dual-expand "Media Dual Expand unit" ()
1256 ((FRinti INT -1)) ; inputs
1257 ((FRintk INT -1)) ; outputs
1258 () ; profile action (default)
1260 ; Media Dual half to byte unit
1261 (unit u-media-dual-htob "Media Half to byte" ()
1264 ((FRintj INT -1)) ; inputs
1265 ((FRintk INT -1)) ; outputs
1266 () ; profile action (default)
1269 (unit u-barrier "Barrier unit" ()
1274 () ; profile action (default)
1276 ; Memory Barrier unit
1277 (unit u-membar "Memory Barrier unit" ()
1282 () ; profile action (default)
1284 ; Insn cache invalidate unit
1285 (unit u-ici "Insn cache invalidate unit" ()
1288 ((GRi INT -1) (GRj INT -1)) ; inputs
1290 () ; profile action (default)
1292 ; Data cache invalidate unit
1293 (unit u-dci "Data cache invalidate unit" ()
1296 ((GRi INT -1) (GRj INT -1)) ; inputs
1298 () ; profile action (default)
1300 ; Data cache flush unit
1301 (unit u-dcf "Data cache flush unit" ()
1304 ((GRi INT -1) (GRj INT -1)) ; inputs
1306 () ; profile action (default)
1308 ; Insn cache preload unit
1309 (unit u-icpl "Insn cache preload unit" ()
1312 ((GRi INT -1) (GRj INT -1)) ; inputs
1314 () ; profile action (default)
1316 ; Data cache preload unit
1317 (unit u-dcpl "Data cache preload unit" ()
1320 ((GRi INT -1) (GRj INT -1)) ; inputs
1322 () ; profile action (default)
1324 ; Insn cache unlock unit
1325 (unit u-icul "Insn cache unlock unit" ()
1328 ((GRi INT -1) (GRj INT -1)) ; inputs
1330 () ; profile action (default)
1332 ; Data cache unlock unit
1333 (unit u-dcul "Data cache unlock unit" ()
1336 ((GRi INT -1) (GRj INT -1)) ; inputs
1338 () ; profile action (default)
1345 (comment "FR450 cpu")
1349 (name fr450) (comment "FR450 model") (attrs)
1351 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
1352 ; `state' is a list of variables for recording model state
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
1367 (unit u-exec "Execution Unit" ()
1372 () ; profile action (default)
1374 ; Basic integer insn unit
1375 (unit u-integer "Integer Unit" ()
1378 ((GRi INT -1) (GRj INT -1)) ; inputs
1379 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1380 () ; profile action (default)
1382 ; Integer multiplication unit
1383 (unit u-imul "Integer Multiplication Unit" ()
1386 ((GRi INT -1) (GRj INT -1)) ; inputs
1387 ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
1388 () ; profile action (default)
1390 ; Integer division unit
1391 (unit u-idiv "Integer Division Unit" ()
1394 ((GRi INT -1) (GRj INT -1)) ; inputs
1395 ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1396 () ; profile action (default)
1399 (unit u-branch "Branch Unit" ()
1402 ((GRi INT -1) (GRj INT -1)
1403 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1405 () ; profile action (default)
1408 (unit u-trap "Trap Unit" ()
1411 ((GRi INT -1) (GRj INT -1)
1412 (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1414 () ; profile action (default)
1416 ; Condition code check unit
1417 (unit u-check "Check Unit" ()
1420 ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
1422 () ; profile action (default)
1425 (unit u-set-hilo "GR Set Half" ()
1429 ((GRkhi INT -1) (GRklo INT -1)) ; outputs
1430 () ; profile action (default)
1432 ; GR load unit -- TODO doesn't handle quad
1433 (unit u-gr-load "GR Load Unit" ()
1436 ((GRi INT -1) (GRj INT -1)) ; inputs
1437 ((GRk INT -1) (GRdoublek INT -1)) ; outputs
1438 () ; profile action (default)
1440 ; GR store unit -- TODO doesn't handle quad
1441 (unit u-gr-store "GR Store Unit" ()
1444 ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
1446 () ; profile action (default)
1448 ; FR load unit -- TODO doesn't handle quad
1449 (unit u-fr-load "FR Load Unit" ()
1452 ((GRi INT -1) (GRj INT -1)) ; inputs
1453 ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
1454 () ; profile action (default)
1456 ; FR store unit -- TODO doesn't handle quad
1457 (unit u-fr-store "FR Store Unit" ()
1460 ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
1462 () ; profile action (default)
1465 (unit u-swap "Swap Unit" ()
1468 ((GRi INT -1) (GRj INT -1)) ; inputs
1469 ((GRk INT -1)) ; outputs
1470 () ; profile action (default)
1472 ; FR Move to GR unit
1473 (unit u-fr2gr "FR Move to GR Unit" ()
1476 ((FRintk INT -1)) ; inputs
1477 ((GRj INT -1)) ; outputs
1478 () ; profile action (default)
1480 ; SPR Move to GR unit
1481 (unit u-spr2gr "SPR Move to GR Unit" ()
1484 ((spr INT -1)) ; inputs
1485 ((GRj INT -1)) ; outputs
1486 () ; profile action (default)
1488 ; GR Move to FR unit
1489 (unit u-gr2fr "GR Move to FR Unit" ()
1492 ((GRj INT -1)) ; inputs
1493 ((FRintk INT -1)) ; outputs
1494 () ; profile action (default)
1496 ; GR Move to SPR unit
1497 (unit u-gr2spr "GR Move to SPR Unit" ()
1500 ((GRj INT -1)) ; inputs
1501 ((spr INT -1)) ; outputs
1502 () ; profile action (default)
1504 ; Media unit M1 -- see table 14-8 in the fr450 LSI
1505 (unit u-media-1 "Media-1 unit" ()
1508 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1509 ((FRintk INT -1)) ; outputs
1510 () ; profile action (default)
1512 (unit u-media-1-quad "Media-1-quad unit" ()
1515 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1516 ((FRintk INT -1)) ; outputs
1517 () ; profile action (default)
1519 (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
1523 ((FRkhi INT -1) (FRklo INT -1)) ; outputs
1524 () ; profile action (default)
1526 ; Media unit M2 -- see table 14-8 in the fr450 LSI
1527 (unit u-media-2 "Media-2 unit" ()
1530 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1531 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1532 () ; profile action (default)
1534 (unit u-media-2-quad "Media-2-quad unit" ()
1537 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1538 ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1539 () ; profile action (default)
1541 (unit u-media-2-acc "Media-2-acc unit" ()
1544 ((ACC40Si INT -1)) ; inputs
1545 ((ACC40Sk INT -1)) ; outputs
1546 () ; profile action (default)
1548 (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
1551 ((ACC40Si INT -1)) ; inputs
1552 ((ACC40Sk INT -1)) ; outputs
1553 () ; profile action (default)
1555 (unit u-media-2-add-sub "Media-2-add-sub unit" ()
1558 ((ACC40Si INT -1)) ; inputs
1559 ((ACC40Sk INT -1)) ; outputs
1560 () ; profile action (default)
1562 (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
1565 ((ACC40Si INT -1)) ; inputs
1566 ((ACC40Sk INT -1)) ; outputs
1567 () ; profile action (default)
1569 ; Media unit M3 -- see table 14-8 in the fr450 LSI
1570 (unit u-media-3 "Media-3 unit" ()
1573 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1574 ((FRintk INT -1)) ; outputs
1575 () ; profile action (default)
1577 (unit u-media-3-dual "Media-3-dual unit" ()
1580 ((FRinti INT -1)) ; inputs
1581 ((FRintk INT -1)) ; outputs
1582 () ; profile action (default)
1584 (unit u-media-3-quad "Media-3-quad unit" ()
1587 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1588 ((FRintk INT -1)) ; outputs
1589 () ; profile action (default)
1591 ; Media unit M4 -- see table 14-8 in the fr450 LSI
1592 (unit u-media-4 "Media-4 unit" ()
1595 ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
1596 ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
1597 () ; profile action (default)
1599 (unit u-media-4-accg "Media-4-accg unit" ()
1602 ((ACCGi INT -1) (FRinti INT -1)) ; inputs
1603 ((ACCGk INT -1) (FRintk INT -1)) ; outputs
1604 () ; profile action (default)
1606 (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
1609 ((ACC40Si INT -1)) ; inputs
1610 ((FRintk INT -1)) ; outputs
1611 () ; profile action (default)
1613 (unit u-media-4-mclracca "Media-4 unit for MCLRACC with #A=1" ()
1618 () ; profile action (default)
1620 ; Media unit M6 -- see table 14-8 in the fr450 LSI
1621 (unit u-media-6 "Media-6 unit" ()
1624 ((FRinti INT -1)) ; inputs
1625 ((FRintk INT -1)) ; outputs
1626 () ; profile action (default)
1628 ; Media unit M7 -- see table 14-8 in the fr450 LSI
1629 (unit u-media-7 "Media-1 unit" ()
1632 ((FRinti INT -1) (FRintj INT -1)) ; inputs
1633 ((FCCk INT -1)) ; outputs
1634 () ; profile action (default)
1636 ; Media Dual Expand unit
1637 (unit u-media-dual-expand "Media Dual Expand unit" ()
1640 ((FRinti INT -1)) ; inputs
1641 ((FRintk INT -1)) ; outputs
1642 () ; profile action (default)
1644 ; Media Dual half to byte unit
1645 (unit u-media-dual-htob "Media Half to byte" ()
1648 ((FRintj INT -1)) ; inputs
1649 ((FRintk INT -1)) ; outputs
1650 () ; profile action (default)
1653 (unit u-barrier "Barrier unit" ()
1658 () ; profile action (default)
1660 ; Memory Barrier unit
1661 (unit u-membar "Memory Barrier unit" ()
1666 () ; profile action (default)
1668 ; Insn cache invalidate unit
1669 (unit u-ici "Insn cache invalidate unit" ()
1672 ((GRi INT -1) (GRj INT -1)) ; inputs
1674 () ; profile action (default)
1676 ; Data cache invalidate unit
1677 (unit u-dci "Data cache invalidate unit" ()
1680 ((GRi INT -1) (GRj INT -1)) ; inputs
1682 () ; profile action (default)
1684 ; Data cache flush unit
1685 (unit u-dcf "Data cache flush unit" ()
1688 ((GRi INT -1) (GRj INT -1)) ; inputs
1690 () ; profile action (default)
1692 ; Insn cache preload unit
1693 (unit u-icpl "Insn cache preload unit" ()
1696 ((GRi INT -1) (GRj INT -1)) ; inputs
1698 () ; profile action (default)
1700 ; Data cache preload unit
1701 (unit u-dcpl "Data cache preload unit" ()
1704 ((GRi INT -1) (GRj INT -1)) ; inputs
1706 () ; profile action (default)
1708 ; Insn cache unlock unit
1709 (unit u-icul "Insn cache unlock unit" ()
1712 ((GRi INT -1) (GRj INT -1)) ; inputs
1714 () ; profile action (default)
1716 ; Data cache unlock unit
1717 (unit u-dcul "Data cache unlock unit" ()
1720 ((GRi INT -1) (GRj INT -1)) ; inputs
1722 () ; profile action (default)
1726 ; Simple machine - single issue integer machine
1729 (comment "Simple single issue integer cpu")
1733 (name simple) (comment "Simple model") (attrs)
1735 (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
1736 ; `state' is a list of variables for recording model state
1738 (unit u-exec "Execution Unit" ()
1743 () ; profile action (default)
1747 ; The instruction fetch/execute cycle.
1749 ; This is how to fetch and decode an instruction.
1750 ; Leave it out for now
1752 ; (define-extract (const SI 0))
1754 ; This is how to execute a decoded instruction.
1755 ; Leave it out for now
1757 ; (define-execute (const SI 0))
1759 ; An attribute to describe which unit an insn runs in.
1764 (comment "parallel execution pipeline selection")
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.
1771 I0 I1 I01 I2 I3 IALL
1772 FM0 FM1 FM01 FM2 FM3 FMALL FMLOW
1775 MULT-DIV ; multiply/division slotted differently on different machines
1776 IACC ; iacc multiply slotted differently on different machines
1777 LOAD ; loads slotted differently on different machines
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
1782 MDCUTSSI ; mdcutssi insn slotted differently on different machines
1783 MCLRACC-1; mclracc A==1 slotted differently on different machines
1787 ; Attributes to describe major categories of insns
1792 (comment "fr400 major insn categories")
1793 ; The order of declaration is significant. Keep variations on the same major
1797 B-1 B-2 B-3 B-4 B-5 B-6
1806 (comment "fr450 major insn categories")
1807 ; The order of declaration is significant. Keep variations on the same major
1811 B-1 B-2 B-3 B-4 B-5 B-6
1813 M-1 M-2 M-3 M-4 M-5 M-6
1820 (comment "fr500 major insn categories")
1821 ; The order of declaration is significant. Keep variations on the same major
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
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
1835 (comment "fr550 major insn categories")
1836 ; The order of declaration is significant. Keep variations on the same major
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
1851 (comment "insn only allowed in supervisor mode")
1853 ; Non-Excepting insn
1857 (name NON-EXCEPTING)
1858 (comment "non-excepting insn")
1865 (comment "conditional insn")
1867 ; insn accesses FR registers
1872 (comment "insn accesses FR registers")
1874 ; insn preserves MSR.OVF
1879 (comment "Preserve value of MSR.OVF")
1881 ; "Audio" instruction provided by the fr405 but not the original fr400 core.
1886 (comment "Audio instruction added with FR405")
1888 ; null attribute -- used as a place holder for where an attribue is required.
1893 (comment "placeholder attribute")
1894 (attrs META) ; do not define in any generated file for now
1897 ; IDOC attribute for instruction documentation.
1903 (comment "insn kind for documentation")
1910 (PRIV - () "Priviledged")
1911 (MISC - () "Miscellaneous")
1915 ; Instruction fields.
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)
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)
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)
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)
1940 (dnf f-ACCGi "source register" () 17 6)
1941 (dnf f-ACCGk "destination register" () 30 6)
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)
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)
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))
1957 (dnf f-CRj_float "target cr for fck insns" () 26 2)
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)
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)
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
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))
1986 (sequence () ; extract
1987 (set (ifield f-u12) (or (mul (ifield f-u12-h) 64)
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)
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
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)))
2011 (sequence () ; extract
2012 (set (ifield f-spr) (or (sll (ifield f-spr-h) (const 6))
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 (mul WI value (const 4)) pc))
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)
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))
2036 (set (ifield f-label24)
2037 (add (mul (or (mul (ifield f-labelH6) (sll 1 18))
2038 (ifield f-labelL18))
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)
2047 (dnf f-TLBPRopx "TLB Probe operation number" () 28 3)
2048 (dnf f-TLBPRL "TLB Probe L flag" () 25 1)
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)
2080 (dnf f-LRA-null "null field" (RESERVED) 2 3)
2081 (dnf f-TLBPR-null "null field" (RESERVED) 30 2)
2083 (dnf f-LI-off "null field" (RESERVED) 25 1)
2084 (dnf f-LI-on "null field" (RESERVED) 25 1)
2086 ; Relocation annotations.
2087 (dsh h-reloc-ann "relocation annotation" () (register BI))
2088 (dnf f-reloc-ann "relocation annotation" () 0 0)
2090 (define-pmacro (dann xname xcomment xmode xparse xprint)
2097 (handlers (parse xparse) (print xprint))
2105 ; FIXME: should use die macro or some such
2106 (define-normal-insn-enum insn-op "insn op enums" () OP_ f-op
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"
2119 (define-normal-insn-enum insn-ope1 "insn ope enums" () OPE1_ f-ope1
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"
2128 (define-normal-insn-enum insn-ope2 "insn ope enums" () OPE2_ f-ope2
2130 "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
2134 (define-normal-insn-enum insn-ope3 "insn ope enums" () OPE3_ f-ope3
2136 "00" "01" "02" "03" "04" "05" "06" "07"
2140 (define-normal-insn-enum insn-ope4 "insn ope enums" () OPE4_ f-ope4
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
2150 "nev" "c" "v" "lt" "eq" "ls" "n" "le"
2151 "ra" "nc" "nv" "ge" "ne" "hi" "p" "gt"
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")
2163 ; These entries list the elements of the raw hardware.
2164 ; They're also used to provide tables and other elements of the assembly
2166 (dnh h-pc "program counter" (PC PROFILE) (pc) () () ())
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.
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))
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
2190 (comment "PSR.S bit")
2194 (set (newval) (c-call VOID "@cpu@_h_psr_s_set_handler" newval))
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.
2201 (dsh h-tbr_tba "TBR.TBA" () (register UWI))
2202 (dsh h-tbr_tt "TBR.TT" () (register UQI))
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.
2208 (dsh h-bpsr_bs "PSR.S bit" () (register BI))
2209 (dsh h-bpsr_bet "PSR.ET bit" () (register BI))
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)
2232 (comment "general registers")
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))
2240 ; General Registers as double words
2241 ; These registers are shadowed onto h-gr
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)
2250 (c-call DI "@cpu@_h_gr_double_get_handler" index))
2252 (c-call VOID "@cpu@_h_gr_double_set_handler" index newval))
2255 ; General Registers as high and low half words
2256 ; These registers are shadowed onto h-gr
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))
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))
2276 ; Floating Point Registers
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)
2295 (comment "floating point registers")
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))
2303 ; Floating Point Registers as double precision
2304 ; These registers are shadowed onto h-fr
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)
2314 (c-call DF "@cpu@_h_fr_double_get_handler" index))
2316 (c-call VOID "@cpu@_h_fr_double_set_handler" index newval))
2319 ; Floating Point Registers as integer words.
2320 ; These registers are shadowed onto h-fr
2324 (comment "floating point registers as integers")
2325 (attrs PROFILE VIRTUAL)
2326 (type register USI (64))
2327 (indices extern-keyword fr-names)
2329 (c-call USI "@cpu@_h_fr_int_get_handler" index))
2331 (c-call VOID "@cpu@_h_fr_int_set_handler" index newval))
2334 ; Floating Point Registers as high and low half words
2335 ; These registers are shadowed onto h-fr
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)
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))))
2359 ; Floating Point Registers as unsigned bytes
2360 ; These registers are shadowed onto h-fr
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))
2370 (if (gt USI newval #xff)
2372 (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffffff00)
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))
2384 (if (gt USI newval #xff)
2386 (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffff00ff)
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))
2398 (if (gt USI newval #xff)
2400 (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xff00ffff)
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))
2412 (if (gt USI newval #xff)
2414 (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #x00ffffff)
2417 ; Coprocessor Registers
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)
2437 (comment "coprocessor registers")
2438 (attrs PROFILE (MACH frv))
2439 (type register WI (64))
2440 (indices extern-keyword cpr-names)
2443 ; Coprocessor Registers as double words
2444 ; These registers are shadowed onto h-cpr
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)
2453 (c-call DI "@cpu@_h_cpr_double_get_handler" index))
2455 (c-call VOID "@cpu@_h_cpr_double_set_handler" index newval))
2458 ; Special Purpose Registers
2465 (psr 0) (pcsr 1) (bpcsr 2) (tbr 3) (bpsr 4)
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)
2484 (ccr 256) (cccr 263) (lr 272) (lcr 273) (iacc0h 280) (iacc0l 281) (isr 288)
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)
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)
2506 (gner0 432) (gner1 433)
2508 (fner0 434) (fner1 435)
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)
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)
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)
2553 (esfr0 672) (esfr1 673)
2555 (sr0 768) (sr1 769) (sr2 770) (sr3 771)
2557 (scr0 832) (scr1 833) (scr2 834) (scr3 835)
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)
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)
2606 (mcilr0 1272) (mcilr1 1273)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
2792 (amcr 1920) (stbar 1921) (mmcr 1922)
2793 (iamvr1 1925) (damvr1 1927)
2794 (cxnr 1936) (ttbr 1937) (tplr 1938) (tppr 1939)
2796 (timerh 1952) (timerl 1953) (timerd 1954)
2797 (dcr 2048) (brr 2049) (nmar 2050) (btbr 2051)
2799 (ibar0 2052) (ibar1 2053) (ibar2 2054) (ibar3 2055)
2800 (dbar0 2056) (dbar1 2057) (dbar2 2058) (dbar3 2059)
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)
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)
2812 (cpcfr 2304) (cpcr 2305) (cpsr 2306) (cptr 2307)
2813 (cphsr0 2308) (cphsr1 2309) (cpesr0 2320) (cpesr1 2321)
2814 (cpemr0 2322) (cpemr1 2323)
2816 (iperr0 2324) (iperr1 2325) (ipjsr 2326) (ipjrr 2327)
2817 (ipcsr0 2336) (ipcsr1 2337) (ipcwer0 2338) (ipcwer1 2339)
2820 (mbhsr 2352) (mbssr 2353) (mbrsr 2354) (mbsdr 2355)
2821 (mbrdr 2356) (mbsmr 2357) (mbstr0 2359) (mbstr1 2360)
2823 (slpr 2368) (sldr 2369) (slhsr 2370) (sltr 2371)
2826 (ihsr8 3848) (ihsr9 3849) (ihsr10 3850)
2832 (comment "special purpose registers")
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))
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))
2844 (define-pmacro (spr-iacc0h) (reg h-spr 280))
2845 (define-pmacro (spr-iacc0l) (reg h-spr 281))
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))
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).
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)
2880 (comment "accumulator guard")
2881 (attrs PROFILE VIRTUAL)
2882 (type register UWI (64))
2883 (indices extern-keyword accg-names)
2885 (and (reg h-spr (add index 1472)) #xff))
2887 (set (raw-reg UWI h-spr (add index 1472)) (and newval #xff)))
2890 ; 40 bit accumulator. Composed of ACCG and ACC registers concatenated, but
2891 ; referenced more often as the composed 40 bits.
2894 (print-name h-acc40)
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)
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
2918 (sll DI (ext DI (trunc QI (reg h-spr (add index 1472))))
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
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))))
2934 (comment "40 bit unsigned accumulator")
2935 (attrs PROFILE VIRTUAL)
2936 (type register DI (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
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
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))))
2954 ; 64-bit signed accumulator. Composed of iacc0h and iacc0l registers
2955 ; concatenated, but referenced more often as the composed 64 bits.
2957 ; This is totally hokey -- I have to have an index!
2959 (print-name h-iacc0)
2966 (comment "64 bit signed accumulator")
2967 (attrs PROFILE VIRTUAL (MACH fr400,fr450))
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))))
2976 (set (spr-iacc0h) (trunc SI (srl newval 32)))
2977 (set (spr-iacc0l) (trunc SI newval))))
2980 ; Integer condition code registers (CCR)
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.
2990 (values (icc0 0) (icc1 1) (icc2 2) (icc3 3))
2995 (comment "Integer condition code registers")
2997 (type register UQI (4))
2998 (indices extern-keyword iccr-names)
3001 ; Floating point condition code registers (CCR)
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.
3011 (values (fcc0 0) (fcc1 1) (fcc2 2) (fcc3 3))
3016 (comment "Floating point condition code registers")
3018 (type register UQI (4))
3019 (indices extern-keyword fccr-names)
3022 ; C condition code registers (CCCR)
3028 (values (cc0 0) (cc1 1) (cc2 2) (cc3 3) (cc4 4) (cc5 5) (cc6 6) (cc7 7))
3033 (comment "Condition code registers")
3035 (type register UQI (8))
3036 (indices extern-keyword cccr-names)
3039 ; Dummy hardware used to define packing bit on insns
3043 (comment "Packing bit dummy hardware")
3044 (type immediate (UINT 1))
3045 (values keyword "" (("" 1) (".p" 0) (".P" 0)))
3047 ; Dummy hardware used to define hint field for branches always 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
3056 (values keyword "" (("" 2) ("" 0) ("" 1) ("" 3)))
3058 ; Dummy hardware used to define hint field for branches never taken
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
3067 (values keyword "" (("" 0) ("" 1) ("" 2) ("" 3)))
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.
3076 ; FRV specific operand attributes:
3082 (comment "immediates have an optional '#' prefix")
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.
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)
3097 (.splice attrs (.unsplice xattrs))
3104 ; dnpmop: define-normal-parsed-mode-operand: Normal mode operand with parse handler
3105 (define-pmacro (dnpmop xname xcomment xattrs xtype xindex xmode xparse)
3109 (.splice attrs (.unsplice xattrs))
3113 (handlers (parse xparse))
3117 (dnop pack "packing bit" () h-pack f-pack)
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)
3124 (dnpmop GRdoublek "destination register" () h-gr_double f-GRk DI "even_register")
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)
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)
3135 (dnpmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI "even_register")
3137 ; floating point operands
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)
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)
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")
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)
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)
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)
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)
3182 (dnop ae "all entries indicator" (HASH-PREFIX) h-uint f-ae)
3184 (dnop label16 "18 bit pc relative address" () h-iaddr f-label16)
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)
3190 (dnop TLBPRopx "TLB Probe operation number" () h-uint f-TLBPRopx)
3191 (dnop TLBPRL "TLB Probe L flag" () h-uint f-TLBPRL)
3195 (comment "A==0 operand of mclracc")
3200 (handlers (parse "A0"))
3205 (comment "A==1 operand of mclracc")
3210 (handlers (parse "A1"))
3215 (comment "(even) source register 1")
3220 (handlers (parse "even_register"))
3225 (comment "(even) source register 2")
3230 (handlers (parse "even_register"))
3235 (comment "(even) target register")
3240 (handlers (parse "even_register"))
3245 (comment "12 bit signed immediate")
3249 (handlers (parse "d12"))
3254 (comment "12 bit signed immediate")
3258 (handlers (parse "s12"))
3263 (comment "12 bit signed immediate")
3267 (handlers (parse "u12"))
3272 (comment "special purpose register")
3276 (handlers (parse "spr") (print "spr"))
3281 (comment "16 bit unsigned immediate, for #lo()")
3285 (handlers (parse "ulo16") (print "lo"))
3290 (comment "16 bit unsigned immediate, for #lo()")
3294 (handlers (parse "uslo16") (print "lo"))
3299 (comment "16 bit unsigned immediate, for #hi()")
3303 (handlers (parse "uhi16") (print "hi"))
3308 (comment "26 bit pc relative address")
3313 (handlers (parse "call_label"))
3316 ; operands representing hardware
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)
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)
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)
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))
3361 (define-pmacro (LRA-null) (f-LRA-null 0))
3362 (define-pmacro (TLBPR-null) (f-TLBPR-null 0))
3364 (define-pmacro (LI-on) (f-LI-on 1))
3365 (define-pmacro (LI-off) (f-LI-off 0))
3367 ; Instruction definitions.
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
3375 ; Commonly used Macros
3377 ; Specific registers
3380 ; Integer condition code manipulation
3382 (define-pmacro (set-z-and-n icc x)
3384 (set icc (or (and icc #x7) #x4))
3386 (set icc (or (and icc #xb) #x8))
3387 (set icc (and icc #x3))))
3390 (define-pmacro (set-n icc val)
3392 (set icc (and icc #x7))
3393 (set icc (or icc #x8)))
3396 (define-pmacro (set-z icc val)
3398 (set icc (and icc #xb))
3399 (set icc (or icc #x4)))
3402 (define-pmacro (set-v icc val)
3404 (set icc (and icc #xd))
3405 (set icc (or icc #x2)))
3408 (define-pmacro (set-c icc val)
3410 (set icc (and icc #xe))
3411 (set icc (or icc #x1)))
3414 (define-pmacro (nbit icc)
3415 (trunc BI (srl (and icc #x8) 3))
3418 (define-pmacro (zbit icc)
3419 (trunc BI (srl (and icc #x4) 2))
3422 (define-pmacro (vbit icc)
3423 (trunc BI (srl (and icc #x2) 1))
3426 (define-pmacro (cbit icc)
3427 (trunc BI (and icc #x1))
3430 (define-pmacro (ebit icc)
3431 (trunc BI (srl (and icc #x8) 3))
3434 (define-pmacro (lbit icc)
3435 (trunc BI (srl (and icc #x4) 2))
3438 (define-pmacro (gbit icc)
3439 (trunc BI (srl (and icc #x2) 1))
3442 (define-pmacro (ubit icc)
3443 (trunc BI (and icc #x1))
3449 ; Format: INT, Logic, Shift r-r
3451 (define-pmacro (int-logic-r-r name operation op ope comment)
3454 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3455 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3456 (.str name "$pack $GRi,$GRj,$GRk")
3457 (+ pack GRk op GRi (ICCi_1-null) ope GRj)
3458 (set GRk (operation GRi GRj))
3459 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3460 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3472 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3473 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3474 ("not$pack $GRj,$GRk")
3475 (+ pack GRk OP_01 (rs-null) (ICCi_1-null) OPE2_06 GRj)
3477 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3478 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3483 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3484 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3485 "sdiv$pack $GRi,$GRj,$GRk"
3486 (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0E GRj)
3488 (c-call VOID "@cpu@_signed_integer_divide"
3489 GRi GRj (index-of GRk) 0)
3491 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3492 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3496 "non excepting signed division"
3497 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
3498 (MACH simple,tomcat,fr500,fr550,frv))
3499 "nsdiv$pack $GRi,$GRj,$GRk"
3500 (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0E GRj)
3502 (c-call VOID "@cpu@_signed_integer_divide"
3503 GRi GRj (index-of GRk) 1)
3505 ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3509 "unsigned division reg/reg"
3510 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3511 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3512 "udiv$pack $GRi,$GRj,$GRk"
3513 (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0F GRj)
3515 (c-call VOID "@cpu@_unsigned_integer_divide"
3516 GRi GRj (index-of GRk) 0)
3518 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3519 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3523 "non excepting unsigned division"
3524 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
3525 (MACH simple,tomcat,fr500,fr550,frv))
3526 "nudiv$pack $GRi,$GRj,$GRk"
3527 (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0F GRj)
3529 (c-call VOID "@cpu@_unsigned_integer_divide"
3530 GRi GRj (index-of GRk) 1)
3532 ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3537 (define-pmacro (multiply-r-r name signop op ope comment)
3540 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3541 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)))
3545 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3546 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
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")
3553 ; Multiplication with integer accumulator IACC
3556 (define-pmacro (iacc-set value)
3557 (set (reg h-iacc0 0) value))
3559 (define-pmacro (iacc-add value)
3560 (set (reg h-iacc0 0)
3562 ((andif (andif (gt value 0) (gt (reg h-iacc0 0) 0))
3563 (lt (sub DI #x7fffffffffffffff value) (reg h-iacc0 0)))
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)))
3569 (const DI #x8000000000000000))
3571 (add DI (reg h-iacc0 0) value))))
3574 (define-pmacro (iacc-sub value)
3575 (set (reg h-iacc0 0)
3577 ((andif (andif (lt value 0) (gt (reg h-iacc0 0) 0))
3578 (lt (add DI #x7fffffffffffffff value) (reg h-iacc0 0)))
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)))
3584 (const DI #x8000000000000000))
3586 (sub DI (reg h-iacc0 0) value))))
3589 (define-pmacro (iacc-multiply-r-r name operation op ope comment)
3592 ((UNIT IACC) (MACH fr400,fr450)
3593 (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
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)))
3597 ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
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")
3605 (define-pmacro (int-shift-r-r name op ope comment)
3608 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3609 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)))
3613 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3614 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3623 "shift left arith reg/reg with saturation"
3624 ((UNIT IALL) (MACH fr400,fr450)
3625 (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
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))
3633 "Integer accumulator cut with saturation"
3634 ((UNIT I0) (MACH fr400,fr450)
3635 (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
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))
3642 (define-pmacro (scan-semantics arg1 arg2 targ)
3643 (sequence ((WI tmp1) (WI tmp2))
3645 (set tmp2 (sra arg2 1))
3646 (set targ (c-call WI "@cpu@_scan_result" (xor tmp1 tmp2))))
3651 ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3652 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3653 "scan$pack $GRi,$GRj,$GRk"
3654 (+ pack GRk OP_0B GRi (ICCi_1-null) OPE2_00 GRj)
3655 (scan-semantics GRi GRj GRk)
3656 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3657 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3660 ; Format: conditional INT, Logic, Shift r-r
3662 (define-pmacro (conditional-int-logic name operation op ope comment)
3665 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3666 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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)))
3671 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3672 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3684 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3685 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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)))
3690 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3691 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3695 "conditional signed multiply"
3696 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3697 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3702 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3703 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3707 "conditional signed division"
3708 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3709 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))
3714 (c-call VOID "@cpu@_signed_integer_divide"
3715 GRi GRj (index-of GRk) 0)
3717 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3718 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3722 "conditional unsigned division"
3723 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3724 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))
3729 (c-call VOID "@cpu@_unsigned_integer_divide"
3730 GRi GRj (index-of GRk) 0)
3732 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3733 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3736 (define-pmacro (conditional-shift name operation op ope comment)
3739 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3740 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3745 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3746 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3756 ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3757 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))
3762 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3763 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3766 ; Format: INT, Logic, Shift, cc r-r
3768 (define-pmacro (int-arith-cc-semantics operation icc)
3769 (sequence ((BI tmp) (QI cc) (SI result))
3771 (set tmp ((.sym operation -oflag) GRi GRj (const 0)))
3773 (set tmp ((.sym operation -cflag) GRi GRj (const 0)))
3775 (set result (operation GRi GRj))
3776 (set-z-and-n cc result)
3781 (define-pmacro (int-arith-cc-r-r name operation op ope comment)
3784 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3785 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
3789 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3790 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3797 (define-pmacro (int-logic-cc-semantics op icc)
3798 (sequence ((SI tmp))
3799 (set tmp (op GRi GRj))
3801 (set-z-and-n icc tmp))
3804 (define-pmacro (int-logic-cc-r-r name op ope comment)
3807 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3808 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
3812 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3813 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
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)
3826 (set tmp (op GRi shift))
3828 (set-z-and-n cc tmp)
3832 (define-pmacro (int-shift-cc-r-r name l-r op ope comment)
3835 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3836 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
3840 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3841 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3849 (define-pmacro (multiply-cc-semantics signop arg1 arg2 targ icc)
3850 (sequence ((DI tmp) (QI cc))
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))
3859 (define-pmacro (multiply-cc-r-r name signop op ope comment)
3862 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3863 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
3867 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3868 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
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")
3876 ; Format: conditional INT, Logic, Shift, cc r-r
3878 (define-pmacro (conditional-int-arith-cc name operation op ope comment)
3881 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3882 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3888 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3889 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3897 "conditional signed multiply and set condition code"
3898 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3899 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3905 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3906 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3909 (define-pmacro (conditional-int-logic-cc name operation op ope comment)
3912 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3913 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3919 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3920 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3928 (define-pmacro (conditional-int-shift-cc name l-r op ope comment)
3929 (dni (.sym c name cc)
3931 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3932 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
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))))
3938 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3939 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3947 ; Add and subtract with carry
3949 (define-pmacro (int-arith-x-r-r name operation op ope comment)
3952 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3953 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)))
3957 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3958 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3965 (define-pmacro (int-arith-x-cc-r-r name operation op ope comment)
3968 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3969 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3970 (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
3971 (+ pack GRk op GRi ICCi_1 ope GRj)
3972 (sequence ((WI tmp) (QI cc))
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)
3980 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3981 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
3987 ; Add and subtract with saturation
3989 (define-pmacro (int-arith-ss-r-r name operation op ope comment)
3992 ((UNIT IALL) (MACH fr400,fr450)
3993 (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
3994 (.str name "$pack $GRi,$GRj,$GRk")
3995 (+ pack GRk op GRi ope GRj)
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.
4004 ((gt GRi 0) (const #x7fffffff))
4005 ((lt GRi 0) (const #x80000000))
4008 ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
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")
4015 ; Format: INT, Logic, Shift r-simm
4017 (define-pmacro (int-logic-r-simm name operation op comment)
4020 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4021 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4022 (.str name "$pack $GRi,$s12,$GRk")
4023 (+ pack GRk op GRi s12)
4024 (set GRk (operation GRi s12))
4025 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4026 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4037 "signed division reg/immed"
4038 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4039 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4040 "sdivi$pack $GRi,$s12,$GRk"
4041 (+ pack GRk OP_1E GRi s12)
4043 (c-call VOID "@cpu@_signed_integer_divide"
4044 GRi s12 (index-of GRk) 0)
4046 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
4047 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4051 "non excepting signed division reg/immed"
4052 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
4053 (MACH simple,tomcat,fr500,fr550,frv))
4054 "nsdivi$pack $GRi,$s12,$GRk"
4055 (+ pack GRk OP_2E GRi s12)
4057 (c-call VOID "@cpu@_signed_integer_divide"
4058 GRi s12 (index-of GRk) 1)
4060 ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4064 "unsigned division reg/immed"
4065 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4066 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4067 "udivi$pack $GRi,$s12,$GRk"
4068 (+ pack GRk OP_1F GRi s12)
4070 (c-call VOID "@cpu@_unsigned_integer_divide"
4071 GRi s12 (index-of GRk) 0)
4073 ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
4074 (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4078 "non excepting unsigned division reg/immed"
4079 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
4080 (MACH simple,tomcat,fr500,fr550,frv))
4081 "nudivi$pack $GRi,$s12,$GRk"
4082 (+ pack GRk OP_2F GRi s12)
4084 (c-call VOID "@cpu@_unsigned_integer_divide"
4085 GRi s12 (index-of GRk) 1)
4087 ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4090 (define-pmacro (multiply-r-simm name signop op comment)
4093 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4094 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4095 (.str name "$pack $GRi,$s12,$GRdoublek")
4096 (+ pack GRdoublek op GRi s12)
4097 (set GRdoublek (mul DI (signop DI GRi) (signop DI s12)))
4098 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
4099 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
4103 (multiply-r-simm smuli ext OP_18 "signed multiply reg/immed")
4104 (multiply-r-simm umuli zext OP_1A "unsigned multiply reg/immed")
4106 (define-pmacro (int-shift-r-simm name op comment)
4109 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4110 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4111 (.str (.sym name i) "$pack $GRi,$s12,$GRk")
4112 (+ pack GRk op GRi s12)
4113 (set GRk (name GRi (and s12 #x1f)))
4114 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4115 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4125 ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4126 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4127 "scani$pack $GRi,$s12,$GRk"
4128 (+ pack GRk OP_47 GRi s12)
4129 (scan-semantics GRi s12 GRk)
4130 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4131 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4134 ; Format: INT, Logic, Shift cc r-simm
4136 (define-pmacro (int-arith-cc-r-simm name operation op comment)
4139 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4140 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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))
4145 (set tmp ((.sym operation -oflag) GRi s10 (const 0)))
4147 (set tmp ((.sym operation -cflag) GRi s10 (const 0)))
4149 (set result (operation GRi s10))
4150 (set-z-and-n cc result)
4153 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4154 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4161 (define-pmacro (int-logic-cc-r-simm name op comment)
4162 (dni (.sym name icc)
4164 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4165 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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))
4171 (set-z-and-n ICCi_1 tmp))
4172 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4173 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4181 (define-pmacro (multiply-cc-r-simm name signop op comment)
4184 ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4185 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
4189 ((fr400 (unit u-imul)) (fr450 (unit u-imul))
4190 (fr500 (unit u-imul)) (fr550 (unit u-imul)))
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")
4197 (define-pmacro (int-shift-cc-r-simm name l-r op comment)
4198 (dni (.sym name icc)
4200 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4201 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)
4208 (set tmp (name GRi shift))
4210 (set-z-and-n cc tmp)
4212 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4213 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4221 (define-pmacro (int-arith-x-r-simm name operation op comment)
4224 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4225 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
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)))
4229 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4230 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4237 (define-pmacro (int-arith-x-cc-r-simm name operation op comment)
4240 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4241 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4242 (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
4243 (+ pack GRk op GRi ICCi_1 s10)
4244 (sequence ((WI tmp) (QI cc))
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)
4252 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4253 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
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")
4260 ; Byte compare insns
4264 ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
4265 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4266 "cmpb$pack $GRi,$GRj,$ICCi_1"
4267 (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0C GRj)
4270 (set-n cc (eq (and GRi #xff000000) (and GRj #xff000000)))
4271 (set-z cc (eq (and GRi #x00ff0000) (and GRj #x00ff0000)))
4272 (set-v cc (eq (and GRi #x0000ff00) (and GRj #x0000ff00)))
4273 (set-c cc (eq (and GRi #x000000ff) (and GRj #x000000ff)))
4275 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4276 (fr550 (unit u-integer)))
4280 "OR of Compare bytes"
4281 ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
4282 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4283 "cmpba$pack $GRi,$GRj,$ICCi_1"
4284 (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0D GRj)
4288 (orif (eq (and GRi #xff000000) (and GRj #xff000000))
4289 (orif (eq (and GRi #x00ff0000) (and GRj #x00ff0000))
4290 (orif (eq (and GRi #x0000ff00)
4291 (and GRj #x0000ff00))
4292 (eq (and GRi #x000000ff)
4293 (and GRj #x000000ff))))))
4295 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4296 (fr550 (unit u-integer)))
4299 ; Format: Load immediate
4302 "set low order bits"
4303 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4304 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4305 "setlo$pack $ulo16,$GRklo"
4306 (+ pack GRk OP_3D (misc-null-4) u16)
4308 ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
4309 (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
4313 "set high order bits"
4314 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4315 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4316 "sethi$pack $uhi16,$GRkhi"
4317 (+ pack GRkhi OP_3E (misc-null-4) u16)
4319 ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
4320 (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
4324 "set low order bits and extend sign"
4325 ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4326 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4327 "setlos$pack $slo16,$GRk"
4328 (+ pack GRk OP_3F (misc-null-4) s16)
4330 ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4331 (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4334 (define-pmacro (load-gr-r name mode op ope comment ann)
4337 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4338 (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4339 (.str name "$pack " ann "($GRi,$GRj),$GRk")
4340 (+ pack GRk op GRi ope GRj)
4341 (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4342 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4343 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4347 (dann ldann "ld annotation" SI "ld_annotation" "at")
4349 (load-gr-r ldsb QI OP_02 OPE1_00 "Load signed byte" "@")
4350 (load-gr-r ldub UQI OP_02 OPE1_01 "Load unsigned byte" "@")
4351 (load-gr-r ldsh HI OP_02 OPE1_02 "Load signed half" "@")
4352 (load-gr-r lduh UHI OP_02 OPE1_03 "Load unsigned half" "@")
4353 (load-gr-r ld SI OP_02 OPE1_04 "Load word" "$ldann")
4355 (define-pmacro (load-fr-r name mode op ope comment)
4358 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4359 (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
4360 (.str name "$pack @($GRi,$GRj),$FRintk")
4361 (+ pack FRintk op GRi ope GRj)
4362 (set FRintk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4363 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4364 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4368 (load-fr-r ldbf UQI OP_02 OPE1_08 "Load byte float")
4369 (load-fr-r ldhf UHI OP_02 OPE1_09 "Load half float")
4370 (load-fr-r ldf SI OP_02 OPE1_0A "Load word float")
4372 (define-pmacro (load-cpr-r name mode op ope reg attr comment)
4375 ((UNIT LOAD) (FR500-MAJOR I-2) attr)
4376 (.str name "$pack @($GRi,$GRj),$" reg "k")
4377 (+ pack (.sym reg k) op GRi ope GRj)
4379 (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4384 (load-cpr-r ldc SI OP_02 OPE1_0D CPR (MACH frv) "Load coprocessor word")
4386 ; These correspond to enumerators in frv-sim.h
4387 (define-pmacro (ne-UQI-size) 0)
4388 (define-pmacro (ne-QI-size) 1)
4389 (define-pmacro (ne-UHI-size) 2)
4390 (define-pmacro (ne-HI-size) 3)
4391 (define-pmacro (ne-SI-size) 4)
4392 (define-pmacro (ne-DI-size) 5)
4393 (define-pmacro (ne-XI-size) 6)
4395 (define-pmacro (ne-load-semantics base dispix targ idisp size is_float action)
4396 (sequence ((BI do_op))
4398 (c-call BI "@cpu@_check_non_excepting_load"
4399 (index-of base) dispix (index-of targ)
4400 idisp size is_float))
4404 (define-pmacro (ne-load-gr-r name mode op ope size comment)
4407 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4408 (MACH simple,tomcat,fr500,fr550,frv))
4409 (.str name "$pack @($GRi,$GRj),$GRk")
4410 (+ pack GRk op GRi ope GRj)
4411 (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
4413 (c-call mode (.str "@cpu@_read_mem_" mode)
4415 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4419 (ne-load-gr-r nldsb QI OP_02 OPE1_20 (ne-QI-size) "Load signed byte")
4420 (ne-load-gr-r nldub UQI OP_02 OPE1_21 (ne-UQI-size) "Load unsigned byte")
4421 (ne-load-gr-r nldsh HI OP_02 OPE1_22 (ne-HI-size) "Load signed half")
4422 (ne-load-gr-r nlduh UHI OP_02 OPE1_23 (ne-UHI-size) "Load unsigned half")
4423 (ne-load-gr-r nld SI OP_02 OPE1_24 (ne-SI-size) "Load word")
4425 (define-pmacro (ne-load-fr-r name mode op ope size comment)
4428 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4429 (MACH simple,tomcat,fr500,fr550,frv))
4430 (.str name "$pack @($GRi,$GRj),$FRintk")
4431 (+ pack FRintk op GRi ope GRj)
4432 (ne-load-semantics GRi (index-of GRj) FRintk 0 size 1
4434 (c-call mode (.str "@cpu@_read_mem_" mode)
4436 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4440 (ne-load-fr-r nldbf UQI OP_02 OPE1_28 (ne-UQI-size) "Load byte float")
4441 (ne-load-fr-r nldhf UHI OP_02 OPE1_29 (ne-UHI-size) "Load half float")
4442 (ne-load-fr-r nldf SI OP_02 OPE1_2A (ne-SI-size) "Load word float")
4444 ; Semantics for a load-double insn
4446 (define-pmacro (load-double-semantics not_gr mode regtype address arg)
4447 (if (orif not_gr (ne (index-of (.sym regtype doublek)) 0))
4449 (set address (add GRi arg))
4450 (set (.sym regtype doublek)
4451 (c-call mode (.str "@cpu@_read_mem_" mode) pc address))))
4454 (define-pmacro (load-double-r-r
4455 name not_gr mode op ope regtype attr profile comment ann)
4458 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4459 (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4460 (.str name "$pack " ann "($GRi,$GRj),$" regtype "doublek")
4461 (+ pack (.sym regtype doublek) op GRi ope GRj)
4462 (sequence ((WI address))
4463 (load-double-semantics not_gr mode regtype address GRj))
4468 (dann lddann "ldd annotation" SI "ldd_annotation" "at")
4470 (load-double-r-r ldd 0 DI OP_02 OPE1_05 GR NA
4471 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4472 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4473 "Load double word" "$lddann")
4474 (load-double-r-r lddf 1 DF OP_02 OPE1_0B FR FR-ACCESS
4475 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4476 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4477 "Load double float" "@")
4478 (load-double-r-r lddc 1 DI OP_02 OPE1_0E CPR (MACH frv) ()
4479 "Load coprocessor double" "@")
4481 (define-pmacro (ne-load-double-r-r
4482 name not_gr mode op ope regtype size is_float attr profile
4486 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4487 (MACH simple,tomcat,fr500,fr550,frv))
4488 (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4489 (+ pack (.sym regtype doublek) op GRi ope GRj)
4490 (sequence ((WI address))
4491 (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek)
4493 (load-double-semantics not_gr mode
4500 (ne-load-double-r-r nldd 0 DI OP_02 OPE1_25 GR (ne-DI-size) 0 NA
4501 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
4502 (ne-load-double-r-r nlddf 1 DF OP_02 OPE1_2B FR (ne-DI-size) 1 FR-ACCESS
4503 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
4505 ; Semantics for a load-quad insn
4507 (define-pmacro (load-quad-semantics regtype address arg)
4509 (set address (add GRi arg))
4510 (c-call VOID (.str "@cpu@_load_quad_" regtype)
4511 pc address (index-of (.sym regtype k))))
4514 (define-pmacro (load-quad-r-r name op ope regtype attr profile comment)
4517 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4518 (.str name "$pack @($GRi,$GRj),$" regtype "k")
4519 (+ pack (.sym regtype k) op GRi ope GRj)
4520 (sequence ((WI address))
4521 (load-quad-semantics regtype address GRj))
4522 ; TODO regtype-k not referenced for profiling
4527 (load-quad-r-r ldq OP_02 OPE1_06 GR NA ((fr500 (unit u-gr-load)))
4529 (load-quad-r-r ldqf OP_02 OPE1_0C FRint FR-ACCESS ((fr500 (unit u-fr-load)))
4531 (load-quad-r-r ldqc OP_02 OPE1_0F CPR NA () "Load coprocessor quad")
4533 (define-pmacro (ne-load-quad-r-r
4534 name op ope regtype size is_float attr profile comment)
4537 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
4538 (.str name "$pack @($GRi,$GRj),$" regtype "k")
4539 (+ pack (.sym regtype k) op GRi ope GRj)
4540 (sequence ((WI address))
4541 (ne-load-semantics GRi (index-of GRj) (.sym regtype k)
4543 (load-quad-semantics regtype address GRj)))
4544 ; TODO regtype-k not referenced for profiling
4549 (ne-load-quad-r-r nldq OP_02 OPE1_26 GR (ne-XI-size) 0 NA
4550 ((fr500 (unit u-gr-load))) "Load quad word")
4551 (ne-load-quad-r-r nldqf OP_02 OPE1_2C FRint (ne-XI-size) 1 FR-ACCESS
4552 ((fr500 (unit u-fr-load))) "Load quad float")
4554 (define-pmacro (load-gr-u-semantics mode)
4555 (sequence ((UWI address))
4556 (set address (add GRi GRj))
4557 (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
4558 (if (ne (index-of GRi) (index-of GRk))
4561 (c-call VOID "@cpu@_force_update"))))
4564 (define-pmacro (load-gr-u name mode op ope comment)
4567 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4568 (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4569 (.str name "$pack @($GRi,$GRj),$GRk")
4570 (+ pack GRk op GRi ope GRj)
4571 (load-gr-u-semantics mode)
4572 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4573 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4577 (load-gr-u ldsbu QI OP_02 OPE1_10 "Load signed byte, update index")
4578 (load-gr-u ldubu UQI OP_02 OPE1_11 "Load unsigned byte, update index")
4579 (load-gr-u ldshu HI OP_02 OPE1_12 "Load signed half, update index")
4580 (load-gr-u lduhu UHI OP_02 OPE1_13 "Load unsigned half, update index")
4581 (load-gr-u ldu SI OP_02 OPE1_14 "Load word, update index")
4583 (define-pmacro (ne-load-gr-u name mode op ope size comment)
4586 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4587 (MACH simple,tomcat,fr500,fr550,frv))
4588 (.str name "$pack @($GRi,$GRj),$GRk")
4589 (+ pack GRk op GRi ope GRj)
4590 (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 (load-gr-u-semantics mode))
4591 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4595 (ne-load-gr-u nldsbu QI OP_02 OPE1_30 (ne-QI-size) "Load signed byte, update index")
4596 (ne-load-gr-u nldubu UQI OP_02 OPE1_31 (ne-UQI-size) "Load unsigned byte, update index")
4597 (ne-load-gr-u nldshu HI OP_02 OPE1_32 (ne-HI-size) "Load signed half, update index")
4598 (ne-load-gr-u nlduhu UHI OP_02 OPE1_33 (ne-UHI-size) "Load unsigned half, update index")
4599 (ne-load-gr-u nldu SI OP_02 OPE1_34 (ne-SI-size) "Load word, update index")
4601 (define-pmacro (load-non-gr-u-semantics mode regtype)
4602 (sequence ((UWI address))
4603 (set address (add GRi GRj))
4604 (set (.sym regtype k)
4605 (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
4607 (c-call VOID "@cpu@_force_update"))
4610 (define-pmacro (load-fr-u name mode op ope comment)
4613 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4614 (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
4615 (.str name "$pack @($GRi,$GRj),$FRintk")
4616 (+ pack FRintk op GRi ope GRj)
4617 (load-non-gr-u-semantics mode FRint)
4618 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4619 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4623 (load-fr-u ldbfu UQI OP_02 OPE1_18 "Load byte float, update index")
4624 (load-fr-u ldhfu UHI OP_02 OPE1_19 "Load half float, update index")
4625 (load-fr-u ldfu SI OP_02 OPE1_1A "Load word float, update index")
4627 (define-pmacro (load-cpr-u name mode op ope comment)
4630 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
4631 (.str name "$pack @($GRi,$GRj),$CPRk")
4632 (+ pack CPRk op GRi ope GRj)
4633 (load-non-gr-u-semantics mode CPR)
4638 (load-cpr-u ldcu SI OP_02 OPE1_1D "Load coprocessor word float,update index")
4640 (define-pmacro (ne-load-non-gr-u name mode op ope regtype size comment)
4643 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4644 (MACH simple,tomcat,fr500,fr550,frv))
4645 (.str name "$pack @($GRi,$GRj),$" regtype "k")
4646 (+ pack (.sym regtype k) op GRi ope GRj)
4647 (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
4648 (load-non-gr-u-semantics mode regtype))
4649 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4653 (ne-load-non-gr-u nldbfu UQI OP_02 OPE1_38 FRint (ne-UQI-size) "Load byte float, update index")
4654 (ne-load-non-gr-u nldhfu UHI OP_02 OPE1_39 FRint (ne-UHI-size) "Load half float, update index")
4655 (ne-load-non-gr-u nldfu SI OP_02 OPE1_3A FRint (ne-SI-size) "Load word float, update index")
4657 (define-pmacro (load-double-gr-u-semantics)
4658 (sequence ((WI address))
4659 (load-double-semantics 0 DI GR address GRj)
4660 (if (ne (index-of GRi) (index-of GRdoublek))
4663 (c-call VOID "@cpu@_force_update"))))
4666 (define-pmacro (load-double-gr-u name op ope comment)
4669 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4670 (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4671 (.str name "$pack @($GRi,$GRj),$GRdoublek")
4672 (+ pack GRdoublek op GRi ope GRj)
4673 (load-double-gr-u-semantics)
4674 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4675 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4679 (load-double-gr-u lddu OP_02 OPE1_15 "Load double word, update index")
4681 (define-pmacro (ne-load-double-gr-u name op ope size comment)
4684 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4685 (MACH simple,tomcat,fr500,fr550,frv))
4686 (.str name "$pack @($GRi,$GRj),$GRdoublek")
4687 (+ pack GRdoublek op GRi ope GRj)
4688 (ne-load-semantics GRi (index-of GRj) GRdoublek 0 size 0
4689 (load-double-gr-u-semantics))
4690 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4695 (ne-load-double-gr-u nlddu OP_02 OPE1_35 (ne-DI-size) "Load double word, update index")
4697 (define-pmacro (load-double-non-gr-u-semantics mode regtype)
4698 (sequence ((WI address))
4699 (load-double-semantics 1 mode regtype address GRj)
4701 (c-call VOID "@cpu@_force_update"))
4704 (define-pmacro (load-double-non-gr-u
4705 name mode op ope regtype attr profile comment)
4708 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4709 (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4710 (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4711 (+ pack (.sym regtype doublek) op GRi ope GRj)
4712 (load-double-non-gr-u-semantics mode regtype)
4717 (load-double-non-gr-u lddfu DF OP_02 OPE1_1B FR FR-ACCESS
4718 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4719 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4720 "Load double float, update index")
4721 (load-double-non-gr-u lddcu DI OP_02 OPE1_1E CPR (MACH frv)
4722 () "Load coprocessor double float, update index")
4724 (define-pmacro (ne-load-double-non-gr-u name mode op ope regtype size comment)
4727 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4728 (MACH simple,tomcat,fr500,fr550,frv))
4729 (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4730 (+ pack (.sym regtype doublek) op GRi ope GRj)
4731 (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek) 0 size 1
4732 (load-double-non-gr-u-semantics mode regtype))
4733 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4737 (ne-load-double-non-gr-u nlddfu DF OP_02 OPE1_3B FR (ne-DI-size) "Load double float, update index")
4739 (define-pmacro (load-quad-gr-u-semantics)
4740 (sequence ((WI address))
4741 (load-quad-semantics GR address GRj)
4742 (if (ne (index-of GRi) (index-of GRk))
4745 (c-call VOID "@cpu@_force_update"))))
4748 (define-pmacro (load-quad-gr-u name op ope comment)
4751 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
4752 (.str name "$pack @($GRi,$GRj),$GRk")
4753 (+ pack GRk op GRi ope GRj)
4754 (load-quad-gr-u-semantics)
4755 ; TODO - GRk not referenced here for profiling
4756 ((fr500 (unit u-gr-load)))
4760 (load-quad-gr-u ldqu OP_02 OPE1_16 "Load quad word, update index")
4762 (define-pmacro (ne-load-quad-gr-u name op ope size comment)
4765 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING)
4766 (.str name "$pack @($GRi,$GRj),$GRk")
4767 (+ pack GRk op GRi ope GRj)
4768 (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
4769 (load-quad-gr-u-semantics))
4770 ; TODO - GRk not referenced here for profiling
4771 ((fr500 (unit u-gr-load)))
4775 (ne-load-quad-gr-u nldqu OP_02 OPE1_36 (ne-XI-size) "Load quad word, update index")
4777 (define-pmacro (load-quad-non-gr-u-semantics regtype)
4778 (sequence ((WI address))
4779 (load-quad-semantics regtype address GRj)
4781 (c-call VOID "@cpu@_force_update"))
4784 (define-pmacro (load-quad-non-gr-u name op ope regtype attr profile comment)
4787 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4788 (.str name "$pack @($GRi,$GRj),$" regtype "k")
4789 (+ pack (.sym regtype k) op GRi ope GRj)
4790 (load-quad-non-gr-u-semantics regtype)
4795 (load-quad-non-gr-u ldqfu OP_02 OPE1_1C FRint FR-ACCESS
4796 ((fr500 (unit u-fr-load))) "Load quad float, update index")
4797 (load-quad-non-gr-u ldqcu OP_02 OPE1_1F CPR NA
4798 () "Load coprocessor quad word, update index")
4800 (define-pmacro (ne-load-quad-non-gr-u name op ope regtype size comment)
4803 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING FR-ACCESS)
4804 (.str name "$pack @($GRi,$GRj),$" regtype "k")
4805 (+ pack (.sym regtype k) op GRi ope GRj)
4806 (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
4807 (load-quad-non-gr-u-semantics regtype))
4808 ((fr500 (unit u-fr-load)))
4812 (ne-load-quad-non-gr-u nldqfu OP_02 OPE1_3C FRint (ne-XI-size) "Load quad float,update index")
4814 (define-pmacro (load-r-simm name mode op regtype attr profile comment)
4817 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4818 (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4819 (.str name "$pack @($GRi,$d12),$" regtype "k")
4820 (+ pack (.sym regtype k) op GRi d12)
4821 (set (.sym regtype k)
4822 (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi d12)))
4827 (load-r-simm ldsbi QI OP_30 GR NA
4828 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4829 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4831 (load-r-simm ldshi HI OP_31 GR NA
4832 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4833 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4835 (load-r-simm ldi SI OP_32 GR NA
4836 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4837 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4839 (load-r-simm ldubi UQI OP_35 GR NA
4840 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4841 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4842 "Load unsigned byte")
4843 (load-r-simm lduhi UHI OP_36 GR NA
4844 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4845 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4846 "Load unsigned half")
4848 (load-r-simm ldbfi UQI OP_38 FRint FR-ACCESS
4849 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4850 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4852 (load-r-simm ldhfi UHI OP_39 FRint FR-ACCESS
4853 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4854 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4856 (load-r-simm ldfi SI OP_3A FRint FR-ACCESS
4857 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4858 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4861 (define-pmacro (ne-load-r-simm
4862 name mode op regtype size is_float attr profile comment)
4865 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4866 (MACH simple,tomcat,fr500,fr550,frv))
4867 (.str name "$pack @($GRi,$d12),$" regtype "k")
4868 (+ pack (.sym regtype k) op GRi d12)
4869 (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
4870 (set (.sym regtype k)
4871 (c-call mode (.str "@cpu@_read_mem_" mode)
4877 (ne-load-r-simm nldsbi QI OP_40 GR (ne-QI-size) 0 NA
4878 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed byte")
4879 (ne-load-r-simm nldubi UQI OP_41 GR (ne-UQI-size) 0 NA
4880 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned byte")
4881 (ne-load-r-simm nldshi HI OP_42 GR (ne-HI-size) 0 NA
4882 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed half")
4883 (ne-load-r-simm nlduhi UHI OP_43 GR (ne-UHI-size) 0 NA
4884 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned half")
4885 (ne-load-r-simm nldi SI OP_44 GR (ne-SI-size) 0 NA
4886 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load word")
4888 (ne-load-r-simm nldbfi UQI OP_48 FRint (ne-UQI-size) 1 FR-ACCESS
4889 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load byte float")
4890 (ne-load-r-simm nldhfi UHI OP_49 FRint (ne-UHI-size) 1 FR-ACCESS
4891 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load half float")
4892 (ne-load-r-simm nldfi SI OP_4A FRint (ne-SI-size) 1 FR-ACCESS
4893 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load word float")
4895 (define-pmacro (load-double-r-simm
4896 name not_gr mode op regtype attr profile comment)
4899 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4900 (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4901 (.str name "$pack @($GRi,$d12),$" regtype "doublek")
4902 (+ pack (.sym regtype doublek) op GRi d12)
4903 (sequence ((WI address))
4904 (load-double-semantics not_gr mode regtype address d12))
4909 (load-double-r-simm lddi 0 DI OP_33 GR NA
4910 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4911 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4913 (load-double-r-simm lddfi 1 DF OP_3B FR FR-ACCESS
4914 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4915 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4916 "Load double float")
4918 (define-pmacro (ne-load-double-r-simm
4919 name not_gr mode op regtype size is_float attr profile comment)
4922 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4923 (MACH simple,tomcat,fr500,fr550,frv))
4924 (.str name "$pack @($GRi,$d12),$" regtype "doublek")
4925 (+ pack (.sym regtype doublek) op GRi d12)
4926 (sequence ((WI address))
4927 (ne-load-semantics GRi -1 (.sym regtype doublek)
4929 (load-double-semantics not_gr mode
4936 (ne-load-double-r-simm nlddi 0 DI OP_45 GR (ne-DI-size) 0 NA
4937 ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
4938 (ne-load-double-r-simm nlddfi 1 DF OP_4B FR (ne-DI-size) 1 FR-ACCESS
4939 ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
4941 (define-pmacro (load-quad-r-simm name op regtype attr profile comment)
4944 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4945 (.str name "$pack @($GRi,$d12),$" regtype "k")
4946 (+ pack (.sym regtype k) op GRi d12)
4947 (sequence ((WI address))
4948 (load-quad-semantics regtype address d12))
4953 (load-quad-r-simm ldqi OP_34 GR NA
4954 ((fr500 (unit u-gr-load))) "Load quad word")
4955 (load-quad-r-simm ldqfi OP_3C FRint FR-ACCESS
4956 ((fr500 (unit u-fr-load))) "Load quad float")
4958 (define-pmacro (ne-load-quad-r-simm
4959 name op regtype size is_float attr profile comment)
4962 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
4963 (.str name "$pack @($GRi,$d12),$" regtype "k")
4964 (+ pack (.sym regtype k) op GRi d12)
4965 (sequence ((WI address))
4966 (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
4967 (load-quad-semantics regtype address d12)))
4972 (ne-load-quad-r-simm nldqfi OP_4C FRint (ne-XI-size) 1 FR-ACCESS
4973 ((fr500 (unit u-fr-load))) "Load quad float")
4975 (define-pmacro (store-r-r name mode op ope reg attr profile comment)
4978 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
4979 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
4980 (.str name "$pack $" reg "k,@($GRi,$GRj)")
4981 (+ pack (.sym reg k) op GRi ope GRj)
4982 (c-call VOID (.str "@cpu@_write_mem_" mode)
4983 pc (add GRi GRj) (.sym reg k))
4988 (store-r-r stb QI OP_03 OPE1_00 GR NA
4989 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
4990 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
4991 "Store unsigned byte")
4992 (store-r-r sth HI OP_03 OPE1_01 GR NA
4993 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
4994 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
4995 "Store unsigned half")
4996 (store-r-r st SI OP_03 OPE1_02 GR NA
4997 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
4998 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5001 (store-r-r stbf QI OP_03 OPE1_08 FRint FR-ACCESS
5002 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5003 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5005 (store-r-r sthf HI OP_03 OPE1_09 FRint FR-ACCESS
5006 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5007 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5009 (store-r-r stf SI OP_03 OPE1_0A FRint FR-ACCESS
5010 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5011 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5014 (store-r-r stc SI OP_03 OPE1_25 CPR (MACH frv) () "Store coprocessor word")
5016 ; Semantics for a store-double insn
5018 (define-pmacro (store-double-semantics mode regtype address arg)
5020 (set address (add GRi arg))
5021 (c-call VOID (.str "@cpu@_write_mem_" mode)
5022 pc address (.sym regtype doublek)))
5025 (define-pmacro (store-double-r-r name mode op ope regtype attr profile comment)
5028 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5029 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5030 (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
5031 (+ pack (.sym regtype doublek) op GRi ope GRj)
5032 (sequence ((WI address))
5033 (store-double-semantics mode regtype address GRj))
5038 (store-double-r-r std DI OP_03 OPE1_03 GR NA
5039 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5040 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5041 "Store double word")
5042 (store-double-r-r stdf DF OP_03 OPE1_0B FR FR-ACCESS
5043 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5044 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5045 "Store double float")
5047 (store-double-r-r stdc DI OP_03 OPE1_26 CPR (MACH frv)
5048 () "Store coprocessor double word")
5050 ; Semantics for a store-quad insn
5052 (define-pmacro (store-quad-semantics regtype address arg)
5054 (set address (add GRi arg))
5055 (c-call VOID (.str "@cpu@_store_quad_" regtype)
5056 pc address (index-of (.sym regtype k))))
5059 (define-pmacro (store-quad-r-r name op ope regtype attr profile comment)
5062 ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5063 (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5064 (+ pack (.sym regtype k) op GRi ope GRj)
5065 (sequence ((WI address))
5066 (store-quad-semantics regtype address GRj))
5071 (store-quad-r-r stq OP_03 OPE1_04 GR NA
5072 ((fr500 (unit u-gr-store))) "Store quad word")
5073 (store-quad-r-r stqf OP_03 OPE1_0C FRint FR-ACCESS
5074 ((fr500 (unit u-fr-store)))
5076 (store-quad-r-r stqc OP_03 OPE1_27 CPR NA
5077 () "Store coprocessor quad word")
5079 (define-pmacro (store-r-r-u name mode op ope regtype attr profile comment)
5082 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5083 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5084 (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5085 (+ pack (.sym regtype k) op GRi ope GRj)
5086 (sequence ((UWI address))
5087 (set address (add GRi GRj))
5088 (c-call VOID (.str "@cpu@_write_mem_" mode)
5089 pc address (.sym regtype k))
5095 (store-r-r-u stbu QI OP_03 OPE1_10 GR NA
5096 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5097 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5098 "Store unsigned byte, update index")
5099 (store-r-r-u sthu HI OP_03 OPE1_11 GR NA
5100 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5101 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5102 "Store unsigned half, update index")
5103 (store-r-r-u stu WI OP_03 OPE1_12 GR NA
5104 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5105 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5106 "Store word, update index")
5108 (store-r-r-u stbfu QI OP_03 OPE1_18 FRint FR-ACCESS
5109 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5110 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5111 "Store byte float, update index")
5112 (store-r-r-u sthfu HI OP_03 OPE1_19 FRint FR-ACCESS
5113 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5114 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5115 "Store half float, update index")
5116 (store-r-r-u stfu SI OP_03 OPE1_1A FRint FR-ACCESS
5117 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5118 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5119 "Store word float, update index")
5121 (store-r-r-u stcu SI OP_03 OPE1_2D CPR (MACH frv) ()
5122 "Store coprocessor word, update index")
5124 (define-pmacro (store-double-r-r-u
5125 name mode op ope regtype attr profile comment)
5128 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5129 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5130 (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
5131 (+ pack (.sym regtype doublek) op GRi ope GRj)
5132 (sequence ((WI address))
5133 (store-double-semantics mode regtype address GRj)
5139 (store-double-r-r-u stdu DI OP_03 OPE1_13 GR NA
5140 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5141 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5142 "Store double word, update index")
5143 (store-double-r-r-u stdfu DF OP_03 OPE1_1B FR FR-ACCESS
5144 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5145 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5146 "Store double float,update index")
5147 (store-double-r-r-u stdcu DI OP_03 OPE1_2E CPR (MACH frv) ()
5148 "Store coprocessor double word, update index")
5150 (define-pmacro (store-quad-r-r-u name op ope regtype attr profile comment)
5153 ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5154 (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5155 (+ pack (.sym regtype k) op GRi ope GRj)
5156 (sequence ((WI address))
5157 (store-quad-semantics regtype address GRj)
5163 (store-quad-r-r-u stqu OP_03 OPE1_14 GR NA
5164 ((fr500 (unit u-gr-store)))
5165 "Store quad word, update index")
5166 (store-quad-r-r-u stqfu OP_03 OPE1_1C FRint FR-ACCESS
5167 ((fr500 (unit u-fr-store)))
5168 "Store quad float, update index")
5169 (store-quad-r-r-u stqcu OP_03 OPE1_2F CPR NA ()
5170 "Store coprocessor quad word, update index")
5172 (define-pmacro (conditional-load name mode op ope regtype profile comment)
5175 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5176 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5177 (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
5178 (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5179 (if (eq CCi (or cond 2))
5180 (set (.sym regtype k)
5181 (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))))
5186 (conditional-load cldsb QI OP_5E OPE4_0 GR
5187 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5188 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5190 (conditional-load cldub UQI OP_5E OPE4_1 GR
5191 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5192 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5193 "Load unsigned byte")
5194 (conditional-load cldsh HI OP_5E OPE4_2 GR
5195 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5196 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5198 (conditional-load clduh UHI OP_5E OPE4_3 GR
5199 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5200 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5201 "Load unsigned half")
5202 (conditional-load cld SI OP_5F OPE4_0 GR
5203 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5204 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5207 (conditional-load cldbf UQI OP_60 OPE4_0 FRint
5208 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5209 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5211 (conditional-load cldhf UHI OP_60 OPE4_1 FRint
5212 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5213 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5215 (conditional-load cldf SI OP_60 OPE4_2 FRint
5216 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5217 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5220 (define-pmacro (conditional-load-double
5221 name not_gr mode op ope regtype attr profile comment)
5224 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5225 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL attr)
5226 (.str name "$pack @($GRi,$GRj),$" regtype "doublek,$CCi,$cond")
5227 (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5228 (if (eq CCi (or cond 2))
5229 (sequence ((WI address))
5230 (load-double-semantics not_gr mode regtype address GRj)))
5235 (conditional-load-double cldd 0 DI OP_5F OPE4_1 GR NA
5236 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5237 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5239 (conditional-load-double clddf 1 DF OP_60 OPE4_3 FR FR-ACCESS
5240 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5241 (fr500 (unit u-gr-load)) (fr550 (unit u-fr-load)))
5242 "Load double float")
5245 "conditional load quad integer"
5246 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
5247 "cldq$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5248 (+ pack GRk OP_5F GRi CCi cond OPE4_2 GRj)
5249 (if (eq CCi (or cond 2))
5250 (sequence ((WI address))
5251 (load-quad-semantics GR address GRj)))
5252 ((fr500 (unit u-gr-load)))
5255 (define-pmacro (conditional-load-gr-u name mode op ope comment)
5258 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5259 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5260 (.str name "$pack @($GRi,$GRj),$GRk,$CCi,$cond")
5261 (+ pack GRk op GRi CCi cond ope GRj)
5262 (if (eq CCi (or cond 2))
5263 (sequence ((WI address))
5264 (set address (add GRi GRj))
5266 (c-call mode (.str "@cpu@_read_mem_" mode)
5268 (if (ne (index-of GRi) (index-of GRk))
5269 (set GRi address))))
5270 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5271 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5275 (conditional-load-gr-u cldsbu QI OP_61 OPE4_0 "Load signed byte, update")
5276 (conditional-load-gr-u cldubu UQI OP_61 OPE4_1 "Load unsigned byte, update")
5277 (conditional-load-gr-u cldshu HI OP_61 OPE4_2 "Load signed half, update")
5278 (conditional-load-gr-u clduhu UHI OP_61 OPE4_3 "Load unsigned half, update")
5279 (conditional-load-gr-u cldu SI OP_62 OPE4_0 "Load word, update")
5281 (define-pmacro (conditional-load-non-gr-u name mode op ope regtype comment)
5284 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5285 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
5286 (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
5287 (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5288 (if (eq CCi (or cond 2))
5289 (sequence ((WI address))
5290 (set address (add GRi GRj))
5291 (set (.sym regtype k)
5292 (c-call mode (.str "@cpu@_read_mem_" mode)
5295 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5296 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5300 (conditional-load-non-gr-u cldbfu UQI OP_63 OPE4_0 FRint "Load byte float, update")
5301 (conditional-load-non-gr-u cldhfu UHI OP_63 OPE4_1 FRint "Load half float, update")
5302 (conditional-load-non-gr-u cldfu SI OP_63 OPE4_2 FRint "Load word float, update")
5306 "Load double word, update"
5307 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5308 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5309 "clddu$pack @($GRi,$GRj),$GRdoublek,$CCi,$cond"
5310 (+ pack GRdoublek OP_62 GRi CCi cond OPE4_1 GRj)
5311 (if (eq CCi (or cond 2))
5312 (sequence ((WI address))
5313 (load-double-semantics 0 DI GR address GRj)
5314 (if (ne (index-of GRi) (index-of GRdoublek))
5315 (set GRi address))))
5316 ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5317 (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5321 "Load double float, update"
5322 ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5323 (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
5324 "clddfu$pack @($GRi,$GRj),$FRdoublek,$CCi,$cond"
5325 (+ pack FRdoublek OP_63 GRi CCi cond OPE4_3 GRj)
5326 (if (eq CCi (or cond 2))
5327 (sequence ((WI address))
5328 (load-double-semantics 1 DF FR address GRj)
5330 ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5331 (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5335 "conditional load quad integer and update index"
5336 ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
5337 "cldqu$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5338 (+ pack GRk OP_62 GRi CCi cond OPE4_2 GRj)
5339 (if (eq CCi (or cond 2))
5340 (sequence ((WI address))
5341 (load-quad-semantics GR address GRj)
5342 (if (ne (index-of GRi) (index-of GRk))
5343 (set GRi address))))
5344 ((fr500 (unit u-gr-load)))
5347 (define-pmacro (conditional-store name mode op ope regtype profile comment)
5350 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5351 (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL)
5352 (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
5353 (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5354 (if (eq CCi (or cond 2))
5355 (c-call VOID (.str "@cpu@_write_mem_" mode)
5356 pc (add GRi GRj) (.sym regtype k)))
5361 (conditional-store cstb QI OP_64 OPE4_0 GR
5362 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5363 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5364 "Store unsigned byte")
5365 (conditional-store csth HI OP_64 OPE4_1 GR
5366 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5367 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5368 "Store unsigned half")
5369 (conditional-store cst SI OP_64 OPE4_2 GR
5370 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5371 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5374 (conditional-store cstbf QI OP_66 OPE4_0 FRint
5375 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5376 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5378 (conditional-store csthf HI OP_66 OPE4_1 FRint
5379 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5380 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5382 (conditional-store cstf SI OP_66 OPE4_2 FRint
5383 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5384 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5387 (define-pmacro (conditional-store-double
5388 name mode op ope regtype attr profile comment)
5391 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5392 (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5393 (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
5394 (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5395 (if (eq CCi (or cond 2))
5396 (sequence ((WI address))
5397 (store-double-semantics mode regtype address GRj)))
5402 (conditional-store-double cstd DI OP_64 OPE4_3 GR NA
5403 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5404 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5405 "Store double word")
5406 (conditional-store-double cstdf DF OP_66 OPE4_3 FR FR-ACCESS
5407 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5408 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5409 "Store double float")
5412 "conditionally store quad word"
5413 ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) CONDITIONAL)
5414 "cstq$pack $GRk,@($GRi,$GRj),$CCi,$cond"
5415 (+ pack GRk OP_65 GRi CCi cond OPE4_0 GRj)
5416 (if (eq CCi (or cond 2))
5417 (sequence ((WI address))
5418 (store-quad-semantics GR address GRj)))
5419 ((fr500 (unit u-gr-store)))
5422 (define-pmacro (conditional-store-u
5423 name mode op ope regtype attr profile comment)
5426 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5427 (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5428 (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
5429 (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5430 (if (eq CCi (or cond 2))
5431 (sequence ((WI address))
5432 (set address (add GRi GRj))
5433 (c-call VOID (.str "@cpu@_write_mem_" mode)
5434 pc address (.sym regtype k))
5440 (conditional-store-u cstbu QI OP_67 OPE4_0 GR NA
5441 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5442 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5443 "Store unsigned byte, update index")
5444 (conditional-store-u csthu HI OP_67 OPE4_1 GR NA
5445 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5446 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5447 "Store unsigned half, update index")
5448 (conditional-store-u cstu SI OP_67 OPE4_2 GR NA
5449 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5450 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5451 "Store word, update index")
5453 (conditional-store-u cstbfu QI OP_68 OPE4_0 FRint FR-ACCESS
5454 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5455 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5456 "Store byte float, update index")
5457 (conditional-store-u csthfu HI OP_68 OPE4_1 FRint FR-ACCESS
5458 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5459 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5460 "Store half float, update index")
5461 (conditional-store-u cstfu SI OP_68 OPE4_2 FRint FR-ACCESS
5462 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5463 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5464 "Store word float, update index")
5466 (define-pmacro (conditional-store-double-u
5467 name mode op ope regtype attr profile comment)
5470 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5471 (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5472 (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
5473 (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5474 (if (eq CCi (or cond 2))
5475 (sequence ((WI address))
5476 (store-double-semantics mode regtype address GRj)
5482 (conditional-store-double-u cstdu DI OP_67 OPE4_3 GR NA
5483 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5484 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5485 "Store double word, update index")
5486 (conditional-store-double-u cstdfu DF OP_68 OPE4_3 FR FR-ACCESS
5487 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5488 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5489 "Store double float, update index")
5491 (define-pmacro (store-r-simm name mode op regtype attr profile comment)
5494 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5495 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5496 (.str name "$pack $" regtype "k,@($GRi,$d12)")
5497 (+ pack (.sym regtype k) op GRi d12)
5498 (c-call VOID (.str "@cpu@_write_mem_" mode)
5499 pc (add GRi d12) (.sym regtype k))
5504 (store-r-simm stbi QI OP_50 GR NA
5505 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5506 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5507 "Store unsigned byte")
5508 (store-r-simm sthi HI OP_51 GR NA
5509 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5510 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5511 "Store unsigned half")
5512 (store-r-simm sti SI OP_52 GR NA
5513 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5514 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5517 (store-r-simm stbfi QI OP_4E FRint FR-ACCESS
5518 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5519 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5521 (store-r-simm sthfi HI OP_4F FRint FR-ACCESS
5522 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5523 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5525 (store-r-simm stfi SI OP_55 FRint FR-ACCESS
5526 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5527 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5530 (define-pmacro (store-double-r-simm name mode op regtype attr profile comment)
5533 ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5534 (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5535 (.str name "$pack $" regtype "doublek,@($GRi,$d12)")
5536 (+ pack (.sym regtype doublek) op GRi d12)
5537 (sequence ((WI address))
5538 (store-double-semantics mode regtype address d12))
5543 (store-double-r-simm stdi DI OP_53 GR NA
5544 ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5545 (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5546 "Store double word")
5547 (store-double-r-simm stdfi DF OP_56 FR FR-ACCESS
5548 ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5549 (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5550 "Store double float")
5552 (define-pmacro (store-quad-r-simm name op regtype attr profile comment)
5555 ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5556 (.str name "$pack $" regtype "k,@($GRi,$d12)")
5557 (+ pack (.sym regtype k) op GRi d12)
5558 (sequence ((WI address))
5559 (store-quad-semantics regtype address d12))
5564 (store-quad-r-simm stqi OP_54 GR NA ((fr500 (unit u-gr-store)))
5566 (store-quad-r-simm stqfi OP_57 FRint FR-ACCESS ()
5569 (define-pmacro (swap-semantics base offset arg)
5570 (sequence ((WI tmp) (WI address))
5572 (set address (add base offset))
5573 (c-call VOID "@cpu@_check_swap_address" address)
5574 (set arg (c-call WI "@cpu@_read_mem_WI" pc address))
5575 (c-call VOID "@cpu@_write_mem_WI" pc address tmp))
5579 "Swap contents of memory with GR"
5580 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5581 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5582 "swap$pack @($GRi,$GRj),$GRk"
5583 (+ pack GRk OP_03 GRi OPE1_05 GRj)
5584 (swap-semantics GRi GRj GRk)
5585 ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5586 (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5590 "Swap contents of memory with GR"
5591 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5592 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5593 ("swapi$pack @($GRi,$d12),$GRk")
5594 (+ pack GRk OP_4D GRi d12)
5595 (swap-semantics GRi d12 GRk)
5596 ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5597 (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5601 "Conditionally swap contents of memory with GR"
5602 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5603 (FR400-MAJOR C-2) (FR450-MAJOR C-2) CONDITIONAL)
5604 "cswap$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5605 (+ pack GRk OP_65 GRi CCi cond OPE4_2 GRj)
5606 (if (eq CCi (or cond 2))
5607 (swap-semantics GRi GRj GRk))
5608 ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5609 (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5612 (define-pmacro (register-transfer
5613 name op ope reg_src reg_targ pipe attrs profile comment)
5616 (.splice (UNIT pipe) (.unsplice attrs))
5617 (.str name "$pack $" reg_src ",$" reg_targ)
5618 (+ pack reg_targ op (rs-null) ope reg_src)
5619 (set reg_targ reg_src)
5624 (register-transfer movgf OP_03 OPE1_15
5626 ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5627 (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5628 ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5629 (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5630 "transfer gr to fr")
5631 (register-transfer movfg OP_03 OPE1_0D
5633 ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5634 (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5635 ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5636 (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5637 "transfer fr to gr")
5639 (define-pmacro (nextreg hw r offset) (reg hw (add (index-of r) offset)))
5641 (define-pmacro (register-transfer-double-from-gr-semantics cond)
5643 (if (eq (index-of GRj) 0)
5646 (set (nextreg h-fr_int FRintk 1) 0))
5649 (set (nextreg h-fr_int FRintk 1) (nextreg h-gr GRj 1)))))
5653 "move GR for FR double"
5654 ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5655 (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5656 "movgfd$pack $GRj,$FRintk"
5657 (+ pack FRintk OP_03 (rs-null) OPE1_16 GRj)
5658 (register-transfer-double-from-gr-semantics 1)
5659 ; TODO -- doesn't handle second register in the pair
5660 ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5661 (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5664 (define-pmacro (register-transfer-double-to-gr-semantics cond)
5665 (if (andif (ne (index-of GRj) 0) cond)
5668 (set (nextreg h-gr GRj 1) (nextreg h-fr_int FRintk 1))))
5672 "move FR for GR double"
5673 ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5674 (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5675 "movfgd$pack $FRintk,$GRj"
5676 (+ pack FRintk OP_03 (rs-null) OPE1_0E GRj)
5677 (register-transfer-double-to-gr-semantics 1)
5678 ; TODO -- doesn't handle second register in the pair
5679 ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5680 (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5684 "move GR for FR quad"
5685 ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
5686 "movgfq$pack $GRj,$FRintk"
5687 (+ pack FRintk OP_03 (rs-null) OPE1_17 GRj)
5688 (if (eq (index-of GRj) 0)
5691 (set (reg h-fr_int (add (index-of FRintk) 1)) 0)
5692 (set (reg h-fr_int (add (index-of FRintk) 2)) 0)
5693 (set (reg h-fr_int (add (index-of FRintk) 3)) 0))
5696 (set (reg h-fr_int (add (index-of FRintk) 1))
5697 (reg h-gr (add (index-of GRj) 1)))
5698 (set (reg h-fr_int (add (index-of FRintk) 2))
5699 (reg h-gr (add (index-of GRj) 2)))
5700 (set (reg h-fr_int (add (index-of FRintk) 3))
5701 (reg h-gr (add (index-of GRj) 3)))))
5706 "move FR for GR quad"
5707 ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
5708 "movfgq$pack $FRintk,$GRj"
5709 (+ pack FRintk OP_03 (rs-null) OPE1_0F GRj)
5710 (if (ne (index-of GRj) 0)
5713 (set (reg h-gr (add (index-of GRj) 1))
5714 (reg h-fr_int (add (index-of FRintk) 1)))
5715 (set (reg h-gr (add (index-of GRj) 2))
5716 (reg h-fr_int (add (index-of FRintk) 2)))
5717 (set (reg h-gr (add (index-of GRj) 3))
5718 (reg h-fr_int (add (index-of FRintk) 3)))))
5722 (define-pmacro (conditional-register-transfer
5723 name op ope reg_src reg_targ pipe attrs profile comment)
5726 (.splice (UNIT pipe) CONDITIONAL FR-ACCESS (.unsplice attrs))
5727 (.str name "$pack $" reg_src ",$" reg_targ ",$CCi,$cond")
5728 (+ pack reg_targ op (rs-null) CCi cond ope reg_src)
5729 (if (eq CCi (or cond 2))
5730 (set reg_targ reg_src))
5735 (conditional-register-transfer cmovgf OP_69 OPE4_0 GRj FRintk I0
5736 ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5737 (FR400-MAJOR I-4) (FR450-MAJOR I-4))
5738 ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5739 (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5740 "transfer gr to fr")
5741 (conditional-register-transfer cmovfg OP_69 OPE4_2 FRintk GRj I0
5742 ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5743 (FR400-MAJOR I-4) (FR450-MAJOR I-4))
5744 ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5745 (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5746 "transfer fr to gr")
5750 "Conditional move GR to FR double"
5751 ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5752 (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
5753 "cmovgfd$pack $GRj,$FRintk,$CCi,$cond"
5754 (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_1 GRj)
5755 (register-transfer-double-from-gr-semantics (eq CCi (or cond 2)))
5756 ; TODO -- doesn't handle extra registers in double
5757 ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5758 (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5762 "Conditional move FR to GR double"
5763 ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5764 (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
5765 "cmovfgd$pack $FRintk,$GRj,$CCi,$cond"
5766 (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_3 GRj)
5767 (register-transfer-double-to-gr-semantics (eq CCi (or cond 2)))
5768 ; TODO -- doesn't handle second register in the pair
5769 ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5770 (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5773 (define-pmacro (register-transfer-spr
5774 name op ope reg_src reg_targ unitname comment)
5777 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5778 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5779 (.str name "$pack $" reg_src ",$" reg_targ)
5780 (+ pack reg_targ op ope reg_src)
5781 (set reg_targ reg_src)
5782 ((fr400 (unit unitname)) (fr450 (unit unitname))
5783 (fr500 (unit unitname)) (fr550 (unit unitname)))
5787 (register-transfer-spr movgs OP_03 OPE1_06 GRj spr u-gr2spr "transfer gr->spr")
5788 (register-transfer-spr movsg OP_03 OPE1_07 spr GRj u-spr2gr "transfer spr->gr")
5790 ; Integer Branch Conditions
5791 (define-pmacro (Inev cc) (const BI 0))
5792 (define-pmacro (Ira cc) (const BI 1))
5793 (define-pmacro (Ieq cc) ( zbit cc))
5794 (define-pmacro (Ine cc) (not (zbit cc)))
5795 (define-pmacro (Ile cc) ( orif (zbit cc) (xor (nbit cc) (vbit cc))))
5796 (define-pmacro (Igt cc) (not (orif (zbit cc) (xor (nbit cc) (vbit cc)))))
5797 (define-pmacro (Ilt cc) ( xor (nbit cc) (vbit cc)))
5798 (define-pmacro (Ige cc) (not (xor (nbit cc) (vbit cc))))
5799 (define-pmacro (Ils cc) ( orif (cbit cc) (zbit cc)))
5800 (define-pmacro (Ihi cc) (not (orif (cbit cc) (zbit cc))))
5801 (define-pmacro (Ic cc) ( cbit cc))
5802 (define-pmacro (Inc cc) (not (cbit cc)))
5803 (define-pmacro (In cc) ( nbit cc))
5804 (define-pmacro (Ip cc) (not (nbit cc)))
5805 (define-pmacro (Iv cc) ( vbit cc))
5806 (define-pmacro (Inv cc) (not (vbit cc)))
5808 ; Float Branch Conditions
5809 (define-pmacro (Fnev cc) (const BI 0))
5810 (define-pmacro (Fra cc) (const BI 1))
5811 (define-pmacro (Fne cc) (orif (lbit cc) (orif (gbit cc) (ubit cc))))
5812 (define-pmacro (Feq cc) (ebit cc))
5813 (define-pmacro (Flg cc) (orif (lbit cc) (gbit cc)))
5814 (define-pmacro (Fue cc) (orif (ebit cc) (ubit cc)))
5815 (define-pmacro (Ful cc) (orif (lbit cc) (ubit cc)))
5816 (define-pmacro (Fge cc) (orif (ebit cc) (gbit cc)))
5817 (define-pmacro (Flt cc) (lbit cc))
5818 (define-pmacro (Fuge cc) (orif (ebit cc) (orif (gbit cc) (ubit cc))))
5819 (define-pmacro (Fug cc) (orif (gbit cc) (ubit cc)))
5820 (define-pmacro (Fle cc) (orif (ebit cc) (lbit cc)))
5821 (define-pmacro (Fgt cc) (gbit cc))
5822 (define-pmacro (Fule cc) (orif (ebit cc) (orif (lbit cc) (ubit cc))))
5823 (define-pmacro (Fu cc) (ubit cc))
5824 (define-pmacro (Fo cc) (orif (ebit cc) (orif (lbit cc) (gbit cc))))
5826 (define-pmacro (conditional-branch-i prefix cc op cond comment)
5827 (dni (.sym prefix cc)
5829 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5830 (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5831 (.str (.sym prefix cc) "$pack $ICCi_2,$hint,$label16")
5832 (+ pack (.sym ICC_ cc) ICCi_2 op hint label16)
5834 (c-call VOID "@cpu@_model_branch" label16 hint)
5837 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5838 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5843 "integer branch equal"
5844 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5845 (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5846 "bra$pack $hint_taken$label16"
5847 (+ pack ICC_ra (ICCi_2-null) OP_06 hint_taken label16)
5849 (c-call VOID "@cpu@_model_branch" label16 hint_taken)
5851 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5852 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5856 "integer branch never"
5857 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5858 (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5859 "bno$pack$hint_not_taken"
5860 (+ pack ICC_nev (ICCi_2-null) OP_06 hint_not_taken (label16-null))
5861 (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
5862 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5863 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5866 (conditional-branch-i b eq OP_06 Ieq "integer branch equal")
5867 (conditional-branch-i b ne OP_06 Ine "integer branch not equal")
5868 (conditional-branch-i b le OP_06 Ile "integer branch less or equal")
5869 (conditional-branch-i b gt OP_06 Igt "integer branch greater")
5870 (conditional-branch-i b lt OP_06 Ilt "integer branch less")
5871 (conditional-branch-i b ge OP_06 Ige "integer branch greater or equal")
5872 (conditional-branch-i b ls OP_06 Ils "integer branch less or equal unsigned")
5873 (conditional-branch-i b hi OP_06 Ihi "integer branch greater unsigned")
5874 (conditional-branch-i b c OP_06 Ic "integer branch carry set")
5875 (conditional-branch-i b nc OP_06 Inc "integer branch carry clear")
5876 (conditional-branch-i b n OP_06 In "integer branch negative")
5877 (conditional-branch-i b p OP_06 Ip "integer branch positive")
5878 (conditional-branch-i b v OP_06 Iv "integer branch overflow set")
5879 (conditional-branch-i b nv OP_06 Inv "integer branch overflow clear")
5881 (define-pmacro (conditional-branch-f prefix cc op cond comment)
5882 (dni (.sym prefix cc)
5884 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5885 (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5886 (.str (.sym prefix cc) "$pack $FCCi_2,$hint,$label16")
5887 (+ pack (.sym FCC_ cc) FCCi_2 op hint label16)
5889 (c-call VOID "@cpu@_model_branch" label16 hint)
5890 (if (cond FCCi_2) (set pc label16)))
5891 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5892 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5897 "float branch equal"
5898 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5899 (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5900 "fbra$pack $hint_taken$label16"
5901 (+ pack FCC_ra (FCCi_2-null) OP_07 hint_taken label16)
5903 (c-call VOID "@cpu@_model_branch" label16 hint_taken)
5905 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5906 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5910 "float branch never"
5911 ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5912 (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5913 "fbno$pack$hint_not_taken"
5914 (+ pack FCC_nev (FCCi_2-null) OP_07 hint_not_taken (label16-null))
5915 (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
5916 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5917 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5920 (conditional-branch-f fb ne OP_07 Fne "float branch not equal")
5921 (conditional-branch-f fb eq OP_07 Feq "float branch equal")
5922 (conditional-branch-f fb lg OP_07 Flg "float branch less or greater")
5923 (conditional-branch-f fb ue OP_07 Fue "float branch unordered or equal")
5924 (conditional-branch-f fb ul OP_07 Ful "float branch unordered or less")
5925 (conditional-branch-f fb ge OP_07 Fge "float branch greater or equal")
5926 (conditional-branch-f fb lt OP_07 Flt "float branch less")
5927 (conditional-branch-f fb uge OP_07 Fuge "float branch unordered, greater,equal")
5928 (conditional-branch-f fb ug OP_07 Fug "float branch unordered or greater")
5929 (conditional-branch-f fb le OP_07 Fle "float branch less or equal")
5930 (conditional-branch-f fb gt OP_07 Fgt "float branch greater")
5931 (conditional-branch-f fb ule OP_07 Fule "float branch unordered, less or equal")
5932 (conditional-branch-f fb u OP_07 Fu "float branch unordered")
5933 (conditional-branch-f fb o OP_07 Fo "float branch ordered")
5935 (define-pmacro (ctrlr-branch-semantics cond ccond)
5936 (sequence ((SI tmp))
5937 (set tmp (sub (spr-lcr) 1))
5944 (set pc (spr-lr))))))
5948 "LCR conditional branch to lr"
5949 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
5950 (FR400-MAJOR B-2) (FR450-MAJOR B-2))
5951 ("bctrlr$pack $ccond,$hint")
5952 (+ pack (cond-null) (ICCi_2-null) OP_0E hint OPE3_01 ccond (s12-null))
5954 (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
5955 (ctrlr-branch-semantics (const BI 1) ccond))
5956 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5957 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5960 (define-pmacro (conditional-branch-cclr prefix cc i-f op ope cond attr comment)
5961 (dni (.sym prefix cc lr)
5963 ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
5964 (FR400-MAJOR B-3) (FR450-MAJOR B-3) attr)
5965 (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$hint")
5966 (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope
5967 (ccond-null) (s12-null))
5969 (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
5970 (if (cond (.sym i-f CCi_2)) (set pc (spr-lr))))
5971 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5972 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5977 "integer cclr branch always"
5978 ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
5979 (FR400-MAJOR B-3) (FR450-MAJOR B-3))
5980 "bralr$pack$hint_taken"
5981 (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_02 (ccond-null) (s12-null))
5983 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
5985 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5986 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5990 "integer cclr branch never"
5991 ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
5992 (FR400-MAJOR B-3) (FR450-MAJOR B-3))
5993 "bnolr$pack$hint_not_taken"
5994 (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_02 (ccond-null) (s12-null))
5995 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
5996 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5997 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6000 (conditional-branch-cclr b eq I OP_0E OPE3_02 Ieq NA "integer cclr branch equal")
6001 (conditional-branch-cclr b ne I OP_0E OPE3_02 Ine NA "integer cclr branch not equal")
6002 (conditional-branch-cclr b le I OP_0E OPE3_02 Ile NA "integer cclr branch less or equal")
6003 (conditional-branch-cclr b gt I OP_0E OPE3_02 Igt NA "integer cclr branch greater")
6004 (conditional-branch-cclr b lt I OP_0E OPE3_02 Ilt NA "integer cclr branch less")
6005 (conditional-branch-cclr b ge I OP_0E OPE3_02 Ige NA "integer cclr branch greater or equal")
6006 (conditional-branch-cclr b ls I OP_0E OPE3_02 Ils NA "integer cclr branch less or equal unsigned")
6007 (conditional-branch-cclr b hi I OP_0E OPE3_02 Ihi NA "integer cclr branch greater unsigned")
6008 (conditional-branch-cclr b c I OP_0E OPE3_02 Ic NA "integer cclr branch carry set")
6009 (conditional-branch-cclr b nc I OP_0E OPE3_02 Inc NA "integer cclr branch carry clear")
6010 (conditional-branch-cclr b n I OP_0E OPE3_02 In NA "integer cclr branch negative")
6011 (conditional-branch-cclr b p I OP_0E OPE3_02 Ip NA "integer cclr branch positive")
6012 (conditional-branch-cclr b v I OP_0E OPE3_02 Iv NA "integer cclr branch overflow set")
6013 (conditional-branch-cclr b nv I OP_0E OPE3_02 Inv NA "integer cclr branch overflow clear")
6016 "float cclr branch always"
6017 ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
6018 (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
6019 "fbralr$pack$hint_taken"
6020 (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_06 (ccond-null) (s12-null))
6022 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6024 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6025 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6029 "float cclr branch never"
6030 ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
6031 (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
6032 "fbnolr$pack$hint_not_taken"
6033 (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_06 (ccond-null) (s12-null))
6034 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6035 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6036 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6039 (conditional-branch-cclr fb eq F OP_0E OPE3_06 Feq FR-ACCESS "float cclr branch equal")
6040 (conditional-branch-cclr fb ne F OP_0E OPE3_06 Fne FR-ACCESS "float cclr branch not equal")
6041 (conditional-branch-cclr fb lg F OP_0E OPE3_06 Flg FR-ACCESS "float branch less or greater")
6042 (conditional-branch-cclr fb ue F OP_0E OPE3_06 Fue FR-ACCESS "float branch unordered or equal")
6043 (conditional-branch-cclr fb ul F OP_0E OPE3_06 Ful FR-ACCESS "float branch unordered or less")
6044 (conditional-branch-cclr fb ge F OP_0E OPE3_06 Fge FR-ACCESS "float branch greater or equal")
6045 (conditional-branch-cclr fb lt F OP_0E OPE3_06 Flt FR-ACCESS "float branch less")
6046 (conditional-branch-cclr fb uge F OP_0E OPE3_06 Fuge FR-ACCESS "float branch unordered, greater, equal")
6047 (conditional-branch-cclr fb ug F OP_0E OPE3_06 Fug FR-ACCESS "float branch unordered or greater")
6048 (conditional-branch-cclr fb le F OP_0E OPE3_06 Fle FR-ACCESS "float branch less or equal")
6049 (conditional-branch-cclr fb gt F OP_0E OPE3_06 Fgt FR-ACCESS "float branch greater")
6050 (conditional-branch-cclr fb ule F OP_0E OPE3_06 Fule FR-ACCESS "float branch unordered, less or equal")
6051 (conditional-branch-cclr fb u F OP_0E OPE3_06 Fu FR-ACCESS "float branch unordered")
6052 (conditional-branch-cclr fb o F OP_0E OPE3_06 Fo FR-ACCESS "float branch ordered")
6054 (define-pmacro (conditional-branch-ctrlr prefix cc i-f op ope cond attr comment)
6055 (dni (.sym prefix cc lr)
6057 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6058 (FR400-MAJOR B-2) (FR450-MAJOR B-2) attr)
6059 (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$ccond,$hint")
6060 (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope ccond (s12-null))
6062 (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
6063 (ctrlr-branch-semantics (cond (.sym i-f CCi_2)) ccond))
6064 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6065 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6070 "integer ctrlr branch always"
6071 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6072 (FR400-MAJOR B-2) (FR450-MAJOR B-2))
6073 "bcralr$pack $ccond$hint_taken"
6074 (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_03 ccond (s12-null))
6076 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6077 (ctrlr-branch-semantics (const BI 1) ccond))
6078 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6079 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6083 "integer ctrlr branch never"
6084 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6085 (FR400-MAJOR B-2) (FR450-MAJOR B-2))
6086 "bcnolr$pack$hint_not_taken"
6087 (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_03 (ccond-null) (s12-null))
6089 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6090 (ctrlr-branch-semantics (const BI 0) ccond))
6091 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6092 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6095 (conditional-branch-ctrlr bc eq I OP_0E OPE3_03 Ieq NA "integer ctrlr branch equal")
6096 (conditional-branch-ctrlr bc ne I OP_0E OPE3_03 Ine NA "integer ctrlr branch not equal")
6097 (conditional-branch-ctrlr bc le I OP_0E OPE3_03 Ile NA "integer ctrlr branch less equal")
6098 (conditional-branch-ctrlr bc gt I OP_0E OPE3_03 Igt NA "integer ctrlr branch greater")
6099 (conditional-branch-ctrlr bc lt I OP_0E OPE3_03 Ilt NA "integer ctrlr branch less")
6100 (conditional-branch-ctrlr bc ge I OP_0E OPE3_03 Ige NA "integer ctrlr branch greater equal")
6101 (conditional-branch-ctrlr bc ls I OP_0E OPE3_03 Ils NA "integer ctrlr branch less equal unsigned")
6102 (conditional-branch-ctrlr bc hi I OP_0E OPE3_03 Ihi NA "integer ctrlr branch greater unsigned")
6103 (conditional-branch-ctrlr bc c I OP_0E OPE3_03 Ic NA "integer ctrlr branch carry set")
6104 (conditional-branch-ctrlr bc nc I OP_0E OPE3_03 Inc NA "integer ctrlr branch carry clear")
6105 (conditional-branch-ctrlr bc n I OP_0E OPE3_03 In NA "integer ctrlr branch negative")
6106 (conditional-branch-ctrlr bc p I OP_0E OPE3_03 Ip NA "integer ctrlr branch positive")
6107 (conditional-branch-ctrlr bc v I OP_0E OPE3_03 Iv NA "integer ctrlr branch overflow set")
6108 (conditional-branch-ctrlr bc nv I OP_0E OPE3_03 Inv NA "integer ctrlr branch overflow clear")
6111 "float ctrlr branch always"
6112 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6113 (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
6114 "fcbralr$pack $ccond$hint_taken"
6115 (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_07 ccond (s12-null))
6117 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6118 (ctrlr-branch-semantics (const BI 1) ccond))
6119 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6120 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6124 "float ctrlr branch never"
6125 ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6126 (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
6127 "fcbnolr$pack$hint_not_taken"
6128 (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_07 (ccond-null) (s12-null))
6130 (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6131 (ctrlr-branch-semantics (const BI 0) ccond))
6132 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6133 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6136 (conditional-branch-ctrlr fcb eq F OP_0E OPE3_07 Feq FR-ACCESS "float cclr branch equal")
6137 (conditional-branch-ctrlr fcb ne F OP_0E OPE3_07 Fne FR-ACCESS "float cclr branch not equal")
6138 (conditional-branch-ctrlr fcb lg F OP_0E OPE3_07 Flg FR-ACCESS "float branch less or greater")
6139 (conditional-branch-ctrlr fcb ue F OP_0E OPE3_07 Fue FR-ACCESS "float branch unordered or equal")
6140 (conditional-branch-ctrlr fcb ul F OP_0E OPE3_07 Ful FR-ACCESS "float branch unordered or less")
6141 (conditional-branch-ctrlr fcb ge F OP_0E OPE3_07 Fge FR-ACCESS "float branch greater or equal")
6142 (conditional-branch-ctrlr fcb lt F OP_0E OPE3_07 Flt FR-ACCESS "float branch less")
6143 (conditional-branch-ctrlr fcb uge F OP_0E OPE3_07 Fuge FR-ACCESS "float branch unordered, greater, equal")
6144 (conditional-branch-ctrlr fcb ug F OP_0E OPE3_07 Fug FR-ACCESS "float branch unordered or greater")
6145 (conditional-branch-ctrlr fcb le F OP_0E OPE3_07 Fle FR-ACCESS "float branch less or equal")
6146 (conditional-branch-ctrlr fcb gt F OP_0E OPE3_07 Fgt FR-ACCESS "float branch greater")
6147 (conditional-branch-ctrlr fcb ule F OP_0E OPE3_07 Fule FR-ACCESS "float branch unordered, less or equal")
6148 (conditional-branch-ctrlr fcb u F OP_0E OPE3_07 Fu FR-ACCESS "float branch unordered")
6149 (conditional-branch-ctrlr fcb o F OP_0E OPE3_07 Fo FR-ACCESS "float branch ordered")
6151 (define-pmacro (jump-and-link-semantics base offset LI)
6154 (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1))
6155 ; Target address gets aligned here
6156 (set pc (and (add base offset) #xfffffffc))
6157 (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6162 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6163 (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6164 "jmpl$pack @($GRi,$GRj)"
6165 (+ pack (misc-null-1) (LI-off) OP_0C GRi (misc-null-2) GRj)
6166 (jump-and-link-semantics GRi GRj LI)
6167 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6168 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6171 (dann callann "call annotation" SI "call_annotation" "at")
6175 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6176 (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6177 "calll$pack $callann($GRi,$GRj)"
6178 (+ pack (misc-null-1) (LI-on) OP_0C GRi (misc-null-2) GRj)
6179 (jump-and-link-semantics GRi GRj LI)
6180 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6181 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6185 "jump immediate and link"
6186 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6187 (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6188 "jmpil$pack @($GRi,$s12)"
6189 (+ pack (misc-null-1) (LI-off) OP_0D GRi s12)
6190 (jump-and-link-semantics GRi s12 LI)
6191 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6192 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6196 "call immediate and link"
6197 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6198 (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6199 "callil$pack @($GRi,$s12)"
6200 (+ pack (misc-null-1) (LI-on) OP_0D GRi s12)
6201 (jump-and-link-semantics GRi s12 LI)
6202 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6203 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6208 ((UNIT B0) (FR500-MAJOR B-4) (FR550-MAJOR B-4)
6209 (FR400-MAJOR B-4) (FR450-MAJOR B-4))
6210 "call$pack $label24"
6211 (+ pack OP_0F label24)
6213 (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1)
6215 (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6216 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6217 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6222 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6223 (FR400-MAJOR C-2) (FR450-MAJOR C-2) PRIVILEGED)
6225 (+ pack (misc-null-1) debug OP_05 (rs-null) (s12-null))
6226 ; frv_rett handles operating vs user mode
6228 (set pc (c-call UWI "frv_rett" pc debug))
6229 (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6234 "run exception instruction"
6235 ((UNIT C) (FR500-MAJOR C-1) (MACH frv) PRIVILEGED)
6237 (+ pack (rd-null) OP_37 eir (s12-null))
6242 (define-pmacro (trap-semantics cond base offset)
6245 ; This is defered to frv_itrap because for the breakpoint
6246 ; case we want to change as little of the machine state as
6253 ; SR0 through SR3=GR4 through GR7
6254 ; TBR.TT=0x80 + ((GRi + s12) & 0x7f)
6256 ; We still should indicate what is modified by this insn.
6257 (clobber (spr-pcsr))
6261 (if (ne psr_esr (const 0))
6266 (clobber (spr-sr3))))
6267 ; frv_itrap handles operating vs user mode
6268 (c-call VOID "frv_itrap" pc base offset)))
6271 (define-pmacro (trap-r prefix cc i-f op ope cond attr comment)
6272 (dni (.sym prefix cc)
6274 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6275 (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
6276 (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$GRj")
6277 (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi (misc-null-3) ope GRj)
6278 (trap-semantics (cond (.sym i-f CCi_2)) GRi GRj)
6279 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6280 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6285 "integer trap always"
6286 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6287 (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6288 "tra$pack $GRi,$GRj"
6289 (+ pack ICC_ra (ICCi_2-null) OP_04 GRi (misc-null-3) OPE4_0 GRj)
6290 (trap-semantics (const BI 1) GRi GRj)
6291 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6292 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6296 "integer trap never"
6297 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6298 (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6300 (+ pack ICC_nev (ICCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_0 (GRj-null))
6301 (trap-semantics (const BI 0) GRi GRj)
6302 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6303 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6306 (trap-r t eq I OP_04 OPE4_0 Ieq NA "integer trap equal")
6307 (trap-r t ne I OP_04 OPE4_0 Ine NA "integer trap not equal")
6308 (trap-r t le I OP_04 OPE4_0 Ile NA "integer trap less or equal")
6309 (trap-r t gt I OP_04 OPE4_0 Igt NA "integer trap greater")
6310 (trap-r t lt I OP_04 OPE4_0 Ilt NA "integer trap less")
6311 (trap-r t ge I OP_04 OPE4_0 Ige NA "integer trap greater or equal")
6312 (trap-r t ls I OP_04 OPE4_0 Ils NA "integer trap less or equal unsigned")
6313 (trap-r t hi I OP_04 OPE4_0 Ihi NA "integer trap greater unsigned")
6314 (trap-r t c I OP_04 OPE4_0 Ic NA "integer trap carry set")
6315 (trap-r t nc I OP_04 OPE4_0 Inc NA "integer trap carry clear")
6316 (trap-r t n I OP_04 OPE4_0 In NA "integer trap negative")
6317 (trap-r t p I OP_04 OPE4_0 Ip NA "integer trap positive")
6318 (trap-r t v I OP_04 OPE4_0 Iv NA "integer trap overflow set")
6319 (trap-r t nv I OP_04 OPE4_0 Inv NA "integer trap overflow clear")
6323 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6324 (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6325 "ftra$pack $GRi,$GRj"
6326 (+ pack FCC_ra (FCCi_2-null) OP_04 GRi (misc-null-3) OPE4_1 GRj)
6327 (trap-semantics (const BI 1) GRi GRj)
6328 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6329 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6334 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6335 (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6337 (+ pack FCC_nev (FCCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_1 (GRj-null))
6338 (trap-semantics (const BI 0) GRi GRj)
6339 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6340 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6343 (trap-r ft ne F OP_04 OPE4_1 Fne FR-ACCESS "float trap not equal")
6344 (trap-r ft eq F OP_04 OPE4_1 Feq FR-ACCESS "float trap equal")
6345 (trap-r ft lg F OP_04 OPE4_1 Flg FR-ACCESS "float trap greater or less")
6346 (trap-r ft ue F OP_04 OPE4_1 Fue FR-ACCESS "float trap unordered or equal")
6347 (trap-r ft ul F OP_04 OPE4_1 Ful FR-ACCESS "float trap unordered or less")
6348 (trap-r ft ge F OP_04 OPE4_1 Fge FR-ACCESS "float trap greater or equal")
6349 (trap-r ft lt F OP_04 OPE4_1 Flt FR-ACCESS "float trap less")
6350 (trap-r ft uge F OP_04 OPE4_1 Fuge FR-ACCESS "float trap unordered greater or equal")
6351 (trap-r ft ug F OP_04 OPE4_1 Fug FR-ACCESS "float trap unordered or greater")
6352 (trap-r ft le F OP_04 OPE4_1 Fle FR-ACCESS "float trap less or equal")
6353 (trap-r ft gt F OP_04 OPE4_1 Fgt FR-ACCESS "float trap greater")
6354 (trap-r ft ule F OP_04 OPE4_1 Fule FR-ACCESS "float trap unordered less or equal")
6355 (trap-r ft u F OP_04 OPE4_1 Fu FR-ACCESS "float trap unordered")
6356 (trap-r ft o F OP_04 OPE4_1 Fo FR-ACCESS "float trap ordered")
6358 (define-pmacro (trap-immed prefix cc i-f op cond attr comment)
6359 (dni (.sym prefix cc)
6361 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6362 (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
6363 (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$s12")
6364 (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi s12)
6365 (trap-semantics (cond (.sym i-f CCi_2)) GRi s12)
6366 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6367 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6372 "integer trap always"
6373 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6374 (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6375 "tira$pack $GRi,$s12"
6376 (+ pack ICC_ra (ICCi_2-null) OP_1C GRi s12)
6377 (trap-semantics (const BI 1) GRi s12)
6378 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6379 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6383 "integer trap never"
6384 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6385 (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6387 (+ pack ICC_nev (ICCi_2-null) OP_1C (GRi-null) (s12-null))
6388 (trap-semantics (const BI 0) GRi s12)
6389 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6390 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6393 (trap-immed ti eq I OP_1C Ieq NA "integer trap equal")
6394 (trap-immed ti ne I OP_1C Ine NA "integer trap not equal")
6395 (trap-immed ti le I OP_1C Ile NA "integer trap less or equal")
6396 (trap-immed ti gt I OP_1C Igt NA "integer trap greater")
6397 (trap-immed ti lt I OP_1C Ilt NA "integer trap less")
6398 (trap-immed ti ge I OP_1C Ige NA "integer trap greater or equal")
6399 (trap-immed ti ls I OP_1C Ils NA "integer trap less or equal unsigned")
6400 (trap-immed ti hi I OP_1C Ihi NA "integer trap greater unsigned")
6401 (trap-immed ti c I OP_1C Ic NA "integer trap carry set")
6402 (trap-immed ti nc I OP_1C Inc NA "integer trap carry clear")
6403 (trap-immed ti n I OP_1C In NA "integer trap negative")
6404 (trap-immed ti p I OP_1C Ip NA "integer trap positive")
6405 (trap-immed ti v I OP_1C Iv NA "integer trap overflow set")
6406 (trap-immed ti nv I OP_1C Inv NA "integer trap overflow clear")
6410 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6411 (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6412 "ftira$pack $GRi,$s12"
6413 (+ pack FCC_ra (ICCi_2-null) OP_1D GRi s12)
6414 (trap-semantics (const BI 1) GRi s12)
6415 ((fr400 (unit u-trap))
6416 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6421 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6422 (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6424 (+ pack FCC_nev (FCCi_2-null) OP_1D (GRi-null) (s12-null))
6425 (trap-semantics (const BI 0) GRi s12)
6426 ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6427 (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6430 (trap-immed fti ne F OP_1D Fne FR-ACCESS "float trap not equal")
6431 (trap-immed fti eq F OP_1D Feq FR-ACCESS "float trap equal")
6432 (trap-immed fti lg F OP_1D Flg FR-ACCESS "float trap greater or less")
6433 (trap-immed fti ue F OP_1D Fue FR-ACCESS "float trap unordered or equal")
6434 (trap-immed fti ul F OP_1D Ful FR-ACCESS "float trap unordered or less")
6435 (trap-immed fti ge F OP_1D Fge FR-ACCESS "float trap greater or equal")
6436 (trap-immed fti lt F OP_1D Flt FR-ACCESS "float trap less")
6437 (trap-immed fti uge F OP_1D Fuge FR-ACCESS "float trap unordered greater or equal")
6438 (trap-immed fti ug F OP_1D Fug FR-ACCESS "float trap unordered or greater")
6439 (trap-immed fti le F OP_1D Fle FR-ACCESS "float trap less or equal")
6440 (trap-immed fti gt F OP_1D Fgt FR-ACCESS "float trap greater")
6441 (trap-immed fti ule F OP_1D Fule FR-ACCESS "float trap unordered less or equal")
6442 (trap-immed fti u F OP_1D Fu FR-ACCESS "float trap unordered")
6443 (trap-immed fti o F OP_1D Fo FR-ACCESS "float trap ordered")
6447 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6448 (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6450 (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_3 (GRj-null))
6452 ; This is defered to frv_break because for the breakpoint
6453 ; case we want to change as little of the machine state as
6463 ; We still should indicate what is modified by this insn.
6464 (clobber (spr-bpcsr))
6470 (c-call VOID "frv_break"))
6476 ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6477 (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6479 (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_2 (GRj-null))
6480 (c-call VOID "frv_mtrap")
6484 (define-pmacro (condition-code-logic name operation ope comment)
6487 ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
6488 (FR400-MAJOR B-6) (FR450-MAJOR B-6))
6489 (.str name "$pack $CRi,$CRj,$CRk")
6490 (+ pack (misc-null-6) CRk OP_0A (misc-null-7) CRi ope (misc-null-8) CRj)
6491 (set CRk (c-call UQI "@cpu@_cr_logic" operation CRi CRj))
6495 (define-pmacro (op-andcr) 0)
6496 (define-pmacro (op-orcr) 1)
6497 (define-pmacro (op-xorcr) 2)
6498 (define-pmacro (op-nandcr) 3)
6499 (define-pmacro (op-norcr) 4)
6500 (define-pmacro (op-andncr) 5)
6501 (define-pmacro (op-orncr) 6)
6502 (define-pmacro (op-nandncr) 7)
6503 (define-pmacro (op-norncr) 8)
6505 (define-pmacro (cr-true) 3)
6506 (define-pmacro (cr-false) 2)
6507 (define-pmacro (cr-undefined) 0)
6509 (condition-code-logic andcr (op-andcr) OPE1_08 "and condition code regs")
6510 (condition-code-logic orcr (op-orcr) OPE1_09 "or condition code regs")
6511 (condition-code-logic xorcr (op-xorcr) OPE1_0A "xor condition code regs")
6512 (condition-code-logic nandcr (op-nandcr) OPE1_0C "nand condition code regs")
6513 (condition-code-logic norcr (op-norcr) OPE1_0D "nor condition code regs")
6514 (condition-code-logic andncr (op-andncr) OPE1_10 "andn condition code regs")
6515 (condition-code-logic orncr (op-orncr) OPE1_11 "orn condition code regs")
6516 (condition-code-logic nandncr (op-nandncr) OPE1_14 "nandn condition code regs")
6517 (condition-code-logic norncr (op-norncr) OPE1_15 "norn condition code regs")
6520 ("not cccr register")
6521 ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
6522 (FR400-MAJOR B-6) (FR450-MAJOR B-6))
6523 (.str notcr "$pack $CRj,$CRk")
6524 (+ pack (misc-null-6) CRk OP_0A (rs-null) OPE1_0B (misc-null-8) CRj)
6525 (set CRk (xor CRj 1))
6529 (define-pmacro (check-semantics cond cr)
6530 (if cond (set cr (cr-true)) (set cr (cr-false)))
6533 (define-pmacro (check-int-condition-code prefix cc op cond comment)
6534 (dni (.sym prefix cc)
6536 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6537 (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6538 (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int")
6539 (+ pack (.sym ICC_ cc) CRj_int op (misc-null-5) ICCi_3)
6540 (check-semantics (cond ICCi_3) CRj_int)
6541 ((fr400 (unit u-check)) (fr450 (unit u-check))
6542 (fr500 (unit u-check)) (fr550 (unit u-check)))
6547 "check integer cc always"
6548 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6549 (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6550 "ckra$pack $CRj_int"
6551 (+ pack ICC_ra CRj_int OP_08 (misc-null-5) (ICCi_3-null))
6552 (check-semantics (const BI 1) CRj_int)
6553 ((fr400 (unit u-check)) (fr450 (unit u-check))
6554 (fr500 (unit u-check)) (fr550 (unit u-check)))
6558 "check integer cc never"
6559 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6560 (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6561 "ckno$pack $CRj_int"
6562 (+ pack ICC_nev CRj_int OP_08 (misc-null-5) (ICCi_3-null))
6563 (check-semantics (const BI 0) CRj_int)
6564 ((fr400 (unit u-check)) (fr450 (unit u-check))
6565 (fr500 (unit u-check)) (fr550 (unit u-check)))
6568 (check-int-condition-code ck eq OP_08 Ieq "check integer cc equal")
6569 (check-int-condition-code ck ne OP_08 Ine "check integer cc not equal")
6570 (check-int-condition-code ck le OP_08 Ile "check integer cc less or equal")
6571 (check-int-condition-code ck gt OP_08 Igt "check integer cc greater")
6572 (check-int-condition-code ck lt OP_08 Ilt "check integer cc less")
6573 (check-int-condition-code ck ge OP_08 Ige "check integer cc greater or equal")
6574 (check-int-condition-code ck ls OP_08 Ils "check integer cc less or equal unsigned")
6575 (check-int-condition-code ck hi OP_08 Ihi "check integer cc greater unsigned")
6576 (check-int-condition-code ck c OP_08 Ic "check integer cc carry set")
6577 (check-int-condition-code ck nc OP_08 Inc "check integer cc carry clear")
6578 (check-int-condition-code ck n OP_08 In "check integer cc negative")
6579 (check-int-condition-code ck p OP_08 Ip "check integer cc positive")
6580 (check-int-condition-code ck v OP_08 Iv "check integer cc overflow set")
6581 (check-int-condition-code ck nv OP_08 Inv "check integer cc overflow clear")
6583 (define-pmacro (check-float-condition-code prefix cc op cond comment)
6584 (dni (.sym prefix cc)
6586 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6587 (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6588 (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float")
6589 (+ pack (.sym FCC_ cc) CRj_float op (misc-null-5) FCCi_3)
6590 (check-semantics (cond FCCi_3) CRj_float)
6591 ((fr400 (unit u-check)) (fr450 (unit u-check))
6592 (fr500 (unit u-check)) (fr550 (unit u-check)))
6597 "check float cc always"
6598 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6599 (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6600 "fckra$pack $CRj_float"
6601 (+ pack FCC_ra CRj_float OP_09 (misc-null-5) FCCi_3)
6602 (check-semantics (const BI 1) CRj_float)
6603 ((fr400 (unit u-check)) (fr450 (unit u-check))
6604 (fr500 (unit u-check)) (fr550 (unit u-check)))
6608 "check float cc never"
6609 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6610 (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6611 "fckno$pack $CRj_float"
6612 (+ pack FCC_nev CRj_float OP_09 (misc-null-5) FCCi_3)
6613 (check-semantics (const BI 0) CRj_float)
6614 ((fr400 (unit u-check)) (fr450 (unit u-check))
6615 (fr500 (unit u-check)) (fr550 (unit u-check)))
6618 (check-float-condition-code fck ne OP_09 Fne "check float cc not equal")
6619 (check-float-condition-code fck eq OP_09 Feq "check float cc equal")
6620 (check-float-condition-code fck lg OP_09 Flg "check float cc greater or less")
6621 (check-float-condition-code fck ue OP_09 Fue "check float cc unordered or equal")
6622 (check-float-condition-code fck ul OP_09 Ful "check float cc unordered or less")
6623 (check-float-condition-code fck ge OP_09 Fge "check float cc greater or equal")
6624 (check-float-condition-code fck lt OP_09 Flt "check float cc less")
6625 (check-float-condition-code fck uge OP_09 Fuge "check float cc unordered greater or equal")
6626 (check-float-condition-code fck ug OP_09 Fug "check float cc unordered or greater")
6627 (check-float-condition-code fck le OP_09 Fle "check float cc less or equal")
6628 (check-float-condition-code fck gt OP_09 Fgt "check float cc greater")
6629 (check-float-condition-code fck ule OP_09 Fule "check float cc unordered less or equal")
6630 (check-float-condition-code fck u OP_09 Fu "check float cc unordered")
6631 (check-float-condition-code fck o OP_09 Fo "check float cc ordered")
6633 (define-pmacro (conditional-check-int-condition-code prefix cc op ope test comment)
6634 (dni (.sym prefix cc)
6636 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6637 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6638 (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int,$CCi,$cond")
6639 (+ pack (.sym ICC_ cc) CRj_int op (rs-null) CCi cond ope
6640 (misc-null-9) ICCi_3)
6641 (if (eq CCi (or cond 2))
6642 (check-semantics (test ICCi_3) CRj_int)
6643 (set CRj_int (cr-undefined)))
6644 ((fr400 (unit u-check)) (fr450 (unit u-check))
6645 (fr500 (unit u-check)) (fr550 (unit u-check)))
6650 "conditional check integer cc always"
6651 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6652 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6653 "cckra$pack $CRj_int,$CCi,$cond"
6654 (+ pack ICC_ra CRj_int OP_6A (rs-null) CCi cond OPE4_0
6655 (misc-null-9) (ICCi_3-null))
6656 (if (eq CCi (or cond 2))
6657 (check-semantics (const BI 1) CRj_int)
6658 (set CRj_int (cr-undefined)))
6659 ((fr400 (unit u-check)) (fr450 (unit u-check))
6660 (fr500 (unit u-check)) (fr550 (unit u-check)))
6664 "conditional check integer cc never"
6665 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6666 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6667 "cckno$pack $CRj_int,$CCi,$cond"
6668 (+ pack ICC_nev CRj_int OP_6A (rs-null) CCi cond OPE4_0
6669 (misc-null-9) (ICCi_3-null))
6670 (if (eq CCi (or cond 2))
6671 (check-semantics (const BI 0) CRj_int)
6672 (set CRj_int (cr-undefined)))
6673 ((fr400 (unit u-check)) (fr450 (unit u-check))
6674 (fr500 (unit u-check)) (fr550 (unit u-check)))
6677 (conditional-check-int-condition-code cck eq OP_6A OPE4_0 Ieq "check integer cc equal")
6678 (conditional-check-int-condition-code cck ne OP_6A OPE4_0 Ine "check integer cc not equal")
6679 (conditional-check-int-condition-code cck le OP_6A OPE4_0 Ile "check integer cc less or equal")
6680 (conditional-check-int-condition-code cck gt OP_6A OPE4_0 Igt "check integer cc greater")
6681 (conditional-check-int-condition-code cck lt OP_6A OPE4_0 Ilt "check integer cc less")
6682 (conditional-check-int-condition-code cck ge OP_6A OPE4_0 Ige "check integer cc greater or equal")
6683 (conditional-check-int-condition-code cck ls OP_6A OPE4_0 Ils "check integer cc less or equal unsigned")
6684 (conditional-check-int-condition-code cck hi OP_6A OPE4_0 Ihi "check integer cc greater unsigned")
6685 (conditional-check-int-condition-code cck c OP_6A OPE4_0 Ic "check integer cc carry set")
6686 (conditional-check-int-condition-code cck nc OP_6A OPE4_0 Inc "check integer cc carry clear")
6687 (conditional-check-int-condition-code cck n OP_6A OPE4_0 In "check integer cc negative")
6688 (conditional-check-int-condition-code cck p OP_6A OPE4_0 Ip "check integer cc positive")
6689 (conditional-check-int-condition-code cck v OP_6A OPE4_0 Iv "check integer cc overflow set")
6690 (conditional-check-int-condition-code cck nv OP_6A OPE4_0 Inv "check integer cc overflow clear")
6692 (define-pmacro (conditional-check-float-condition-code prefix cc op ope test comment)
6693 (dni (.sym prefix cc)
6695 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6696 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6697 (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float,$CCi,$cond")
6698 (+ pack (.sym FCC_ cc) CRj_float op (rs-null) CCi cond ope
6699 (misc-null-9) FCCi_3)
6700 (if (eq CCi (or cond 2))
6701 (check-semantics (test FCCi_3) CRj_float)
6702 (set CRj_float (cr-undefined)))
6703 ((fr400 (unit u-check)) (fr450 (unit u-check))
6704 (fr500 (unit u-check)) (fr550 (unit u-check)))
6709 "conditional check float cc always"
6710 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6711 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6712 "cfckra$pack $CRj_float,$CCi,$cond"
6713 (+ pack FCC_ra CRj_float OP_6A (rs-null) CCi cond OPE4_1
6714 (misc-null-9) (FCCi_3-null))
6715 (if (eq CCi (or cond 2))
6716 (check-semantics (const BI 1) CRj_float)
6717 (set CRj_float (cr-undefined)))
6718 ((fr400 (unit u-check)) (fr450 (unit u-check))
6719 (fr500 (unit u-check)) (fr550 (unit u-check)))
6723 "conditional check float cc never"
6724 ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6725 (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6726 "cfckno$pack $CRj_float,$CCi,$cond"
6727 (+ pack FCC_nev CRj_float OP_6A (rs-null) CCi cond OPE4_1
6728 (misc-null-9) (FCCi_3-null))
6729 (if (eq CCi (or cond 2))
6730 (check-semantics (const BI 0) CRj_float)
6731 (set CRj_float (cr-undefined)))
6732 ((fr400 (unit u-check)) (fr450 (unit u-check))
6733 (fr500 (unit u-check)) (fr550 (unit u-check)))
6736 (conditional-check-float-condition-code cfck ne OP_6A OPE4_1 Fne "check float cc not equal")
6737 (conditional-check-float-condition-code cfck eq OP_6A OPE4_1 Feq "check float cc equal")
6738 (conditional-check-float-condition-code cfck lg OP_6A OPE4_1 Flg "check float cc greater or less")
6739 (conditional-check-float-condition-code cfck ue OP_6A OPE4_1 Fue "check float cc unordered or equal")
6740 (conditional-check-float-condition-code cfck ul OP_6A OPE4_1 Ful "check float cc unordered or less")
6741 (conditional-check-float-condition-code cfck ge OP_6A OPE4_1 Fge "check float cc greater or equal")
6742 (conditional-check-float-condition-code cfck lt OP_6A OPE4_1 Flt "check float cc less")
6743 (conditional-check-float-condition-code cfck uge OP_6A OPE4_1 Fuge "check float cc unordered greater or equal")
6744 (conditional-check-float-condition-code cfck ug OP_6A OPE4_1 Fug "check float cc unordered or greater")
6745 (conditional-check-float-condition-code cfck le OP_6A OPE4_1 Fle "check float cc less or equal")
6746 (conditional-check-float-condition-code cfck gt OP_6A OPE4_1 Fgt "check float cc greater")
6747 (conditional-check-float-condition-code cfck ule OP_6A OPE4_1 Fule "check float cc unordered less or equal")
6748 (conditional-check-float-condition-code cfck u OP_6A OPE4_1 Fu "check float cc unordered")
6749 (conditional-check-float-condition-code cfck o OP_6A OPE4_1 Fo "check float cc ordered")
6752 "conditional jump and link"
6753 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6754 (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
6755 "cjmpl$pack @($GRi,$GRj),$CCi,$cond"
6756 (+ pack (misc-null-1) (LI-off) OP_6A GRi CCi cond OPE4_2 GRj)
6757 (if (eq CCi (or cond 2))
6758 (jump-and-link-semantics GRi GRj LI))
6759 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6760 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6764 "conditional call and link"
6765 ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6766 (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
6767 "ccalll$pack @($GRi,$GRj),$CCi,$cond"
6768 (+ pack (misc-null-1) (LI-on) OP_6A GRi CCi cond OPE4_2 GRj)
6769 (if (eq CCi (or cond 2))
6770 (jump-and-link-semantics GRi GRj LI))
6771 ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6772 (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6775 (define-pmacro (cache-invalidate name cache all op ope profile comment)
6778 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6779 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6780 (.str name "$pack @($GRi,$GRj)")
6781 (+ pack (rd-null) op GRi ope GRj)
6782 (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) all)
6787 (cache-invalidate ici insn 0 OP_03 OPE1_38
6788 ((fr400 (unit u-ici)) (fr450 (unit u-ici))
6789 (fr500 (unit u-ici)) (fr550 (unit u-ici)))
6790 "invalidate insn cache")
6791 (cache-invalidate dci data 0 OP_03 OPE1_3C
6792 ((fr400 (unit u-dci)) (fr450 (unit u-dci))
6793 (fr500 (unit u-dci)) (fr550 (unit u-dci)))
6794 "invalidate data cache")
6796 (define-pmacro (cache-invalidate-entry name cache op ope profile comment)
6799 ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
6800 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6801 (.str name "$pack @($GRi,$GRj),$ae")
6802 (+ pack (misc-null-1) ae op GRi ope GRj)
6804 (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) -1) ; Invalid ae setting for this insn
6805 (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) ae))
6810 (cache-invalidate-entry icei insn OP_03 OPE1_39
6811 ((fr400 (unit u-ici)) (fr450 (unit u-ici))
6812 (fr550 (unit u-ici)))
6813 "invalidate insn cache entry")
6814 (cache-invalidate-entry dcei data OP_03 OPE1_3A
6815 ((fr400 (unit u-dci)) (fr450 (unit u-dci))
6816 (fr550 (unit u-dci)))
6817 "invalidate data cache entry")
6821 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6822 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6823 "dcf$pack @($GRi,$GRj)"
6824 (+ pack (rd-null) OP_03 GRi OPE1_3D GRj)
6825 (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) 0)
6826 ((fr400 (unit u-dcf)) (fr450 (unit u-dcf))
6827 (fr500 (unit u-dcf)) (fr550 (unit u-dcf)))
6831 "Data cache entry flush"
6832 ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
6833 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6834 "dcef$pack @($GRi,$GRj),$ae"
6835 (+ pack (misc-null-1) ae OP_03 GRi OPE1_3B GRj)
6837 (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) -1)
6838 (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) ae))
6839 ((fr400 (unit u-dcf)) (fr450 (unit u-dcf)) (fr550 (unit u-dcf)))
6842 (define-pmacro (write-TLB name insn op ope comment)
6845 ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
6846 (.str insn "$pack $GRk,@($GRi,$GRj)")
6847 (+ pack GRk op GRi ope GRj)
6853 (write-TLB witlb witlb OP_03 OPE1_32 "write for insn TLB")
6854 (write-TLB wdtlb wdtlb OP_03 OPE1_36 "write for data TLB")
6856 (define-pmacro (invalidate-TLB name insn op ope comment)
6859 ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
6860 (.str insn "$pack @($GRi,$GRj)")
6861 (+ pack (rd-null) op GRi ope GRj)
6867 (invalidate-TLB itlbi itlbi OP_03 OPE1_33 "invalidate insn TLB")
6868 (invalidate-TLB dtlbi dtlbi OP_03 OPE1_37 "invalidate data TLB")
6870 (define-pmacro (cache-preload name cache pipe attrs op ope profile comment)
6873 (.splice (UNIT pipe) (FR500-MAJOR C-2)
6874 (FR400-MAJOR C-2) (.unsplice attrs))
6875 (.str name "$pack $GRi,$GRj,$lock")
6876 (+ pack (misc-null-1) lock op GRi ope GRj)
6877 (c-call VOID (.str "@cpu@_" cache "_cache_preload") GRi GRj lock)
6882 (cache-preload icpl insn C ((FR550-MAJOR C-2) (FR450-MAJOR C-2)) OP_03 OPE1_30
6883 ((fr400 (unit u-icpl)) (fr450 (unit u-icpl))
6884 (fr500 (unit u-icpl)) (fr550 (unit u-icpl)))
6885 "preload insn cache")
6886 (cache-preload dcpl data DCPL ((FR550-MAJOR I-8) (FR450-MAJOR I-2)) OP_03 OPE1_34
6887 ((fr400 (unit u-dcpl)) (fr450 (unit u-dcpl))
6888 (fr500 (unit u-dcpl)) (fr550 (unit u-dcpl)))
6889 "preload data cache")
6891 (define-pmacro (cache-unlock name cache op ope profile comment)
6894 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6895 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6896 (.str name "$pack $GRi")
6897 (+ pack (rd-null) op GRi ope (GRj-null))
6898 (c-call VOID (.str "@cpu@_" cache "_cache_unlock") GRi)
6903 (cache-unlock icul insn OP_03 OPE1_31
6904 ((fr400 (unit u-icul)) (fr450 (unit u-icul))
6905 (fr500 (unit u-icul)) (fr550 (unit u-icul)))
6906 "unlock insn cache")
6907 (cache-unlock dcul data OP_03 OPE1_35
6908 ((fr400 (unit u-dcul)) (fr450 (unit u-dcul))
6909 (fr500 (unit u-dcul)) (fr550 (unit u-dcul)))
6910 "unlock data cache")
6912 (define-pmacro (barrier name insn op ope profile comment)
6915 ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6916 (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6918 (+ pack (rd-null) op (rs-null) ope (GRj-null))
6919 (nop) ; sufficient implementation
6924 (barrier bar bar OP_03 OPE1_3E
6925 ((fr400 (unit u-barrier)) (fr450 (unit u-barrier))
6926 (fr500 (unit u-barrier)))
6928 (barrier membar membar OP_03 OPE1_3F
6929 ((fr400 (unit u-membar)) (fr450 (unit u-membar))
6930 (fr500 (unit u-membar)))
6933 ; Load real address instructions
6934 (define-pmacro (load-real-address name insn what op ope)
6936 (.str "Load real address of " what)
6937 ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
6938 (.str insn "$pack $GRi,$GRk,$LRAE,$LRAD,$LRAS")
6939 (+ pack GRk op GRi ope LRAE LRAD LRAS (LRA-null))
6940 (nop) ; not simulated
6945 (load-real-address lrai "lrai" "instruction" OP_03 OPE1_20)
6946 (load-real-address lrad "lrad" "data" OP_03 OPE1_21)
6950 ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
6951 "tlbpr$pack $GRi,$GRj,$TLBPRopx,$TLBPRL"
6952 (+ pack (TLBPR-null) TLBPRopx TLBPRL OP_03 GRi OPE1_24 GRj)
6953 (nop) ; not simulated
6957 ; Coprocessor operations
6958 (define-pmacro (cop-op num op)
6960 "Coprocessor operation"
6961 ((UNIT C) (FR500-MAJOR C-2) (MACH frv))
6962 (.str "cop" num "$pack $s6_1,$CPRi,$CPRj,$CPRk")
6963 (+ pack CPRk op CPRi s6_1 CPRj)
6964 (nop) ; sufficient implementation
6972 (define-pmacro (clear-ne-flag-semantics target_index is_float)
6973 (c-call VOID "@cpu@_clear_ne_flags" target_index is_float)
6976 (define-pmacro (clear-ne-flag-r name op ope reg is_float attr profile comment)
6979 ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
6980 (.str name "$pack $" reg "k")
6981 (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
6983 ; hack to get this referenced for profiling
6984 (c-raw-call VOID "frv_ref_SI" (.sym reg k))
6985 (clear-ne-flag-semantics (index-of (.sym reg k)) is_float))
6990 (clear-ne-flag-r clrgr OP_0A OPE1_00 GR 0 NA
6991 ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
6993 (clear-ne-flag-r clrfr OP_0A OPE1_02 FR 1 FR-ACCESS
6994 ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
6997 (define-pmacro (clear-ne-flag-all name op ope is_float attr profile comment)
7000 ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
7002 (+ pack (rd-null) op (rs-null) ope (GRj-null))
7003 (clear-ne-flag-semantics -1 is_float)
7008 (clear-ne-flag-all clrga OP_0A OPE1_01 0 NA
7009 ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
7010 "Clear GR NE flag ALL")
7011 (clear-ne-flag-all clrfa OP_0A OPE1_03 1 FR-ACCESS
7012 ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
7013 "Clear FR NE flag ALL")
7015 (define-pmacro (commit-semantics target_index is_float)
7016 (c-call VOID "@cpu@_commit" target_index is_float)
7019 (define-pmacro (commit-r name op ope reg is_float attr comment)
7022 ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
7023 (.str name "$pack $" reg "k")
7024 (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
7025 (commit-semantics (index-of (.sym reg k)) is_float)
7026 ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
7030 (commit-r commitgr OP_0A OPE1_04 GR 0 NA "commit exceptions, specific GR")
7031 (commit-r commitfr OP_0A OPE1_06 FR 1 FR-ACCESS "commit exceptions, specific FR")
7033 (define-pmacro (commit name op ope is_float attr comment)
7036 ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
7038 (+ pack (rd-null) op (rs-null) ope (GRj-null))
7039 (commit-semantics -1 is_float)
7040 ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
7044 (commit commitga OP_0A OPE1_05 0 NA "commit exceptions, any GR")
7045 (commit commitfa OP_0A OPE1_07 1 FR-ACCESS "commit exceptions, any FR")
7047 (define-pmacro (floating-point-conversion
7048 name op ope conv mode src targ attr comment)
7051 (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7052 (.str name "$pack $" src ",$" targ)
7053 (+ pack targ op (rs-null) ope src)
7054 (set targ (conv mode FPCONV-DEFAULT src))
7055 ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7059 (floating-point-conversion fitos OP_79 OPE1_00 float SF FRintj FRk
7060 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7061 "Convert Integer to Single")
7062 (floating-point-conversion fstoi OP_79 OPE1_01 fix SI FRj FRintk
7063 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7064 "Convert Single to Integer")
7065 (floating-point-conversion fitod OP_7A OPE1_00 float DF FRintj FRdoublek
7067 "Convert Integer to Double")
7068 (floating-point-conversion fdtoi OP_7A OPE1_01 fix SI FRdoublej FRintk
7070 "Convert Double to Integer")
7072 (define-pmacro (floating-point-dual-conversion
7073 name op ope conv mode src src_hw targ targ_hw attr comment)
7076 ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) attr)
7077 (.str name "$pack $" src ",$" targ)
7078 (+ pack targ op (rs-null) ope src)
7080 (set targ (conv mode FPCONV-DEFAULT src))
7081 (set (nextreg targ_hw targ 1)
7082 (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
7083 ((fr500 (unit u-float-dual-convert)))
7087 (floating-point-dual-conversion fditos OP_79 OPE1_10 float SF FRintj h-fr_int FRk h-fr NA "Dual Convert Integer to Single")
7088 (floating-point-dual-conversion fdstoi OP_79 OPE1_11 fix SI FRj h-fr FRintk h-fr_int NA "Dual Convert Single to Integer")
7090 (define-pmacro (ne-floating-point-dual-conversion
7091 name op ope conv mode src src_hw targ targ_hw attr comment)
7094 ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) NON-EXCEPTING attr)
7095 (.str name "$pack $" src ",$" targ)
7096 (+ pack targ op (rs-null) ope src)
7098 (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7099 (set targ (conv mode FPCONV-DEFAULT src))
7100 (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
7101 (set (nextreg targ_hw targ 1)
7102 (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
7103 ((fr500 (unit u-float-dual-convert)))
7107 (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")
7108 (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")
7110 (define-pmacro (conditional-floating-point-conversion
7111 name op ope conv mode src targ comment)
7114 ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7115 (.str name "$pack $" src ",$" targ ",$CCi,$cond")
7116 (+ pack targ op (rs-null) CCi cond ope src)
7117 (if (eq CCi (or cond 2))
7118 (set targ (conv mode FPCONV-DEFAULT src)))
7119 ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7123 (conditional-floating-point-conversion cfitos OP_6B OPE4_0 float SF FRintj FRk "Conditional convert Integer to Single")
7124 (conditional-floating-point-conversion cfstoi OP_6B OPE4_1 fix SI FRj FRintk "Conditional convert Single to Integer")
7126 (define-pmacro (ne-floating-point-conversion
7127 name op ope conv mode src targ comment)
7130 ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7131 (.str name "$pack $" src ",$" targ)
7132 (+ pack targ op (rs-null) ope src)
7134 (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7135 (set targ (conv mode FPCONV-DEFAULT src)))
7136 ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7140 (ne-floating-point-conversion nfitos OP_79 OPE1_20 float SF FRintj FRk "NE convert Integer to Single")
7141 (ne-floating-point-conversion nfstoi OP_79 OPE1_21 fix SI FRj FRintk "NE convert Single to Integer")
7143 (register-transfer fmovs OP_79 OPE1_02
7145 ((FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7146 ((fr500 (unit u-fr2fr)))
7147 "Move Single Float")
7148 (register-transfer fmovd OP_7A OPE1_02
7149 ; TODO -- unit doesn't handle extra register
7150 FRdoublej FRdoublek FM01
7151 ((FR500-MAJOR F-1) (MACH frv))
7152 ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
7153 "Move Double Float")
7156 "Dual move single float"
7157 ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7158 "fdmovs$pack $FRj,$FRk"
7159 (+ pack FRk OP_79 (rs-null) OPE1_12 FRj)
7162 (set (nextreg h-fr FRk 1) (nextreg h-fr FRj 1)))
7163 ; TODO -- unit doesn't handle extra register
7164 ((fr500 (unit u-fr2fr)))
7167 (conditional-register-transfer cfmovs OP_6C OPE4_0 FRj FRk FMALL
7168 ((FR500-MAJOR F-1) (FR550-MAJOR F-2)
7169 (MACH simple,tomcat,fr500,fr550,frv))
7170 ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
7171 "Conditional move Single Float")
7173 (define-pmacro (floating-point-neg name src targ op ope attr comment)
7176 (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7177 (.str name "$pack $" src ",$" targ)
7178 (+ pack src op (rs-null) ope targ)
7179 (set targ (neg src))
7180 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7184 (floating-point-neg fnegs FRj FRk OP_79 OPE1_03 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Floating point negate, single")
7185 (floating-point-neg fnegd FRdoublej FRdoublek OP_7A OPE1_03 ((MACH frv)) "Floating point negate, double")
7188 "Floating point dual negate, single"
7189 ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7190 "fdnegs$pack $FRj,$FRk"
7191 (+ pack FRk OP_79 (rs-null) OPE1_13 FRj)
7194 (set (nextreg h-fr FRk 1) (neg (nextreg h-fr FRj 1))))
7195 ((fr500 (unit u-float-dual-arith)))
7199 "Conditional floating point negate, single"
7200 ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7201 "cfnegs$pack $FRj,$FRk,$CCi,$cond"
7202 (+ pack FRj OP_6C (rs-null) CCi cond OPE4_1 FRk)
7203 (if (eq CCi (or cond 2))
7204 (set FRk (neg FRj)))
7205 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7208 (define-pmacro (float-abs name src targ op ope attr comment)
7211 (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7212 (.str name "$pack $" src ",$" targ )
7213 (+ pack targ op (rs-null) ope src)
7214 (set targ (abs src))
7215 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7219 (float-abs fabss FRj FRk OP_79 OPE1_04 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Float absolute value, single")
7220 (float-abs fabsd FRdoublej FRdoublek OP_7A OPE1_04 ((MACH frv)) "Float absolute value, double")
7223 "Floating point dual absolute value, single"
7224 ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7225 "fdabss$pack $FRj,$FRk"
7226 (+ pack FRk OP_79 (rs-null) OPE1_14 FRj)
7229 (set (nextreg h-fr FRk 1) (abs (nextreg h-fr FRj 1))))
7230 ((fr500 (unit u-float-dual-arith)))
7234 "Conditional floating point absolute value, single"
7235 ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7236 "cfabss$pack $FRj,$FRk,$CCi,$cond"
7237 (+ pack FRj OP_6C (rs-null) CCi cond OPE4_2 FRk)
7238 (if (eq CCi (or cond 2))
7239 (set FRk (abs FRj)))
7240 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7244 "Square root single"
7245 ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7246 "fsqrts$pack $FRj,$FRk"
7247 (+ pack FRk OP_79 (rs-null) OPE1_05 FRj)
7248 (set FRk (sqrt SF FRj))
7249 ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7253 "Dual square root single"
7254 ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4))
7255 "fdsqrts$pack $FRj,$FRk"
7256 (+ pack FRk OP_79 (rs-null) OPE1_15 FRj)
7258 (set FRk (sqrt SF FRj))
7259 (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
7260 ((fr500 (unit u-float-dual-sqrt)))
7264 "Non excepting Dual square root single"
7265 ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4) NON-EXCEPTING)
7266 "nfdsqrts$pack $FRj,$FRk"
7267 (+ pack FRk OP_79 (rs-null) OPE1_35 FRj)
7269 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7270 (set FRk (sqrt SF FRj))
7271 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7272 (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
7273 ((fr500 (unit u-float-dual-sqrt)))
7277 "Square root double"
7278 ((UNIT FM01) (FR500-MAJOR F-4) (MACH frv))
7279 "fsqrtd$pack $FRdoublej,$FRdoublek"
7280 (+ pack FRdoublek OP_7A (rs-null) OPE1_05 FRdoublej)
7281 (set FRdoublek (sqrt DF FRdoublej))
7282 ((fr500 (unit u-float-sqrt)))
7286 "Conditional square root single"
7287 ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7288 "cfsqrts$pack $FRj,$FRk,$CCi,$cond"
7289 (+ pack FRk OP_6E (rs-null) CCi cond OPE4_2 FRj)
7290 (if (eq CCi (or cond 2))
7291 (set FRk (sqrt SF FRj)))
7292 ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7296 "Non exception square root, single"
7297 ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7298 "nfsqrts$pack $FRj,$FRk"
7299 (+ pack FRk OP_79 (rs-null) OPE1_25 FRj)
7301 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7302 (set FRk (sqrt SF FRj)))
7303 ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7306 (define-pmacro (float-binary-op-s name pipe attr operation op ope comment)
7309 (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) (.unsplice attr))
7310 (.str name "$pack $FRi,$FRj,$FRk")
7311 (+ pack FRk op FRi ope FRj)
7312 (set FRk (operation FRi FRj))
7313 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7317 (float-binary-op-s fadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_06 "add single float")
7318 (float-binary-op-s fsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_07 "sub single float")
7319 (float-binary-op-s fmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_08 "mul single float")
7323 ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7324 "fdivs$pack $FRi,$FRj,$FRk"
7325 (+ pack FRk OP_79 FRi OPE1_09 FRj)
7326 (set FRk (div FRi FRj))
7327 ((fr500 (unit u-float-div))
7328 (fr550 (unit u-float-div)))
7331 (define-pmacro (float-binary-op-d name operation op ope major comment)
7334 ((UNIT FMALL) (FR500-MAJOR major) (MACH frv))
7335 (.str name "$pack $FRdoublei,$FRdoublej,$FRdoublek")
7336 (+ pack FRdoublek op FRdoublei ope FRdoublej)
7337 (set FRdoublek (operation FRdoublei FRdoublej))
7338 ((fr500 (unit u-float-arith)))
7342 (float-binary-op-d faddd add OP_7A OPE1_06 F-2 "add double float")
7343 (float-binary-op-d fsubd sub OP_7A OPE1_07 F-2 "sub double float")
7344 (float-binary-op-d fmuld mul OP_7A OPE1_08 F-3 "mul double float")
7345 (float-binary-op-d fdivd div OP_7A OPE1_09 F-4 "div double float")
7347 (define-pmacro (conditional-float-binary-op name pipe attr operation op ope profile comment)
7350 (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
7352 (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7353 (+ pack FRk op FRi CCi cond ope FRj)
7354 (if (eq CCi (or cond 2))
7355 (set FRk (operation FRi FRj)))
7360 (conditional-float-binary-op cfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_6D OPE4_0
7361 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7363 (conditional-float-binary-op cfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_6D OPE4_1
7364 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7366 (conditional-float-binary-op cfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_6E OPE4_0
7367 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7369 (conditional-float-binary-op cfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_6E OPE4_1
7370 ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
7373 (define-pmacro (ne-float-binary-op name pipe attr operation op ope profile comment)
7376 (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
7378 (.str name "$pack $FRi,$FRj,$FRk")
7379 (+ pack FRk op FRi ope FRj)
7381 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7382 (set FRk (operation FRi FRj)))
7387 (ne-float-binary-op nfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_26
7388 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7390 (ne-float-binary-op nfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_27
7391 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7393 (ne-float-binary-op nfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_28
7394 ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7396 (ne-float-binary-op nfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_79 OPE1_29
7397 ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
7400 (define-pmacro (fcc-eq) 8)
7401 (define-pmacro (fcc-lt) 4)
7402 (define-pmacro (fcc-gt) 2)
7403 (define-pmacro (fcc-uo) 1)
7405 (define-pmacro (compare-and-set-fcc arg1 arg2 fcc)
7412 (set fcc (fcc-uo)))))
7416 "compare single float"
7417 ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7418 "fcmps$pack $FRi,$FRj,$FCCi_2"
7419 (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_0A FRj)
7420 (compare-and-set-fcc FRi FRj FCCi_2)
7421 ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
7425 "compare double float"
7426 ((UNIT FMALL) (FR500-MAJOR F-2) (MACH frv))
7427 "fcmpd$pack $FRdoublei,$FRdoublej,$FCCi_2"
7428 (+ pack (cond-null) FCCi_2 OP_7A FRdoublei OPE1_0A FRdoublej)
7429 (compare-and-set-fcc FRdoublei FRdoublej FCCi_2)
7430 ((fr500 (unit u-float-compare)))
7434 "Conditional compare single, float"
7435 ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7436 "cfcmps$pack $FRi,$FRj,$FCCi_2,$CCi,$cond"
7437 (+ pack (cond-null) FCCi_2 OP_6D FRi CCi cond OPE4_2 FRj)
7438 (if (eq CCi (or cond 2))
7439 (compare-and-set-fcc FRi FRj FCCi_2))
7440 ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
7444 "float dual compare single"
7445 ((UNIT FMALL) (FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7446 "fdcmps$pack $FRi,$FRj,$FCCi_2"
7447 (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_1A FRj)
7449 (compare-and-set-fcc FRi FRj FCCi_2)
7450 (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
7451 (nextreg h-fccr FCCi_2 1)))
7452 ((fr500 (unit u-float-dual-compare)) (fr550 (unit u-float-dual-compare)))
7455 (define-pmacro (float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
7458 ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7459 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7460 (+ pack targ op arg1 ope arg2)
7461 (set targ (add_sub (mul arg1 arg2) targ))
7462 ((fr500 (unit u-float-dual-arith)))
7466 (float-mul-with-add fmadds add FRi FRj FRk OP_79 OPE1_0B "mul with add, single")
7467 (float-mul-with-add fmsubs sub FRi FRj FRk OP_79 OPE1_0C "mul with sub, single")
7469 (float-mul-with-add fmaddd add FRdoublei FRdoublej FRdoublek OP_7A OPE1_0B "mul with add, double")
7470 (float-mul-with-add fmsubd sub FRdoublei FRdoublej FRdoublek OP_7A OPE1_0C "mul with sub, double")
7473 "Float dual multiply with add"
7474 ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7475 "fdmadds$pack $FRi,$FRj,$FRk"
7476 (+ pack FRk OP_79 FRi OPE1_1B FRj)
7478 (set FRk (add (mul FRi FRj) FRk))
7479 (set (nextreg h-fr FRk 1)
7480 (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
7481 (nextreg h-fr FRk 1))))
7482 ; TODO dual registers not referenced for profiling
7483 ((fr500 (unit u-float-dual-arith)))
7487 "Non excepting float dual multiply with add"
7488 ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7489 "nfdmadds$pack $FRi,$FRj,$FRk"
7490 (+ pack FRk OP_79 FRi OPE1_3B FRj)
7492 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7493 (set FRk (add (mul FRi FRj) FRk))
7494 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7495 (set (nextreg h-fr FRk 1)
7496 (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
7497 (nextreg h-fr FRk 1))))
7498 ; TODO dual registers not referenced for profiling
7499 ((fr500 (unit u-float-dual-arith)))
7502 (define-pmacro (conditional-float-mul-with-add
7503 name add_sub arg1 arg2 targ op ope comment)
7506 ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) CONDITIONAL)
7507 (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7508 (+ pack FRk op FRi CCi cond ope FRj)
7509 (if (eq CCi (or cond 2))
7510 (set targ (add_sub (mul arg1 arg2) targ)))
7511 ((fr500 (unit u-float-dual-arith)))
7515 (conditional-float-mul-with-add cfmadds add FRi FRj FRk OP_6F OPE4_0 "conditional mul with add, single")
7516 (conditional-float-mul-with-add cfmsubs sub FRi FRj FRk OP_6F OPE4_1 "conditional mul with sub, single")
7518 (define-pmacro (ne-float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
7521 ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) NON-EXCEPTING)
7522 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7523 (+ pack targ op arg1 ope arg2)
7525 (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7526 (set targ (add_sub (mul arg1 arg2) targ)))
7527 ((fr500 (unit u-float-dual-arith)))
7531 (ne-float-mul-with-add nfmadds add FRi FRj FRk OP_79 OPE1_2B "non excepting mul with add, single")
7532 (ne-float-mul-with-add nfmsubs sub FRi FRj FRk OP_79 OPE1_2C "non excepting mul with sub, single")
7534 (define-pmacro (float-parallel-mul-add-semantics cond add_sub arg1 arg2 targ)
7537 (set targ (mul arg1 arg2))
7538 (set (nextreg h-fr targ 1)
7539 (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))))
7542 (define-pmacro (float-parallel-mul-add
7543 name add_sub arg1 arg2 targ op ope comment)
7546 ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7547 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7548 (+ pack targ op arg1 ope arg2)
7549 (float-parallel-mul-add-semantics 1 add_sub arg1 arg2 targ)
7550 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7554 (float-parallel-mul-add fmas add FRi FRj FRk OP_79 OPE1_0E "parallel mul/add, single")
7555 (float-parallel-mul-add fmss sub FRi FRj FRk OP_79 OPE1_0F "parallel mul/sub, single")
7557 (define-pmacro (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7559 (set targ (mul arg1 arg2))
7560 (set (nextreg h-fr targ 1)
7561 (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
7562 (set (nextreg h-fr targ 2)
7563 (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
7564 (set (nextreg h-fr targ 3)
7565 (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
7568 (define-pmacro (float-dual-parallel-mul-add
7569 name add_sub arg1 arg2 targ op ope comment)
7572 ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7573 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7574 (+ pack targ op arg1 ope arg2)
7575 (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7580 (float-dual-parallel-mul-add fdmas add FRi FRj FRk OP_79 OPE1_1C "dual parallel mul/add, single")
7581 (float-dual-parallel-mul-add fdmss sub FRi FRj FRk OP_79 OPE1_1D "dual parallel mul/sub, single")
7583 (define-pmacro (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7585 (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7586 (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
7587 (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 2))
7588 (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 3))
7589 (set targ (mul arg1 arg2))
7590 (set (nextreg h-fr targ 1)
7591 (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
7592 (set (nextreg h-fr targ 2)
7593 (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
7594 (set (nextreg h-fr targ 3)
7595 (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
7598 (define-pmacro (ne-float-dual-parallel-mul-add
7599 name add_sub arg1 arg2 targ op ope comment)
7602 ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7603 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7604 (+ pack targ op arg1 ope arg2)
7605 (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7610 (ne-float-dual-parallel-mul-add nfdmas add FRi FRj FRk OP_79 OPE1_3C "non excepting dual parallel mul/add, single")
7611 (ne-float-dual-parallel-mul-add nfdmss sub FRi FRj FRk OP_79 OPE1_3D "non excepting dual parallel mul/sub, single")
7613 (define-pmacro (conditional-float-parallel-mul-add name add_sub op ope comment)
7616 ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) CONDITIONAL (MACH simple,tomcat,fr500,fr550,frv))
7617 (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7618 (+ pack FRk op FRi CCi cond ope FRj)
7619 (float-parallel-mul-add-semantics (eq CCi (or cond 2))
7620 add_sub FRi FRj FRk)
7621 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7625 (conditional-float-parallel-mul-add cfmas add OP_6F OPE4_2 "conditional parallel mul/add, single")
7626 (conditional-float-parallel-mul-add cfmss sub OP_6F OPE4_3 "conditional parallel mul/sub, single")
7628 (define-pmacro (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
7630 (set targ (ftrunc SF FPCONV-DEFAULT
7632 (fext DF FPCONV-DEFAULT arg1)
7633 (fext DF FPCONV-DEFAULT arg2))))
7634 (set (nextreg h-fr targ 1)
7635 (ftrunc SF FPCONV-DEFAULT
7637 (fext DF FPCONV-DEFAULT (nextreg h-fr arg1 1))
7638 (fext DF FPCONV-DEFAULT (nextreg h-fr arg2 1))))))
7641 (define-pmacro (float-parallel-mul-add-double
7642 name add_sub arg1 arg2 targ op ope comment)
7645 ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7646 (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7647 (+ pack targ op arg1 ope arg2)
7648 (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
7653 (float-parallel-mul-add-double fmad add FRi FRj FRk OP_7A OPE1_0E "parallel mul/add, double")
7654 (float-parallel-mul-add-double fmsd sub FRi FRj FRk OP_7A OPE1_0F "parallel mul/sub, double")
7656 (define-pmacro (ne-float-parallel-mul-add name add_sub op ope comment)
7659 ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7660 (.str name "$pack $FRi,$FRj,$FRk")
7661 (+ pack FRk op FRi ope FRj)
7663 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7664 (set FRk (mul FRi FRj))
7665 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7666 (set (nextreg h-fr FRk 1)
7667 (add_sub (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7668 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7672 (ne-float-parallel-mul-add nfmas add OP_79 OPE1_2E "ne parallel mul/add,single")
7673 (ne-float-parallel-mul-add nfmss sub OP_79 OPE1_2F "ne parallel mul/sub,single")
7675 (define-pmacro (float-dual-arith name attr oper1 oper2 op ope comment)
7678 (.splice (UNIT FM01) (.unsplice attr))
7679 (.str name "$pack $FRi,$FRj,$FRk")
7680 (+ pack FRk op FRi ope FRj)
7682 (set FRk (oper1 FRi FRj))
7683 (set (nextreg h-fr FRk 1)
7684 (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7685 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7689 (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")
7690 (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")
7691 (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")
7692 (float-dual-arith fddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_19 "dual div,single")
7693 (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")
7696 "Float dual cross multiply single"
7697 ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7698 "fdmulcs$pack $FRi,$FRj,$FRk"
7699 (+ pack FRk OP_79 FRi OPE1_1F FRj)
7701 (set FRk (mul FRi (nextreg h-fr FRj 1)))
7702 (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
7703 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7707 "NE float dual cross multiply single"
7708 ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7709 "nfdmulcs$pack $FRi,$FRj,$FRk"
7710 (+ pack FRk OP_79 FRi OPE1_3F FRj)
7712 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7713 (set FRk (mul FRi (nextreg h-fr FRj 1)))
7714 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7715 (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
7716 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7719 (define-pmacro (ne-float-dual-arith name attr oper1 oper2 op ope comment)
7722 (.splice (UNIT FM01) (.unsplice attr))
7723 (.str name "$pack $FRi,$FRj,$FRk")
7724 (+ pack FRk op FRi ope FRj)
7726 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7727 (set FRk (oper1 FRi FRj))
7728 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7729 (set (nextreg h-fr FRk 1)
7730 (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7731 ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7735 (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")
7736 (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")
7737 (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")
7738 (ne-float-dual-arith nfddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_39 "ne dual div,single")
7739 (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")
7742 "non-excepting dual float compare"
7743 ((UNIT FM01) (FR500-MAJOR F-6) (MACH simple,tomcat,frv))
7744 "nfdcmps$pack $FRi,$FRj,$FCCi_2"
7745 (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_3A FRj)
7747 (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7748 (compare-and-set-fcc FRi FRj FCCi_2)
7749 (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7750 (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
7751 (nextreg h-fccr FCCi_2 1)))
7752 ((fr500 (unit u-float-dual-compare)))
7755 ; Media Instructions
7757 (define-pmacro (halfword hilo arg offset)
7758 (reg (.sym h-fr_ hilo) (add (index-of arg) offset)))
7761 "Media set lower signed 12 bits"
7762 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7763 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7764 "mhsetlos$pack $u12,$FRklo"
7765 (+ pack FRklo OP_78 OPE1_20 u12)
7767 ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7768 (fr550 (unit u-media-set (out FRintk FRklo))))
7772 "Media set upper signed 12 bits"
7773 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7774 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7775 "mhsethis$pack $u12,$FRkhi"
7776 (+ pack FRkhi OP_78 OPE1_22 u12)
7778 ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7779 (fr550 (unit u-media-set (out FRintk FRkhi))))
7783 "Media dual set halfword signed 12 bits"
7784 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7785 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7786 "mhdsets$pack $u12,$FRintk"
7787 (+ pack FRintk OP_78 OPE1_24 u12)
7789 ; hack to get FRintk passed to modelling functions
7790 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
7791 (set (halfword hi FRintk 0) u12)
7792 (set (halfword lo FRintk 0) u12))
7793 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7794 (fr550 (unit u-media-set)))
7797 (define-pmacro (set-5-semantics target value)
7798 (sequence ((HI tmp))
7800 (set tmp (and tmp #x07ff))
7801 (set tmp (or tmp (sll (and s5 #x1f) 11)))
7805 (define-pmacro (media-set-5 name hilo op ope comment)
7808 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7809 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7810 (.str name "$pack $s5,$FRk" hilo)
7811 (+ pack (.sym FRk hilo) op (FRi-null) ope (misc-null-11) s5)
7812 (set-5-semantics (.sym FRk hilo) s5)
7813 ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7814 (fr550 (unit u-media-set (out FRintk (.sym FRk hilo)))))
7818 (media-set-5 mhsetloh lo OP_78 OPE1_21 "Media set upper 5 bits lo")
7819 (media-set-5 mhsethih hi OP_78 OPE1_23 "Media set upper 5 bits hi")
7822 "Media dual set halfword upper 5 bits"
7823 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7824 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7825 "mhdseth$pack $s5,$FRintk"
7826 (+ pack FRintk OP_78 (FRi-null) OPE1_25 (misc-null-11) s5)
7828 ; hack to get FRintk passed to modelling functions
7829 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
7830 (set-5-semantics (halfword hi FRintk 0) s5)
7831 (set-5-semantics (halfword lo FRintk 0) s5))
7832 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7833 (fr550 (unit u-media-set)))
7836 (define-pmacro (media-logic-r-r name operation op ope comment)
7839 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7840 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7841 (.str name "$pack $FRinti,$FRintj,$FRintk")
7842 (+ pack FRintk op FRinti ope FRintj)
7843 (set FRintk (operation FRinti FRintj))
7844 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7845 (fr500 (unit u-media)) (fr550 (unit u-media)))
7849 (media-logic-r-r mand and OP_7B OPE1_00 "and reg/reg")
7850 (media-logic-r-r mor or OP_7B OPE1_01 "or reg/reg")
7851 (media-logic-r-r mxor xor OP_7B OPE1_02 "xor reg/reg")
7853 (define-pmacro (conditional-media-logic name operation op ope comment)
7856 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7857 (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
7858 (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
7859 (+ pack FRintk op FRinti CCi cond ope FRintj)
7860 (if (eq CCi (or cond 2))
7861 (set FRintk (operation FRinti FRintj)))
7862 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7863 (fr500 (unit u-media)) (fr550 (unit u-media)))
7867 (conditional-media-logic cmand and OP_70 OPE4_0 "conditional and reg/reg")
7868 (conditional-media-logic cmor or OP_70 OPE4_1 "conditional or reg/reg")
7869 (conditional-media-logic cmxor xor OP_70 OPE4_2 "conditional xor reg/reg")
7873 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7874 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7875 ("mnot$pack $FRintj,$FRintk")
7876 (+ pack FRintk OP_7B (rs-null) OPE1_03 FRintj)
7877 (set FRintk (inv FRintj))
7878 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7879 (fr500 (unit u-media)) (fr550 (unit u-media)))
7884 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7885 (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
7886 ("cmnot$pack $FRintj,$FRintk,$CCi,$cond")
7887 (+ pack FRintk OP_70 (rs-null) CCi cond OPE4_3 FRintj)
7888 (if (eq CCi (or cond 2))
7889 (set FRintk (inv FRintj)))
7890 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7891 (fr500 (unit u-media)) (fr550 (unit u-media)))
7894 (define-pmacro (media-rotate-r-r name operation op ope comment)
7897 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7898 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7899 (.str name "$pack $FRinti,$u6,$FRintk")
7900 (+ pack FRintk op FRinti ope u6)
7901 (set FRintk (operation FRinti (and u6 #x1f)))
7902 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
7903 (fr500 (unit u-media)) (fr550 (unit u-media)))
7907 (media-rotate-r-r mrotli rol OP_7B OPE1_04 "rotate left reg/reg")
7908 (media-rotate-r-r mrotri ror OP_7B OPE1_05 "rotate right reg/reg")
7910 (define-pmacro (media-cut-r-r name arg op ope comment)
7913 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7914 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
7915 (.str name "$pack $FRinti,$" arg ",$FRintk")
7916 (+ pack FRintk op FRinti ope arg)
7917 (set FRintk (c-call SI "@cpu@_cut" FRinti (nextreg h-fr_int FRinti 1) arg))
7918 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
7919 (fr500 (unit u-media)) (fr550 (unit u-media)))
7923 (media-cut-r-r mwcut FRintj OP_7B OPE1_06 "media cut")
7924 (media-cut-r-r mwcuti u6 OP_7B OPE1_07 "media cut")
7926 (define-pmacro (media-cut-acc name arg op ope fr450-major comment)
7929 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7930 (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
7931 (.str name "$pack $ACC40Si,$" arg ",$FRintk")
7932 (+ pack FRintk op ACC40Si ope arg)
7933 (set FRintk (c-call SI "@cpu@_media_cut" ACC40Si arg))
7934 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
7935 (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
7939 (media-cut-acc mcut FRintj OP_7B OPE1_2C M-1 "media accumulator cut reg")
7940 (media-cut-acc mcuti s6 OP_7B OPE1_2E M-5 "media accumulator cut immed")
7942 (define-pmacro (media-cut-acc-ss name arg op ope fr450-major comment)
7945 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7946 (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
7947 (.str name "$pack $ACC40Si,$" arg ",$FRintk")
7948 (+ pack FRintk op ACC40Si ope arg)
7949 (set FRintk (c-call SI "@cpu@_media_cut_ss" ACC40Si arg))
7950 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
7951 (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
7955 (media-cut-acc-ss mcutss FRintj OP_7B OPE1_2D M-1 "media accumulator cut reg with saturation")
7956 (media-cut-acc-ss mcutssi s6 OP_7B OPE1_2F M-5 "media accumulator cut immed with saturation")
7958 ; Dual Media Instructions
7960 (define-pmacro (register-unaligned register alignment)
7961 (and (index-of register) (sub alignment 1))
7965 "Media dual cut with signed saturation"
7966 ((UNIT MDCUTSSI) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
7967 (FR400-MAJOR M-2) (FR450-MAJOR M-6))
7968 "mdcutssi$pack $ACC40Si,$s6,$FRintkeven"
7969 (+ pack FRintkeven OP_78 ACC40Si OPE1_0E s6)
7970 (if (register-unaligned ACC40Si 2)
7971 (c-call VOID "@cpu@_media_acc_not_aligned")
7972 (if (register-unaligned FRintkeven 2)
7973 (c-call VOID "@cpu@_media_register_not_aligned")
7975 (set FRintkeven (c-call SI "@cpu@_media_cut_ss" ACC40Si s6))
7976 (set (nextreg h-fr_int FRintkeven 1)
7977 (c-call SI "@cpu@_media_cut_ss"
7978 (nextreg h-acc40S ACC40Si 1) s6)))))
7979 ((fr400 (unit u-media-4-acc-dual
7980 (out FRintk FRintkeven)))
7981 (fr450 (unit u-media-4-acc-dual
7982 (out FRintk FRintkeven)))
7983 (fr550 (unit u-media-3-acc-dual)))
7986 ; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated
7987 ; so it will be passed to the unit modelers. YUCK!!!!!
7988 (define-pmacro (extract-hilo reg1 off1 reg2 off2 arg1hi arg1lo arg2hi arg2lo)
7990 (set arg1hi (add (halfword hi reg1 off1) (mul reg1 0)))
7991 (set arg1lo (add (halfword lo reg1 off1) (mul reg1 0)))
7992 (set arg2hi (add (halfword hi reg2 off2) (mul reg2 0)))
7993 (set arg2lo (add (halfword lo reg2 off2) (mul reg2 0))))
7997 "Media dual average"
7998 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7999 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8000 "maveh$pack $FRinti,$FRintj,$FRintk"
8001 (+ pack FRintk OP_7B FRinti OPE1_08 FRintj)
8002 (set FRintk (c-call SI "@cpu@_media_average" FRinti FRintj))
8003 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8004 (fr500 (unit u-media)) (fr550 (unit u-media)))
8007 (define-pmacro (media-dual-shift name operation op ope profile comment)
8010 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
8011 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8012 (.str name "$pack $FRinti,$u6,$FRintk")
8013 (+ pack FRintk op FRinti ope u6)
8015 ; hack to get these referenced for profiling
8016 (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
8017 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8018 (set (halfword hi FRintk 0)
8019 (operation (halfword hi FRinti 0) (and u6 #xf)))
8020 (set (halfword lo FRintk 0)
8021 (operation (halfword lo FRinti 0) (and u6 #xf))))
8026 (media-dual-shift msllhi sll OP_7B OPE1_09
8027 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
8028 (fr500 (unit u-media)) (fr550 (unit u-media)))
8029 "Media dual shift left logical")
8030 (media-dual-shift msrlhi srl OP_7B OPE1_0A
8031 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
8032 (fr500 (unit u-media)) (fr550 (unit u-media)))
8033 "Media dual shift right logical")
8034 (media-dual-shift msrahi sra OP_7B OPE1_0B
8035 ((fr400 (unit u-media-6)) (fr450 (unit u-media-6))
8036 (fr500 (unit u-media)) (fr550 (unit u-media)))
8037 "Media dual shift right arithmetic")
8039 (define-pmacro (media-dual-word-rotate-r-r name operation op ope comment)
8042 ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8043 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8044 (.str name "$pack $FRintieven,$s6,$FRintkeven")
8045 (+ pack FRintkeven op FRintieven ope s6)
8046 (if (orif (register-unaligned FRintieven 2)
8047 (register-unaligned FRintkeven 2))
8048 (c-call VOID "@cpu@_media_register_not_aligned")
8050 (set FRintkeven (operation FRintieven (and s6 #x1f)))
8051 (set (nextreg h-fr_int FRintkeven 1)
8052 (operation (nextreg h-fr_int FRintieven 1)
8054 ((fr400 (unit u-media-3-quad
8055 (in FRinti FRintieven)
8056 (out FRintk FRintkeven)))
8057 (fr450 (unit u-media-3-quad
8058 (in FRinti FRintieven)
8059 (out FRintk FRintkeven)))
8060 (fr550 (unit u-media-quad)))
8064 (media-dual-word-rotate-r-r mdrotli rol OP_78 OPE1_0B "rotate left reg/reg")
8067 "Media bit concatenate, halfword"
8068 ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8069 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8070 "mcplhi$pack $FRinti,$u6,$FRintk"
8071 (+ pack FRintk OP_78 FRinti OPE1_0C u6)
8072 (sequence ((HI arg1) (HI arg2) (HI shift))
8073 (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
8074 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8075 (set shift (and u6 #xf))
8076 (set arg1 (sll (halfword hi FRinti 0) shift))
8079 (set arg2 (halfword hi FRinti 1))
8080 (set arg2 (srl HI (sll HI arg2 (sub 15 shift))
8082 (set arg1 (or HI arg1 arg2))))
8083 (set (halfword hi FRintk 0) arg1))
8084 ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
8085 (fr550 (unit u-media-3-dual)))
8089 "Media bit concatenate, word"
8090 ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8091 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8092 "mcpli$pack $FRinti,$u6,$FRintk"
8093 (+ pack FRintk OP_78 FRinti OPE1_0D u6)
8094 (sequence ((SI tmp) (SI shift))
8095 (set shift (and u6 #x1f))
8096 (set tmp (sll FRinti shift))
8098 (sequence ((SI tmp1))
8099 (set tmp1 (srl (sll (nextreg h-fr_int FRinti 1)
8102 (set tmp (or tmp tmp1))))
8104 ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
8105 (fr550 (unit u-media-3-dual)))
8108 (define-pmacro (saturate arg max min result)
8117 "Media dual saturation signed"
8118 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8119 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8120 "msaths$pack $FRinti,$FRintj,$FRintk"
8121 (+ pack FRintk OP_7B FRinti OPE1_0C FRintj)
8122 (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
8123 (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8124 (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 0))
8125 (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 0)))
8126 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8127 (fr500 (unit u-media)) (fr550 (unit u-media)))
8131 "Media quad saturation signed"
8132 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
8133 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8134 "mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven"
8135 (+ pack FRintkeven OP_78 FRintieven OPE1_0F FRintjeven)
8136 (if (orif (register-unaligned FRintieven 2)
8137 (orif (register-unaligned FRintjeven 2)
8138 (register-unaligned FRintkeven 2)))
8139 (c-call VOID "@cpu@_media_register_not_aligned")
8140 (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
8141 ; hack to get FRintkeven referenced as a target for profiling
8142 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8143 (extract-hilo FRintieven 0 FRintjeven 0 argihi argilo argjhi argjlo)
8144 (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 0))
8145 (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 0))
8146 (extract-hilo FRintieven 1 FRintjeven 1 argihi argilo argjhi argjlo)
8147 (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 1))
8148 (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 1))))
8149 ((fr400 (unit u-media-1-quad
8150 (in FRinti FRintieven)
8151 (in FRintj FRintjeven)
8152 (out FRintk FRintkeven)))
8153 (fr450 (unit u-media-1-quad
8154 (in FRinti FRintieven)
8155 (in FRintj FRintjeven)
8156 (out FRintk FRintkeven)))
8157 (fr550 (unit u-media-quad)))
8160 (define-pmacro (saturate-unsigned arg max result)
8167 "Media dual saturation unsigned"
8168 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8169 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8170 "msathu$pack $FRinti,$FRintj,$FRintk"
8171 (+ pack FRintk OP_7B FRinti OPE1_0D FRintj)
8172 (sequence ((UHI argihi) (UHI argilo) (UHI argjhi) (UHI argjlo))
8173 (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8174 (saturate-unsigned argihi argjhi (halfword hi FRintk 0))
8175 (saturate-unsigned argilo argjlo (halfword lo FRintk 0)))
8176 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8177 (fr500 (unit u-media)) (fr550 (unit u-media)))
8180 (define-pmacro (media-dual-compare name mode op ope comment)
8183 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8184 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8185 (.str name "$pack $FRinti,$FRintj,$FCCk")
8186 (+ pack (cond-null) FCCk op FRinti ope FRintj)
8187 (if (register-unaligned FCCk 2)
8188 (c-call VOID "@cpu@_media_cr_not_aligned")
8189 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8190 (extract-hilo FRinti 0 FRintj 0
8191 argihi argilo argjhi argjlo)
8192 (compare-and-set-fcc argihi argjhi FCCk)
8193 (compare-and-set-fcc argilo argjlo (nextreg h-fccr FCCk 1))))
8194 ; TODO - doesn't handle second FCC
8195 ((fr400 (unit u-media-7)) (fr450 (unit u-media-7))
8196 (fr500 (unit u-media)) (fr550 (unit u-media)))
8200 (media-dual-compare mcmpsh HI OP_7B OPE1_0E "Media dual compare signed")
8201 (media-dual-compare mcmpuh UHI OP_7B OPE1_0F "Media dual compare unsigned")
8203 ; Bits for the MSR.SIE field
8204 (define-pmacro (msr-sie-nil) 0)
8205 (define-pmacro (msr-sie-fri-hi) 8)
8206 (define-pmacro (msr-sie-fri-lo) 4)
8207 (define-pmacro (msr-sie-fri-1-hi) 2)
8208 (define-pmacro (msr-sie-fri-1-lo) 1)
8209 (define-pmacro (msr-sie-acci) 8)
8210 (define-pmacro (msr-sie-acci-1) 4)
8211 (define-pmacro (msr-sie-acci-2) 2)
8212 (define-pmacro (msr-sie-acci-3) 1)
8214 (define-pmacro (saturate-v arg max min sie result)
8218 (c-call VOID "@cpu@_media_overflow" sie))
8222 (c-call VOID "@cpu@_media_overflow" sie))
8227 "Media dual absolute value, halfword"
8228 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
8229 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8230 "mabshs$pack $FRintj,$FRintk"
8231 (+ pack FRintk OP_78 (FRi-null) OPE1_0A FRintj)
8232 (sequence ((HI arghi) (HI arglo))
8233 (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
8234 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8235 (set arghi (halfword hi FRintj 0))
8236 (set arglo (halfword lo FRintj 0))
8237 ; We extend the argument before the abs operation so we can
8238 ; notice -32768 overflowing as 32768.
8239 (saturate-v (abs (ext DI arghi)) 32767 -32768 (msr-sie-fri-hi)
8240 (halfword hi FRintk 0))
8241 (saturate-v (abs (ext DI arglo)) 32767 -32768 (msr-sie-fri-lo)
8242 (halfword lo FRintk 0)))
8243 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8244 (fr550 (unit u-media)))
8247 ; How to extend from a mode to get the intended signedness.
8248 (define-pmacro (DI-ext-HI x) (ext DI x))
8249 (define-pmacro (DI-ext-UHI x) (zext DI x))
8250 (define-pmacro (DI-ext-DI x) x)
8252 (define-pmacro (media-arith-sat-semantics
8253 operation arg1 arg2 res mode max min sie)
8254 (sequence ((DI tmp))
8255 ; Make sure we saturate at max/min against a value that is
8256 ; sign- or zero-extended appropriately from "mode".
8257 (set tmp (operation DI
8258 ((.sym DI-ext- mode) arg1) ((.sym DI-ext- mode) arg2)))
8259 (saturate-v tmp max min sie res))
8262 (define-pmacro (media-dual-arith-sat-semantics operation mode max min)
8263 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8264 (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8265 (media-arith-sat-semantics operation argihi argjhi
8266 (halfword hi FRintk 0) mode max min
8268 (media-arith-sat-semantics operation argilo argjlo
8269 (halfword lo FRintk 0) mode max min
8273 (define-pmacro (media-dual-arith-sat name operation mode max min op ope comment)
8276 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8277 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8278 (.str name "$pack $FRinti,$FRintj,$FRintk")
8279 (+ pack FRintk op FRinti ope FRintj)
8280 (media-dual-arith-sat-semantics operation mode max min)
8281 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8282 (fr500 (unit u-media)) (fr550 (unit u-media)))
8286 (media-dual-arith-sat maddhss add HI 32767 -32768 OP_7B OPE1_10 "Media dual add signed with saturation")
8287 (media-dual-arith-sat maddhus add UHI 65535 0 OP_7B OPE1_11 "Media dual add unsigned with saturation")
8289 (media-dual-arith-sat msubhss sub HI 32767 -32768 OP_7B OPE1_12 "Media dual sub signed with saturation")
8290 (media-dual-arith-sat msubhus sub UHI 65535 0 OP_7B OPE1_13 "Media dual sub unsigned with saturation")
8292 (define-pmacro (conditional-media-dual-arith-sat
8293 name operation mode max min op ope comment)
8296 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8297 (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
8298 (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
8299 (+ pack FRintk op FRinti CCi cond ope FRintj)
8300 (if (eq CCi (or cond 2))
8301 (media-dual-arith-sat-semantics operation mode max min))
8302 ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8303 (fr500 (unit u-media)) (fr550 (unit u-media)))
8307 (conditional-media-dual-arith-sat cmaddhss add HI 32767 -32768 OP_71 OPE4_0 "Conditional Media dual add signed with saturation")
8308 (conditional-media-dual-arith-sat cmaddhus add UHI 65535 0 OP_71 OPE4_1 "Conditional Media dual add unsigned with saturation")
8310 (conditional-media-dual-arith-sat cmsubhss sub HI 32767 -32768 OP_71 OPE4_2 "Conditional Media dual sub signed with saturation")
8311 (conditional-media-dual-arith-sat cmsubhus sub UHI 65535 0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation")
8313 (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min)
8314 (if (orif (register-unaligned FRintieven 2)
8315 (orif (register-unaligned FRintjeven 2)
8316 (register-unaligned FRintkeven 2)))
8317 (c-call VOID "@cpu@_media_register_not_aligned")
8319 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8320 ; hack to get FRintkeven referenced as a target for profiling
8321 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8322 (extract-hilo FRintieven 0 FRintjeven 0
8323 argihi argilo argjhi argjlo)
8324 (media-arith-sat-semantics operation argihi argjhi
8325 (halfword hi FRintkeven 0) mode
8326 max min (msr-sie-fri-hi))
8327 (media-arith-sat-semantics operation argilo argjlo
8328 (halfword lo FRintkeven 0) mode
8329 max min (msr-sie-fri-lo))
8330 (extract-hilo FRintieven 1 FRintjeven 1
8331 argihi argilo argjhi argjlo)
8332 (media-arith-sat-semantics operation argihi argjhi
8333 (halfword hi FRintkeven 1) mode
8334 max min (msr-sie-fri-1-hi))
8335 (media-arith-sat-semantics operation argilo argjlo
8336 (halfword lo FRintkeven 1) mode
8337 max min (msr-sie-fri-1-lo)))))
8340 (define-pmacro (media-quad-arith-sat name operation mode max min op ope comment)
8343 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8344 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8345 (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
8346 (+ pack FRintkeven op FRintieven ope FRintjeven)
8347 (media-quad-arith-sat-semantics 1 operation mode max min)
8348 ((fr400 (unit u-media-1-quad
8349 (in FRinti FRintieven)
8350 (in FRintj FRintjeven)
8351 (out FRintk FRintkeven)))
8352 (fr450 (unit u-media-1-quad
8353 (in FRinti FRintieven)
8354 (in FRintj FRintjeven)
8355 (out FRintk FRintkeven)))
8356 (fr500 (unit u-media-quad-arith
8357 (in FRinti FRintieven)
8358 (in FRintj FRintjeven)
8359 (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
8363 (media-quad-arith-sat mqaddhss add HI 32767 -32768 OP_7B OPE1_18 "Media quad add signed with saturation")
8364 (media-quad-arith-sat mqaddhus add UHI 65535 0 OP_7B OPE1_19 "Media quad add unsigned with saturation")
8366 (media-quad-arith-sat mqsubhss sub HI 32767 -32768 OP_7B OPE1_1A "Media quad sub signed with saturation")
8367 (media-quad-arith-sat mqsubhus sub UHI 65535 0 OP_7B OPE1_1B "Media quad sub unsigned with saturation")
8369 (define-pmacro (conditional-media-quad-arith-sat
8370 name operation mode max min op ope comment)
8373 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8374 (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
8375 (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond")
8376 (+ pack FRintkeven op FRintieven CCi cond ope FRintjeven)
8377 (media-quad-arith-sat-semantics (eq CCi (or cond 2))
8378 operation mode max min)
8379 ((fr400 (unit u-media-1-quad
8380 (in FRinti FRintieven)
8381 (in FRintj FRintjeven)
8382 (out FRintk FRintkeven)))
8383 (fr450 (unit u-media-1-quad
8384 (in FRinti FRintieven)
8385 (in FRintj FRintjeven)
8386 (out FRintk FRintkeven)))
8387 (fr500 (unit u-media-quad-arith
8388 (in FRinti FRintieven)
8389 (in FRintj FRintjeven)
8390 (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
8394 (conditional-media-quad-arith-sat cmqaddhss add HI 32767 -32768 OP_73 OPE4_0 "Conditional Media quad add signed with saturation")
8395 (conditional-media-quad-arith-sat cmqaddhus add UHI 65535 0 OP_73 OPE4_1 "Conditional Media quad add unsigned with saturation")
8397 (conditional-media-quad-arith-sat cmqsubhss sub HI 32767 -32768 OP_73 OPE4_2 "Conditional Media quad sub signed with saturation")
8398 (conditional-media-quad-arith-sat cmqsubhus sub UHI 65535 0 OP_73 OPE4_3 "Conditional Media quad sub unsigned with saturation")
8400 ;; Return A if |A| > |B| and B is positive. Return -A if |A| > |B| and
8401 ;; B is negative, saturating 0x8000 as 0x7fff. Return 0 otherwise.
8402 (define-pmacro (media-low-clear-semantics a b)
8404 ((le UHI (abs a) (abs b)) 0)
8406 ((eq HI a -32768) 32767)
8409 ;; Return A if -|B| < A < |B|. Return -B if A <= -|B|, saturating 0x8000
8410 ;; as 0x7fff. Return B if A >= |B|.
8411 (define-pmacro (media-scope-limit-semantics a b)
8413 ((andif (gt HI b -32768)
8414 (ge HI a (abs b))) b)
8415 ((gt HI a (neg (abs b))) a)
8416 ((eq HI b -32768) 32767)
8419 (define-pmacro (media-quad-limit name operation op ope comment)
8422 ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
8423 (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
8424 (+ pack FRintkeven op FRintieven ope FRintjeven)
8425 (if (orif (register-unaligned FRintieven 2)
8426 (orif (register-unaligned FRintjeven 2)
8427 (register-unaligned FRintkeven 2)))
8428 (c-call VOID "@cpu@_media_register_not_aligned")
8429 (sequence ((HI a1) (HI a2) (HI a3) (HI a4)
8430 (HI b1) (HI b2) (HI b3) (HI b4))
8431 ; hack to get FRintkeven referenced as a target
8433 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8434 (extract-hilo FRintieven 0 FRintjeven 0 a1 a2 b1 b2)
8435 (extract-hilo FRintieven 1 FRintjeven 1 a3 a4 b3 b4)
8436 (set (halfword hi FRintkeven 0) (operation a1 b1))
8437 (set (halfword lo FRintkeven 0) (operation a2 b2))
8438 (set (halfword hi FRintkeven 1) (operation a3 b3))
8439 (set (halfword lo FRintkeven 1) (operation a4 b4))))
8440 ((fr450 (unit u-media-1-quad
8441 (in FRinti FRintieven)
8442 (in FRintj FRintjeven)
8443 (out FRintk FRintkeven))))
8447 (media-quad-limit mqlclrhs media-low-clear-semantics OP_78 OPE1_10
8448 "Media quad low clear")
8449 (media-quad-limit mqlmths media-scope-limit-semantics OP_78 OPE1_14
8450 "Media quad scope limitation")
8452 (define-pmacro (media-quad-shift name operation op ope comment)
8455 ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
8456 (.str name "$pack $FRintieven,$u6,$FRintkeven")
8457 (+ pack FRintkeven op FRintieven ope u6)
8458 (if (orif (register-unaligned FRintieven 2)
8459 (register-unaligned FRintkeven 2))
8460 (c-call VOID "@cpu@_media_register_not_aligned")
8462 ; hack to get these referenced for profiling
8463 (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
8464 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8465 (set (halfword hi FRintkeven 0)
8466 (operation HI (halfword hi FRintieven 0)
8468 (set (halfword lo FRintkeven 0)
8469 (operation HI (halfword lo FRintieven 0)
8471 (set (halfword hi FRintkeven 1)
8472 (operation HI (halfword hi FRintieven 1)
8474 (set (halfword lo FRintkeven 1)
8475 (operation HI (halfword lo FRintieven 1)
8477 ((fr450 (unit u-media-3-quad
8478 (in FRinti FRintieven)
8479 (in FRintj FRintieven)
8480 (out FRintk FRintkeven))))
8484 (media-quad-shift mqsllhi sll OP_78 OPE1_11 "Media quad left shift")
8485 (media-quad-shift mqsrahi sra OP_78 OPE1_13 "Media quad right shift")
8487 (define-pmacro (media-acc-arith-sat name operation mode max min op ope comment)
8490 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8491 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8492 (.str name "$pack $ACC40Si,$ACC40Sk")
8493 (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
8494 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8495 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8496 (if (register-unaligned ACC40Si 2)
8497 (c-call VOID "@cpu@_media_acc_not_aligned")
8498 (media-arith-sat-semantics operation ACC40Si
8499 (nextreg h-acc40S ACC40Si 1)
8500 ACC40Sk mode max min (msr-sie-acci)))))
8501 ((fr400 (unit u-media-2-acc)) (fr450 (unit u-media-2-acc))
8502 (fr550 (unit u-media-4-acc)))
8506 (media-acc-arith-sat maddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
8507 OP_78 OPE1_04 "Media accumulator addition")
8508 (media-acc-arith-sat msubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
8509 OP_78 OPE1_05 "Media accumulator subtraction")
8511 (define-pmacro (media-dual-acc-arith-sat name operation mode max min op ope
8515 ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8516 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8517 (.str name "$pack $ACC40Si,$ACC40Sk")
8518 (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
8519 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8520 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8521 (if (register-unaligned ACC40Si 4)
8522 (c-call VOID "@cpu@_media_acc_not_aligned")
8523 (if (register-unaligned ACC40Sk 2)
8524 (c-call VOID "@cpu@_media_acc_not_aligned")
8526 (media-arith-sat-semantics operation ACC40Si
8527 (nextreg h-acc40S ACC40Si 1)
8528 ACC40Sk mode max min
8530 (media-arith-sat-semantics operation
8531 (nextreg h-acc40S ACC40Si 2)
8532 (nextreg h-acc40S ACC40Si 3)
8533 (nextreg h-acc40S ACC40Sk 1)
8535 (msr-sie-acci-1)))))))
8536 ((fr400 (unit u-media-2-acc-dual)) (fr450 (unit u-media-2-acc-dual))
8537 (fr550 (unit u-media-4-acc-dual)))
8541 (media-dual-acc-arith-sat mdaddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
8542 OP_78 OPE1_06 "Media accumulator addition")
8543 (media-dual-acc-arith-sat mdsubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
8544 OP_78 OPE1_07 "Media accumulator subtraction")
8547 "Media add and subtract signed accumulator with saturation"
8548 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8549 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8550 "masaccs$pack $ACC40Si,$ACC40Sk"
8551 (+ pack ACC40Sk OP_78 ACC40Si OPE1_08 (ACCj-null))
8552 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8553 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8554 (if (register-unaligned ACC40Si 2)
8555 (c-call VOID "@cpu@_media_acc_not_aligned")
8556 (if (register-unaligned ACC40Sk 2)
8557 (c-call VOID "@cpu@_media_acc_not_aligned")
8559 (media-arith-sat-semantics add ACC40Si
8560 (nextreg h-acc40S ACC40Si 1)
8563 (inv DI #x7fffffffff)
8565 (media-arith-sat-semantics sub ACC40Si
8566 (nextreg h-acc40S ACC40Si 1)
8567 (nextreg h-acc40S ACC40Sk 1)
8570 (inv DI #x7fffffffff)
8571 (msr-sie-acci-1)))))))
8572 ((fr400 (unit u-media-2-add-sub)) (fr450 (unit u-media-2-add-sub))
8573 (fr550 (unit u-media-4-add-sub)))
8577 "Media add and subtract signed accumulator with saturation"
8578 ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8579 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8580 "mdasaccs$pack $ACC40Si,$ACC40Sk"
8581 (+ pack ACC40Sk OP_78 ACC40Si OPE1_09 (ACCj-null))
8582 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8583 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8584 (if (register-unaligned ACC40Si 4)
8585 (c-call VOID "@cpu@_media_acc_not_aligned")
8586 (if (register-unaligned ACC40Sk 4)
8587 (c-call VOID "@cpu@_media_acc_not_aligned")
8589 (media-arith-sat-semantics add ACC40Si
8590 (nextreg h-acc40S ACC40Si 1)
8593 (inv DI #x7fffffffff)
8595 (media-arith-sat-semantics sub ACC40Si
8596 (nextreg h-acc40S ACC40Si 1)
8597 (nextreg h-acc40S ACC40Sk 1)
8600 (inv DI #x7fffffffff)
8602 (media-arith-sat-semantics add
8603 (nextreg h-acc40S ACC40Si 2)
8604 (nextreg h-acc40S ACC40Si 3)
8605 (nextreg h-acc40S ACC40Sk 2)
8608 (inv DI #x7fffffffff)
8610 (media-arith-sat-semantics sub
8611 (nextreg h-acc40S ACC40Si 2)
8612 (nextreg h-acc40S ACC40Si 3)
8613 (nextreg h-acc40S ACC40Sk 3)
8616 (inv DI #x7fffffffff)
8617 (msr-sie-acci-3)))))))
8618 ((fr400 (unit u-media-2-add-sub-dual))
8619 (fr450 (unit u-media-2-add-sub-dual))
8620 (fr550 (unit u-media-4-add-sub-dual)))
8623 (define-pmacro (media-multiply-semantics conv arg1 arg2 res)
8624 (set res (mul DI (conv DI arg1) (conv DI arg2)))
8627 (define-pmacro (media-dual-multiply-semantics cond mode conv rhs1 rhs2)
8628 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8629 (if (register-unaligned ACC40Sk 2)
8630 (c-call VOID "@cpu@_media_acc_not_aligned")
8632 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8633 (extract-hilo FRinti 0 FRintj 0
8634 argihi argilo argjhi argjlo)
8635 (media-multiply-semantics conv argihi rhs1 ACC40Sk)
8636 (media-multiply-semantics conv argilo rhs2
8637 (nextreg h-acc40S ACC40Sk 1))))))
8640 (define-pmacro (media-dual-multiply name mode conv rhs1 rhs2 op ope comment)
8643 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8644 (FR400-MAJOR M-1) (FR450-MAJOR M-3) PRESERVE-OVF)
8645 (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
8646 (+ pack ACC40Sk op FRinti ope FRintj)
8647 (media-dual-multiply-semantics 1 mode conv rhs1 rhs2)
8648 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8649 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8653 (media-dual-multiply mmulhs HI ext argjhi argjlo OP_7B OPE1_14 "Media dual multiply signed")
8654 (media-dual-multiply mmulhu UHI zext argjhi argjlo OP_7B OPE1_15 "Media dual multiply unsigned")
8656 (media-dual-multiply mmulxhs HI ext argjlo argjhi OP_7B OPE1_28 "Media dual cross multiply signed")
8657 (media-dual-multiply mmulxhu UHI zext argjlo argjhi OP_7B OPE1_29 "Media dual cross multiply unsigned")
8659 (define-pmacro (conditional-media-dual-multiply
8660 name mode conv rhs1 rhs2 op ope comment)
8663 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8664 (FR400-MAJOR M-1) (FR450-MAJOR M-3)
8665 PRESERVE-OVF CONDITIONAL)
8666 (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
8667 (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
8668 (media-dual-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
8669 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8670 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8674 (conditional-media-dual-multiply cmmulhs HI ext argjhi argjlo OP_72 OPE4_0 "Conditional Media dual multiply signed")
8675 (conditional-media-dual-multiply cmmulhu UHI zext argjhi argjlo OP_72 OPE4_1 "Conditional Media dual multiply unsigned")
8677 (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2)
8678 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8679 (if (register-unaligned ACC40Sk 4)
8680 (c-call VOID "@cpu@_media_acc_not_aligned")
8681 (if (orif (register-unaligned FRintieven 2)
8682 (register-unaligned FRintjeven 2))
8683 (c-call VOID "@cpu@_media_register_not_aligned")
8685 (sequence ((mode argihi) (mode argilo)
8686 (mode argjhi) (mode argjlo))
8687 (extract-hilo FRintieven 0 FRintjeven 0
8688 argihi argilo argjhi argjlo)
8689 (media-multiply-semantics conv argihi rhs1 ACC40Sk)
8690 (media-multiply-semantics conv argilo rhs2
8691 (nextreg h-acc40S ACC40Sk 1))
8692 (extract-hilo FRintieven 1 FRintjeven 1
8693 argihi argilo argjhi argjlo)
8694 (media-multiply-semantics conv argihi rhs1
8695 (nextreg h-acc40S ACC40Sk 2))
8696 (media-multiply-semantics conv argilo rhs2
8697 (nextreg h-acc40S ACC40Sk 3)))))))
8700 (define-pmacro (media-quad-multiply name mode conv rhs1 rhs2 op ope comment)
8703 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8704 (FR400-MAJOR M-2) (FR450-MAJOR M-4) PRESERVE-OVF)
8705 (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
8706 (+ pack ACC40Sk op FRintieven ope FRintjeven)
8707 (media-quad-multiply-semantics 1 mode conv rhs1 rhs2)
8708 ((fr400 (unit u-media-2-quad
8709 (in FRinti FRintieven)
8710 (in FRintj FRintjeven)))
8711 (fr450 (unit u-media-2-quad
8712 (in FRinti FRintieven)
8713 (in FRintj FRintjeven)))
8714 (fr500 (unit u-media-quad-mul
8715 (in FRinti FRintieven)
8716 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8720 (media-quad-multiply mqmulhs HI ext argjhi argjlo OP_7B OPE1_1C "Media quad multiply signed")
8721 (media-quad-multiply mqmulhu UHI zext argjhi argjlo OP_7B OPE1_1D "Media quad multiply unsigned")
8723 (media-quad-multiply mqmulxhs HI ext argjlo argjhi OP_7B OPE1_2A "Media quad cross multiply signed")
8724 (media-quad-multiply mqmulxhu UHI zext argjlo argjhi OP_7B OPE1_2B "Media quad cross multiply unsigned")
8726 (define-pmacro (conditional-media-quad-multiply
8727 name mode conv rhs1 rhs2 op ope comment)
8730 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8731 (FR400-MAJOR M-2) (FR450-MAJOR M-4)
8732 PRESERVE-OVF CONDITIONAL)
8733 (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond")
8734 (+ pack ACC40Sk op FRintieven CCi cond ope FRintjeven)
8735 (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
8736 ((fr400 (unit u-media-2-quad
8737 (in FRinti FRintieven)
8738 (in FRintj FRintjeven)))
8739 (fr450 (unit u-media-2-quad
8740 (in FRinti FRintieven)
8741 (in FRintj FRintjeven)))
8742 (fr500 (unit u-media-quad-mul
8743 (in FRinti FRintieven)
8744 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8748 (conditional-media-quad-multiply cmqmulhs HI ext argjhi argjlo OP_74 OPE4_0 "Conditional Media quad multiply signed")
8749 (conditional-media-quad-multiply cmqmulhu UHI zext argjhi argjlo OP_74 OPE4_1 "Conditional Media quad multiply unsigned")
8751 (define-pmacro (media-multiply-acc-semantics
8752 conv arg1 addop arg2 res max min sie)
8753 (sequence ((DI tmp))
8754 (set tmp (addop res (mul DI (conv DI arg1) (conv DI arg2))))
8755 (saturate-v tmp max min sie res))
8758 (define-pmacro (media-dual-multiply-acc-semantics
8759 cond mode conv addop rhw res max min)
8760 (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8761 (if (register-unaligned res 2)
8762 (c-call VOID "@cpu@_media_acc_not_aligned")
8764 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8765 (extract-hilo FRinti 0 FRintj 0
8766 argihi argilo argjhi argjlo)
8767 (media-multiply-acc-semantics conv argihi addop argjhi
8769 max min (msr-sie-acci))
8770 (media-multiply-acc-semantics conv argilo addop argjlo
8772 max min (msr-sie-acci-1))))))
8775 (define-pmacro (media-dual-multiply-acc
8776 name mode conv addop rhw res max min op ope comment)
8779 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8780 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8781 (.str name "$pack $FRinti,$FRintj,$" res)
8782 (+ pack res op FRinti ope FRintj)
8783 (media-dual-multiply-acc-semantics 1 mode conv addop rhw res max min)
8784 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8785 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8789 (media-dual-multiply-acc mmachs HI ext add h-acc40S ACC40Sk
8790 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8792 "Media dual multiply and accumulate signed")
8794 (media-dual-multiply-acc mmachu UHI zext add h-acc40U ACC40Uk
8795 (const DI #xffffffffff) (const DI 0)
8797 "Media dual multiply and accumulate unsigned")
8799 (media-dual-multiply-acc mmrdhs HI ext sub h-acc40S ACC40Sk
8800 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8802 "Media dual multiply and reduce signed")
8804 (media-dual-multiply-acc mmrdhu UHI zext sub h-acc40U ACC40Uk
8805 (const DI #xffffffffff) (const DI 0)
8807 "Media dual multiply and reduce unsigned")
8809 (define-pmacro (conditional-media-dual-multiply-acc
8810 name mode conv addop rhw res max min op ope comment)
8813 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8814 (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
8815 (.str name "$pack $FRinti,$FRintj,$" res ",$CCi,$cond")
8816 (+ pack res op FRinti CCi cond ope FRintj)
8817 (media-dual-multiply-acc-semantics (eq CCi (or cond 2))
8818 mode conv addop rhw res max min)
8819 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8820 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8824 (conditional-media-dual-multiply-acc cmmachs HI ext add h-acc40S ACC40Sk
8825 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8827 "Conditional Media dual multiply and accumulate signed")
8829 (conditional-media-dual-multiply-acc cmmachu UHI zext add h-acc40U ACC40Uk
8830 (const DI #xffffffffff) (const DI 0)
8832 "Conditional Media dual multiply and accumulate unsigned")
8834 (define-pmacro (media-quad-multiply-acc-semantics
8835 cond mode conv addop rhw res max min)
8836 (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8837 (if (register-unaligned res 4)
8838 (c-call VOID "@cpu@_media_acc_not_aligned")
8839 (if (orif (register-unaligned FRintieven 2)
8840 (register-unaligned FRintjeven 2))
8841 (c-call VOID "@cpu@_media_register_not_aligned")
8843 (sequence ((mode argihi) (mode argilo)
8844 (mode argjhi) (mode argjlo))
8845 (extract-hilo FRintieven 0 FRintjeven 0
8846 argihi argilo argjhi argjlo)
8847 (media-multiply-acc-semantics conv argihi addop argjhi
8849 max min (msr-sie-acci))
8850 (media-multiply-acc-semantics conv argilo addop argjlo
8852 max min (msr-sie-acci-1))
8853 (extract-hilo FRintieven 1 FRintjeven 1
8854 argihi argilo argjhi argjlo)
8855 (media-multiply-acc-semantics conv argihi addop argjhi
8857 max min (msr-sie-acci-2))
8858 (media-multiply-acc-semantics conv argilo addop argjlo
8861 (msr-sie-acci-3)))))))
8864 (define-pmacro (media-quad-multiply-acc
8865 name mode conv addop rhw res max min op ope comment)
8868 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8869 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8870 (.str name "$pack $FRintieven,$FRintjeven,$" res)
8871 (+ pack res op FRintieven ope FRintjeven)
8872 (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min)
8873 ((fr400 (unit u-media-2-quad
8874 (in FRinti FRintieven)
8875 (in FRintj FRintjeven)))
8876 (fr450 (unit u-media-2-quad
8877 (in FRinti FRintieven)
8878 (in FRintj FRintjeven)))
8879 (fr500 (unit u-media-quad-mul
8880 (in FRinti FRintieven)
8881 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8885 (media-quad-multiply-acc mqmachs HI ext add h-acc40S ACC40Sk
8886 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8888 "Media quad multiply and accumulate signed")
8890 (media-quad-multiply-acc mqmachu UHI zext add h-acc40U ACC40Uk
8891 (const DI #xffffffffff) (const DI 0)
8893 "Media quad multiply and accumulate unsigned")
8895 (define-pmacro (conditional-media-quad-multiply-acc
8896 name mode conv addop rhw res max min op ope comment)
8899 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8900 (FR400-MAJOR M-2) (FR450-MAJOR M-4) CONDITIONAL)
8901 (.str name "$pack $FRintieven,$FRintjeven,$" res ",$CCi,$cond")
8902 (+ pack res op FRintieven CCi cond ope FRintjeven)
8903 (media-quad-multiply-acc-semantics (eq CCi (or cond 2))
8904 mode conv addop rhw res max min)
8905 ((fr400 (unit u-media-2-quad
8906 (in FRinti FRintieven)
8907 (in FRintj FRintjeven)))
8908 (fr450 (unit u-media-2-quad
8909 (in FRinti FRintieven)
8910 (in FRintj FRintjeven)))
8911 (fr500 (unit u-media-quad-mul
8912 (in FRinti FRintieven)
8913 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8917 (conditional-media-quad-multiply-acc cmqmachs HI ext add h-acc40S ACC40Sk
8918 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8920 "Conditional Media quad multiply and accumulate signed")
8922 (conditional-media-quad-multiply-acc cmqmachu UHI zext add h-acc40U ACC40Uk
8923 (const DI #xffffffffff) (const DI 0)
8925 "Conditional media quad multiply and accumulate unsigned")
8927 (define-pmacro (media-quad-multiply-cross-acc-semantics
8928 cond mode conv addop rhw res max min)
8929 (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8930 (if (register-unaligned res 4)
8931 (c-call VOID "@cpu@_media_acc_not_aligned")
8932 (if (orif (register-unaligned FRintieven 2)
8933 (register-unaligned FRintjeven 2))
8934 (c-call VOID "@cpu@_media_register_not_aligned")
8936 (sequence ((mode argihi) (mode argilo)
8937 (mode argjhi) (mode argjlo))
8938 (extract-hilo FRintieven 0 FRintjeven 0
8939 argihi argilo argjhi argjlo)
8940 (media-multiply-acc-semantics conv argihi addop argjhi
8942 max min (msr-sie-acci-2))
8943 (media-multiply-acc-semantics conv argilo addop argjlo
8945 max min (msr-sie-acci-3))
8946 (extract-hilo FRintieven 1 FRintjeven 1
8947 argihi argilo argjhi argjlo)
8948 (media-multiply-acc-semantics conv argihi addop argjhi
8950 max min (msr-sie-acci))
8951 (media-multiply-acc-semantics conv argilo addop argjlo
8954 (msr-sie-acci-1)))))))
8957 (define-pmacro (media-quad-multiply-cross-acc
8958 name mode conv addop rhw res max min op ope comment)
8961 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8962 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8963 (.str name "$pack $FRintieven,$FRintjeven,$" res)
8964 (+ pack res op FRintieven ope FRintjeven)
8965 (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res
8967 ((fr400 (unit u-media-2-quad
8968 (in FRinti FRintieven)
8969 (in FRintj FRintjeven)))
8970 (fr450 (unit u-media-2-quad
8971 (in FRinti FRintieven)
8972 (in FRintj FRintjeven)))
8973 (fr550 (unit u-media-4-quad)))
8977 (media-quad-multiply-cross-acc mqxmachs HI ext add h-acc40S ACC40Sk
8978 (const DI #x7fffffffff) (const DI #xffffff8000000000)
8980 "Media quad multiply and cross accumulate signed")
8982 (define-pmacro (media-quad-cross-multiply-cross-acc-semantics
8983 cond mode conv addop rhw res max min)
8984 (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8985 (if (register-unaligned res 4)
8986 (c-call VOID "@cpu@_media_acc_not_aligned")
8987 (if (orif (register-unaligned FRintieven 2)
8988 (register-unaligned FRintjeven 2))
8989 (c-call VOID "@cpu@_media_register_not_aligned")
8991 (sequence ((mode argihi) (mode argilo)
8992 (mode argjhi) (mode argjlo))
8993 (extract-hilo FRintieven 0 FRintjeven 0
8994 argihi argilo argjhi argjlo)
8995 (media-multiply-acc-semantics conv argihi addop argjlo
8997 max min (msr-sie-acci-2))
8998 (media-multiply-acc-semantics conv argilo addop argjhi
9000 max min (msr-sie-acci-3))
9001 (extract-hilo FRintieven 1 FRintjeven 1
9002 argihi argilo argjhi argjlo)
9003 (media-multiply-acc-semantics conv argihi addop argjlo
9005 max min (msr-sie-acci))
9006 (media-multiply-acc-semantics conv argilo addop argjhi
9009 (msr-sie-acci-1)))))))
9012 (define-pmacro (media-quad-cross-multiply-cross-acc
9013 name mode conv addop rhw res max min op ope comment)
9016 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
9017 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9018 (.str name "$pack $FRintieven,$FRintjeven,$" res)
9019 (+ pack res op FRintieven ope FRintjeven)
9020 (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res
9022 ((fr400 (unit u-media-2-quad
9023 (in FRinti FRintieven)
9024 (in FRintj FRintjeven)))
9025 (fr450 (unit u-media-2-quad
9026 (in FRinti FRintieven)
9027 (in FRintj FRintjeven)))
9028 (fr550 (unit u-media-4-quad)))
9032 (media-quad-cross-multiply-cross-acc mqxmacxhs HI ext add h-acc40S ACC40Sk
9033 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9035 "Media quad cross multiply and cross accumulate signed")
9037 (define-pmacro (media-quad-cross-multiply-acc-semantics
9038 cond mode conv addop rhw res max min)
9039 (if (c-call SI "@cpu@_check_acc_range" (index-of res))
9040 (if (register-unaligned res 4)
9041 (c-call VOID "@cpu@_media_acc_not_aligned")
9042 (if (orif (register-unaligned FRintieven 2)
9043 (register-unaligned FRintjeven 2))
9044 (c-call VOID "@cpu@_media_register_not_aligned")
9046 (sequence ((mode argihi) (mode argilo)
9047 (mode argjhi) (mode argjlo))
9048 (extract-hilo FRintieven 0 FRintjeven 0
9049 argihi argilo argjhi argjlo)
9050 (media-multiply-acc-semantics conv argihi addop argjlo
9052 max min (msr-sie-acci))
9053 (media-multiply-acc-semantics conv argilo addop argjhi
9055 max min (msr-sie-acci-1))
9056 (extract-hilo FRintieven 1 FRintjeven 1
9057 argihi argilo argjhi argjlo)
9058 (media-multiply-acc-semantics conv argihi addop argjlo
9060 max min (msr-sie-acci-2))
9061 (media-multiply-acc-semantics conv argilo addop argjhi
9064 (msr-sie-acci-3)))))))
9067 (define-pmacro (media-quad-cross-multiply-acc
9068 name mode conv addop rhw res max min op ope comment)
9071 ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
9072 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9073 (.str name "$pack $FRintieven,$FRintjeven,$" res)
9074 (+ pack res op FRintieven ope FRintjeven)
9075 (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res
9077 ((fr400 (unit u-media-2-quad
9078 (in FRinti FRintieven)
9079 (in FRintj FRintjeven)))
9080 (fr450 (unit u-media-2-quad
9081 (in FRinti FRintieven)
9082 (in FRintj FRintjeven)))
9083 (fr550 (unit u-media-4-quad)))
9087 (media-quad-cross-multiply-acc mqmacxhs HI ext add h-acc40S ACC40Sk
9088 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9090 "Media quad cross multiply and accumulate signed")
9092 (define-pmacro (media-complex-semantics
9093 conv lhs1 rhs1 lhs2 rhs2 res max min sie)
9094 (sequence ((DI tmp1) (DI tmp2))
9095 (media-multiply-semantics conv lhs1 rhs1 tmp1)
9096 (media-multiply-semantics conv lhs2 rhs2 tmp2)
9097 (set tmp1 (sub tmp1 tmp2))
9098 (saturate-v tmp1 max min sie res))
9101 (define-pmacro (media-complex-semantics-i
9102 conv lhs1 rhs1 lhs2 rhs2 res max min sie)
9103 (sequence ((DI tmp1) (DI tmp2))
9104 (media-multiply-semantics conv lhs1 rhs1 tmp1)
9105 (media-multiply-semantics conv lhs2 rhs2 tmp2)
9106 (set tmp1 (add tmp1 tmp2))
9107 (saturate-v tmp1 max min sie res))
9110 (define-pmacro (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
9111 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9112 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
9113 (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
9114 (media-complex-semantics conv argihi rhs1 argilo rhs2 ACC40Sk
9115 max min (msr-sie-acci))))
9118 (define-pmacro (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
9119 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9120 (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
9121 (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
9122 (media-complex-semantics-i conv argihi rhs1 argilo rhs2 ACC40Sk
9123 max min (msr-sie-acci))))
9126 (define-pmacro (media-dual-complex
9127 name mode conv rhs1 rhs2 max min op ope comment)
9130 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9131 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9132 (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
9133 (+ pack ACC40Sk op FRinti ope FRintj)
9134 (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
9135 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9136 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9140 (define-pmacro (media-dual-complex-i
9141 name mode conv rhs1 rhs2 max min op ope comment)
9144 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9145 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9146 (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
9147 (+ pack ACC40Sk op FRinti ope FRintj)
9148 (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
9149 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9150 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9154 (media-dual-complex mcpxrs HI ext argjhi argjlo
9155 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9157 "Media dual complex real signed with saturation")
9159 (media-dual-complex mcpxru UHI zext argjhi argjlo
9160 (const DI #xffffffffff) (const DI 0)
9162 "Media dual complex real unsigned with saturation")
9164 (media-dual-complex-i mcpxis HI ext argjlo argjhi
9165 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9167 "Media dual complex imaginary signed with saturation")
9169 (media-dual-complex-i mcpxiu UHI zext argjlo argjhi
9170 (const DI #xffffffffff) (const DI 0)
9172 "Media dual complex imaginary unsigned with saturation")
9174 (define-pmacro (conditional-media-dual-complex
9175 name mode conv rhs1 rhs2 max min op ope comment)
9178 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9179 (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
9180 (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
9181 (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
9182 (if (eq CCi (or cond 2))
9183 (media-dual-complex-semantics mode conv rhs1 rhs2 max min))
9184 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9185 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9189 (define-pmacro (conditional-media-dual-complex-i
9190 name mode conv rhs1 rhs2 max min op ope comment)
9193 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9194 (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
9195 (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
9196 (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
9197 (if (eq CCi (or cond 2))
9198 (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min))
9199 ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9200 (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9204 (conditional-media-dual-complex cmcpxrs HI ext argjhi argjlo
9205 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9207 "Conditional Media dual complex real signed with saturation")
9209 (conditional-media-dual-complex cmcpxru UHI zext argjhi argjlo
9210 (const DI #xffffffffff) (const DI 0)
9212 "Conditional Media dual complex real unsigned with saturation")
9214 (conditional-media-dual-complex-i cmcpxis HI ext argjlo argjhi
9215 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9217 "Conditional Media dual complex imaginary signed with saturation")
9219 (conditional-media-dual-complex-i cmcpxiu UHI zext argjlo argjhi
9220 (const DI #xffffffffff) (const DI 0)
9222 "Conditional Media dual complex imaginary unsigned with saturation")
9224 (define-pmacro (media-quad-complex
9225 name mode conv rhs1 rhs2 max min op ope comment)
9228 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9229 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9230 (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
9231 (+ pack ACC40Sk op FRintieven ope FRintjeven)
9232 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9233 (if (register-unaligned ACC40Sk 2)
9234 (c-call VOID "@cpu@_media_acc_not_aligned")
9235 (if (orif (register-unaligned FRintieven 2)
9236 (register-unaligned FRintjeven 2))
9237 (c-call VOID "@cpu@_media_register_not_aligned")
9238 (sequence ((mode argihi) (mode argilo)
9239 (mode argjhi) (mode argjlo))
9240 (extract-hilo FRintieven 0 FRintjeven 0
9241 argihi argilo argjhi argjlo)
9242 (media-complex-semantics conv argihi rhs1 argilo rhs2
9244 max min (msr-sie-acci))
9245 (extract-hilo FRintieven 1 FRintjeven 1
9246 argihi argilo argjhi argjlo)
9247 (media-complex-semantics conv argihi rhs1 argilo rhs2
9248 (nextreg h-acc40S ACC40Sk 1)
9249 max min (msr-sie-acci-1))))))
9250 ((fr400 (unit u-media-2-quad
9251 (in FRinti FRintieven)
9252 (in FRintj FRintjeven)))
9253 (fr450 (unit u-media-2-quad
9254 (in FRinti FRintieven)
9255 (in FRintj FRintjeven)))
9256 (fr500 (unit u-media-quad-complex
9257 (in FRinti FRintieven)
9258 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
9262 (define-pmacro (media-quad-complex-i
9263 name mode conv rhs1 rhs2 max min op ope comment)
9266 ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9267 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9268 (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
9269 (+ pack ACC40Sk op FRintieven ope FRintjeven)
9270 (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9271 (if (register-unaligned ACC40Sk 2)
9272 (c-call VOID "@cpu@_media_acc_not_aligned")
9273 (if (orif (register-unaligned FRintieven 2)
9274 (register-unaligned FRintjeven 2))
9275 (c-call VOID "@cpu@_media_register_not_aligned")
9276 (sequence ((mode argihi) (mode argilo)
9277 (mode argjhi) (mode argjlo))
9278 (extract-hilo FRintieven 0 FRintjeven 0
9279 argihi argilo argjhi argjlo)
9280 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
9282 max min (msr-sie-acci))
9283 (extract-hilo FRintieven 1 FRintjeven 1
9284 argihi argilo argjhi argjlo)
9285 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
9286 (nextreg h-acc40S ACC40Sk 1)
9287 max min (msr-sie-acci-1))))))
9288 ((fr400 (unit u-media-2-quad
9289 (in FRinti FRintieven)
9290 (in FRintj FRintjeven)))
9291 (fr450 (unit u-media-2-quad
9292 (in FRinti FRintieven)
9293 (in FRintj FRintjeven)))
9294 (fr500 (unit u-media-quad-complex
9295 (in FRinti FRintieven)
9296 (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
9300 (media-quad-complex mqcpxrs HI ext argjhi argjlo
9301 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9303 "Media quad complex real signed with saturation")
9305 (media-quad-complex mqcpxru UHI zext argjhi argjlo
9306 (const DI #xffffffffff) (const DI 0)
9308 "Media quad complex real unsigned with saturation")
9310 (media-quad-complex-i mqcpxis HI ext argjlo argjhi
9311 (const DI #x7fffffffff) (const DI #xffffff8000000000)
9313 "Media quad complex imaginary signed with saturation")
9315 (media-quad-complex-i mqcpxiu UHI zext argjlo argjhi
9316 (const DI #xffffffffff) (const DI 0)
9318 "Media quad complex imaginary unsigned with saturation")
9320 (define-pmacro (media-pack src1 src2 targ offset)
9322 (set (halfword hi targ offset) (halfword lo src1 offset))
9323 (set (halfword lo targ offset) (halfword lo src2 offset)))
9326 (define-pmacro (media-expand-halfword-to-word-semantics cond)
9328 (sequence ((UHI tmp))
9330 (set tmp (halfword lo FRinti 0))
9331 (set tmp (halfword hi FRinti 0)))
9332 (set (halfword hi FRintk 0) tmp)
9333 (set (halfword lo FRintk 0) tmp)))
9337 "Media expand halfword to word"
9338 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9339 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9340 "mexpdhw$pack $FRinti,$u6,$FRintk"
9341 (+ pack FRintk OP_7B FRinti OPE1_32 u6)
9342 (media-expand-halfword-to-word-semantics 1)
9343 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9344 (fr500 (unit u-media)) (fr550 (unit u-media)))
9348 "Conditional media expand halfword to word"
9349 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9350 (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
9351 "cmexpdhw$pack $FRinti,$u6,$FRintk,$CCi,$cond"
9352 (+ pack FRintk OP_76 FRinti CCi cond OPE4_2 u6)
9353 (media-expand-halfword-to-word-semantics (eq CCi (or cond 2)))
9354 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9355 (fr500 (unit u-media)) (fr550 (unit u-media)))
9358 (define-pmacro (media-expand-halfword-to-double-semantics cond)
9359 (if (register-unaligned FRintkeven 2)
9360 (c-call VOID "@cpu@_media_register_not_aligned")
9362 (sequence ((UHI tmp))
9363 ; a hack to get FRintkeven referenced for profiling
9364 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9366 (set tmp (halfword lo FRinti 0))
9367 (set tmp (halfword hi FRinti 0)))
9368 (set (halfword hi FRintkeven 0) tmp)
9369 (set (halfword lo FRintkeven 0) tmp)
9370 (set (halfword hi FRintkeven 1) tmp)
9371 (set (halfword lo FRintkeven 1) tmp))))
9375 "Media expand halfword to double"
9376 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9377 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9378 "mexpdhd$pack $FRinti,$u6,$FRintkeven"
9379 (+ pack FRintkeven OP_7B FRinti OPE1_33 u6)
9380 (media-expand-halfword-to-double-semantics 1)
9381 ((fr400 (unit u-media-dual-expand
9382 (out FRintk FRintkeven)))
9383 (fr450 (unit u-media-dual-expand
9384 (out FRintk FRintkeven)))
9385 (fr500 (unit u-media-dual-expand
9386 (out FRintk FRintkeven)))
9387 (fr550 (unit u-media-dual-expand)))
9391 "Conditional media expand halfword to double"
9392 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9393 (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9394 "cmexpdhd$pack $FRinti,$u6,$FRintkeven,$CCi,$cond"
9395 (+ pack FRintkeven OP_76 FRinti CCi cond OPE4_3 u6)
9396 (media-expand-halfword-to-double-semantics (eq CCi (or cond 2)))
9397 ((fr400 (unit u-media-dual-expand
9398 (out FRintk FRintkeven)))
9399 (fr450 (unit u-media-dual-expand
9400 (out FRintk FRintkeven)))
9401 (fr500 (unit u-media-dual-expand
9402 (out FRintk FRintkeven)))
9403 (fr550 (unit u-media-dual-expand)))
9407 "Media halfword pack"
9408 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9409 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9410 "mpackh$pack $FRinti,$FRintj,$FRintk"
9411 (+ pack FRintk OP_7B FRinti OPE1_34 FRintj)
9412 (media-pack FRinti FRintj FRintk 0)
9413 ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9414 (fr500 (unit u-media)) (fr550 (unit u-media)))
9419 ((UNIT FM01) (FR500-MAJOR M-5) (FR550-MAJOR M-3)
9420 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9421 "mdpackh$pack $FRintieven,$FRintjeven,$FRintkeven"
9422 (+ pack FRintkeven OP_7B FRintieven OPE1_36 FRintjeven)
9423 (if (orif (register-unaligned FRintieven 2)
9424 (orif (register-unaligned FRintjeven 2)
9425 (register-unaligned FRintkeven 2)))
9426 (c-call VOID "@cpu@_media_register_not_aligned")
9428 ; hack to get these referenced for profiling
9429 (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
9430 (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9431 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9432 (media-pack FRintieven FRintjeven FRintkeven 0)
9433 (media-pack FRintieven FRintjeven FRintkeven 1)))
9434 ((fr400 (unit u-media-3-quad
9435 (in FRinti FRintieven)
9436 (in FRintj FRintjeven)
9437 (out FRintk FRintkeven)))
9438 (fr450 (unit u-media-3-quad
9439 (in FRinti FRintieven)
9440 (in FRintj FRintjeven)
9441 (out FRintk FRintkeven)))
9442 (fr500 (unit u-media-quad-arith
9443 (in FRinti FRintieven)
9444 (in FRintj FRintjeven)
9445 (out FRintk FRintkeven)))
9446 (fr550 (unit u-media-quad)))
9449 (define-pmacro (media-unpack src soff targ toff)
9451 (set (halfword hi targ toff) (halfword hi src soff))
9452 (set (halfword lo targ toff) (halfword hi src soff))
9453 (set (halfword hi targ (add toff 1)) (halfword lo src soff))
9454 (set (halfword lo targ (add toff 1)) (halfword lo src soff)))
9458 "Media halfword unpack"
9459 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9460 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9461 "munpackh$pack $FRinti,$FRintkeven"
9462 (+ pack FRintkeven OP_7B FRinti OPE1_35 (FRj-null))
9463 (if (register-unaligned FRintkeven 2)
9464 (c-call VOID "@cpu@_media_register_not_aligned")
9466 ; hack to get these referenced for profiling
9467 (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
9468 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9469 (media-unpack FRinti 0 FRintkeven 0)))
9470 ((fr400 (unit u-media-dual-expand
9471 (out FRintk FRintkeven)))
9472 (fr450 (unit u-media-dual-expand
9473 (out FRintk FRintkeven)))
9474 (fr500 (unit u-media-dual-expand
9475 (out FRintk FRintkeven)))
9476 (fr550 (unit u-media-dual-expand)))
9481 ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
9482 "mdunpackh$pack $FRintieven,$FRintk"
9483 (+ pack FRintk OP_7B FRintieven OPE1_37 (FRj-null))
9484 (if (orif (register-unaligned FRintieven 2) (register-unaligned FRintk 4))
9485 (c-call VOID "@cpu@_media_register_not_aligned")
9487 ; hack to get these referenced for profiling
9488 (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
9489 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9490 (media-unpack FRintieven 0 FRintk 0)
9491 (media-unpack FRintieven 1 FRintk 2)))
9492 ((fr500 (unit u-media-dual-unpack
9493 (in FRinti FRintieven))))
9496 (define-pmacro (ubyte num arg offset)
9497 (reg (.sym h-fr_ num) (add (index-of arg) offset)))
9499 (define-pmacro (mbtoh-semantics cond)
9500 (if (register-unaligned FRintkeven 2)
9501 (c-call VOID "@cpu@_media_register_not_aligned")
9504 (set (halfword hi FRintkeven 0) (ubyte 3 FRintj 0))
9505 (set (halfword lo FRintkeven 0) (ubyte 2 FRintj 0))
9506 (set (halfword hi FRintkeven 1) (ubyte 1 FRintj 0))
9507 (set (halfword lo FRintkeven 1) (ubyte 0 FRintj 0)))))
9511 "Media convert byte to halfword"
9512 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9513 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9514 "mbtoh$pack $FRintj,$FRintkeven"
9515 (+ pack FRintkeven OP_7B (FRi-null) OPE1_38 FRintj)
9517 ; hack to get these referenced for profiling
9518 (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9519 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9520 (mbtoh-semantics 1))
9521 ((fr400 (unit u-media-dual-expand
9522 (out FRintk FRintkeven)))
9523 (fr450 (unit u-media-dual-expand
9524 (out FRintk FRintkeven)))
9525 (fr500 (unit u-media-dual-btoh
9526 (out FRintk FRintkeven)))
9527 (fr550 (unit u-media-dual-expand)))
9531 "Conditional media convert byte to halfword"
9532 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9533 (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9534 "cmbtoh$pack $FRintj,$FRintkeven,$CCi,$cond"
9535 (+ pack FRintkeven OP_77 (FRi-null) CCi cond OPE4_0 FRintj)
9537 ; hack to get these referenced for profiling
9538 (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9539 (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9540 (mbtoh-semantics (eq CCi (or cond 2))))
9541 ((fr400 (unit u-media-dual-expand
9542 (out FRintk FRintkeven)))
9543 (fr450 (unit u-media-dual-expand
9544 (out FRintk FRintkeven)))
9545 (fr500 (unit u-media-dual-btoh
9546 (out FRintk FRintkeven)))
9547 (fr550 (unit u-media-dual-expand
9548 (in FRinti FRintj))))
9551 (define-pmacro (mhtob-semantics cond)
9552 (if (register-unaligned FRintjeven 2)
9553 (c-call VOID "@cpu@_media_register_not_aligned")
9556 (set (ubyte 3 FRintk 0) (halfword hi FRintjeven 0))
9557 (set (ubyte 2 FRintk 0) (halfword lo FRintjeven 0))
9558 (set (ubyte 1 FRintk 0) (halfword hi FRintjeven 1))
9559 (set (ubyte 0 FRintk 0) (halfword lo FRintjeven 1)))))
9563 "Media convert halfword to byte"
9564 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9565 (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9566 "mhtob$pack $FRintjeven,$FRintk"
9567 (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintjeven)
9569 ; hack to get these referenced for profiling
9570 (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9571 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9572 (mhtob-semantics 1))
9573 ((fr400 (unit u-media-dual-htob
9574 (in FRintj FRintjeven)))
9575 (fr450 (unit u-media-dual-htob
9576 (in FRintj FRintjeven)))
9577 (fr500 (unit u-media-dual-htob
9578 (in FRintj FRintjeven)))
9579 (fr550 (unit u-media-3-dual
9580 (in FRinti FRintjeven))))
9584 "Conditional media convert halfword to byte"
9585 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9586 (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9587 "cmhtob$pack $FRintjeven,$FRintk,$CCi,$cond"
9588 (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintjeven)
9590 ; hack to get these referenced for profiling
9591 (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9592 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9593 (mhtob-semantics (eq CCi (or cond 2))))
9594 ((fr400 (unit u-media-dual-htob
9595 (in FRintj FRintjeven)))
9596 (fr450 (unit u-media-dual-htob
9597 (in FRintj FRintjeven)))
9598 (fr500 (unit u-media-dual-htob
9599 (in FRintj FRintjeven)))
9600 (fr550 (unit u-media-3-dual
9601 (in FRinti FRintjeven))))
9604 (define-pmacro (mbtohe-semantics cond)
9605 (if (register-unaligned FRintk 4)
9606 (c-call VOID "@cpu@_media_register_not_aligned")
9609 (set (halfword hi FRintk 0) (ubyte 3 FRintj 0))
9610 (set (halfword lo FRintk 0) (ubyte 3 FRintj 0))
9611 (set (halfword hi FRintk 1) (ubyte 2 FRintj 0))
9612 (set (halfword lo FRintk 1) (ubyte 2 FRintj 0))
9613 (set (halfword hi FRintk 2) (ubyte 1 FRintj 0))
9614 (set (halfword lo FRintk 2) (ubyte 1 FRintj 0))
9615 (set (halfword hi FRintk 3) (ubyte 0 FRintj 0))
9616 (set (halfword lo FRintk 3) (ubyte 0 FRintj 0)))))
9620 "Media convert byte to halfword extended"
9621 ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
9622 "mbtohe$pack $FRintj,$FRintk"
9623 (+ pack FRintk OP_7B (FRi-null) OPE1_3A FRintj)
9625 ; hack to get these referenced for profiling
9626 (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9627 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9628 (mbtohe-semantics 1))
9629 ((fr500 (unit u-media-dual-btohe)))
9633 "Conditional media convert byte to halfword extended"
9634 ((UNIT FM01) (FR500-MAJOR M-7) CONDITIONAL (MACH simple,tomcat,frv))
9635 "cmbtohe$pack $FRintj,$FRintk,$CCi,$cond"
9636 (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_2 FRintj)
9638 ; hack to get these referenced for profiling
9639 (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9640 (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9641 (mbtohe-semantics (eq CCi (or cond 2))))
9642 ((fr500 (unit u-media-dual-btohe)))
9646 ; A special case of mclracc
9647 (dni mnop "Media nop"
9648 ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-1)
9649 (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9651 (+ pack (f-ACC40Sk 63) OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
9656 ; mclracc with #A==0
9658 "Media clear accumulator(s)"
9659 ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9660 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9661 "mclracc$pack $ACC40Sk,$A0"
9662 (+ pack ACC40Sk OP_7B (f-A 0) (misc-null-10) OPE1_3B (FRj-null))
9663 (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 0)
9664 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9665 (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
9668 ; mclracc with #A==1
9670 "Media clear accumulator(s)"
9671 ((UNIT MCLRACC-1) (FR500-MAJOR M-6) (FR550-MAJOR M-3)
9672 (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9673 "mclracc$pack $ACC40Sk,$A1"
9674 (+ pack ACC40Sk OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
9675 (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 1)
9676 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4-mclracca))
9677 (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
9681 "Media read accumulator"
9682 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9683 (FR400-MAJOR M-1) (FR450-MAJOR M-5))
9684 "mrdacc$pack $ACC40Si,$FRintk"
9685 (+ pack FRintk OP_7B ACC40Si OPE1_3C (FRj-null))
9686 (set FRintk ACC40Si)
9687 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9688 (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
9692 "Media read accumulator guard"
9693 ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9694 (FR400-MAJOR M-1) (FR450-MAJOR M-5))
9695 "mrdaccg$pack $ACCGi,$FRintk"
9696 (+ pack FRintk OP_7B ACCGi OPE1_3E (FRj-null))
9698 ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
9699 (fr500 (unit u-media)) (fr550 (unit u-media-3-acc (in ACC40Si ACCGi))))
9703 "Media write accumulator"
9704 ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9705 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9706 "mwtacc$pack $FRinti,$ACC40Sk"
9707 (+ pack ACC40Sk OP_7B FRinti OPE1_3D (FRj-null))
9708 (set ACC40Sk (or (and ACC40Sk (const DI #xffffffff00000000))
9710 ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9711 (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc)))
9715 "Media write accumulator guard"
9716 ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9717 (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9718 "mwtaccg$pack $FRinti,$ACCGk"
9719 (+ pack ACCGk OP_7B FRinti OPE1_3F (FRj-null))
9721 ; hack to get these referenced for profiling
9722 (c-raw-call VOID "frv_ref_SI" ACCGk)
9724 ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
9725 (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc (in ACC40Sk ACCGk))))
9728 (define-pmacro (media-cop num op)
9729 (dni (.sym mcop num)
9730 "Media custom instruction"
9731 ((UNIT FM01) (FR500-MAJOR M-1) (MACH frv))
9732 (.str "mcop" num "$pack $FRi,$FRj,$FRk")
9733 (+ pack FRk op FRi OPE1_00 FRj)
9734 (c-call VOID "@cpu@_media_cop" num)
9743 ; A nop is defined to be a "ori gr0,0,gr0"
9744 ; This needn't be a macro-insn, but making it one greatly simplifies decode.c
9745 ; On the other hand spending a little time in the decoder is often worth it.
9748 ((UNIT IALL) (FR500-MAJOR I-1) (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9750 (emit ori pack (GRi 0) (s12 0) (GRk 0))
9753 ; Floating point NOP
9755 "Floating point nop"
9756 ((UNIT FMALL) (FR500-MAJOR F-8) (FR550-MAJOR F-1) (MACH simple,tomcat,fr500,fr550,frv))
9758 (+ pack (rd-null) OP_79 (FRi-null) OPE1_0D (FRj-null))
9763 ; A return instruction
9765 (NO-DIS (UNIT B01) (FR500-MAJOR B-3)
9766 (FR400-MAJOR B-3) (FR450-MAJOR B-3))
9768 (emit bralr pack (hint_taken 2))
9772 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9773 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9774 "cmp$pack $GRi,$GRj,$ICCi_1"
9775 (emit subcc pack GRi GRj (GRk 0) ICCi_1)
9778 (dnmi cmpi "compare immediate"
9779 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9780 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9781 "cmpi$pack $GRi,$s10,$ICCi_1"
9782 (emit subicc pack GRi s10 (GRk 0) ICCi_1)
9785 (dnmi ccmp "conditional compare"
9786 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9787 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
9788 "ccmp$pack $GRi,$GRj,$CCi,$cond"
9789 (emit csubcc pack GRi GRj (GRk 0) CCi cond)
9793 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9794 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9795 "mov$pack $GRi,$GRk"
9796 (emit ori pack GRi (s12 0) GRk)
9799 (dnmi cmov "conditional move"
9800 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9801 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
9802 "cmov$pack $GRi,$GRk,$CCi,$cond"
9803 (emit cor pack GRi (GRj 0) GRk CCi cond)