1 ; IQ10-only CPU description. -*- Scheme -*-
3 ; Copyright 2001, 2002, 2007 Free Software Foundation, Inc.
5 ; Contributed by Red Hat Inc; developed under contract from Vitesse.
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,
27 (dni andoui-q10 "iq10 and upper ones immediate" (MACH10 USES-RS USES-RT)
28 "andoui $rt,$rs,$hi16"
29 (+ OP10_ANDOUI rs rt hi16)
30 (set rt (and rs (or (sll hi16 16) #xFFFF)))
33 (dni andoui2-q10 "iq10 and upper ones immediate" (ALIAS NO-DIS MACH10 USES-RS USES-RT)
34 "andoui ${rt-rs},$hi16"
35 (+ OP10_ANDOUI rt-rs hi16)
36 (set rt-rs (and rt-rs (or (sll hi16 16) #xFFFF)))
39 (dni orui-q10 "or upper immediate" (MACH10 USES-RS USES-RT)
41 (+ OP10_ORUI rs rt hi16)
42 (set rt (or rs (sll hi16 16)))
45 (dni orui2-q10 "or upper immediate" (ALIAS NO-DIS MACH10 USES-RS USES-RT)
47 (+ OP10_ORUI rt-rs hi16)
48 (set rt-rs (or rt-rs (sll hi16 16)))
51 (dni mrgbq10 "merge bytes" (MACH10 USES-RD USES-RS USES-RT)
52 "mrgb $rd,$rs,$rt,$maskq10"
53 (+ OP_SPECIAL rs rt rd maskq10 FUNC_MRGB)
55 (if (bitclear? mask 0)
56 (set temp (and rs #xFF))
57 (set temp (and rt #xFF)))
58 (if (bitclear? mask 1)
59 (set temp (or temp (and rs #xFF00)))
60 (set temp (or temp (and rt #xFF00))))
61 (if (bitclear? mask 2)
62 (set temp (or temp (and rs #xFF0000)))
63 (set temp (or temp (and rt #xFF0000))))
64 (if (bitclear? mask 3)
65 (set temp (or temp (and rs #xFF000000)))
66 (set temp (or temp (and rt #xFF000000))))
70 (dni mrgbq102 "merge bytes" (ALIAS NO-DIS MACH10 USES-RD USES-RS USES-RT)
71 "mrgb ${rd-rs},$rt,$maskq10"
72 (+ OP_SPECIAL rt rd-rs maskq10 FUNC_MRGB)
74 (if (bitclear? mask 0)
75 (set temp (and rd-rs #xFF))
76 (set temp (and rt #xFF)))
77 (if (bitclear? mask 1)
78 (set temp (or temp (and rd-rs #xFF00)))
79 (set temp (or temp (and rt #xFF00))))
80 (if (bitclear? mask 2)
81 (set temp (or temp (and rd-rs #xFF0000)))
82 (set temp (or temp (and rt #xFF0000))))
83 (if (bitclear? mask 3)
84 (set temp (or temp (and rd-rs #xFF000000)))
85 (set temp (or temp (and rt #xFF000000))))
89 ; In the future, we'll want the j & jal to use the 21 bit target, with
90 ; the upper five bits shifted up. For now, give 'em the 16 bit target.
92 (dni jq10 "jump" (MACH10)
94 (+ OP_J (f-rs 0) (f-rt 0) jmptarg)
96 ; (+ OP_J upper-5-jmptargq10 (f-rt 0) lower-16-jmptargq10)
97 (delay 1 (set pc jmptarg))
100 (dni jalq10 "jump and link" (MACH10 USES-RT)
102 (+ OP_JAL (f-rs 0) rt jmptarg)
103 ; "jal $rt,$jmptargq10"
104 ; (+ OP_JAL upper-5-jmptargq10 rt lower-16-jmptargq10)
111 (dni jalq10-2 "jump and link, implied r31" (MACH10 USES-RT)
113 (+ OP_JAL (f-rs 0) (f-rt 31) jmptarg)
120 ; Branch instructions.
122 (dni bbil "branch bit immediate likely" (MACH10 USES-RS)
123 "bbil $rs($bitnum),$offset"
124 (+ OP10_BBIL rs bitnum offset)
125 (if (bitset? rs bitnum)
126 (delay 1 (set pc offset))
130 (dni bbinl "branch bit immediate negated likely" (MACH10 USES-RS)
131 "bbinl $rs($bitnum),$offset"
132 (+ OP10_BBINL rs bitnum offset)
133 (if (bitclear? rs bitnum)
134 (delay 1 (set pc offset))
138 (dni bbvl "branch bit variable likely" (MACH10 USES-RS USES-RT)
139 "bbvl $rs,$rt,$offset"
140 (+ OP10_BBVL rs rt offset)
141 (if (bitset? rs (and rt #x1F))
142 (delay 1 (set pc offset))
146 (dni bbvnl "branch bit variable negated likely" (MACH10 USES-RS USES-RT)
147 "bbvnl $rs,$rt,$offset"
148 (+ OP10_BBVNL rs rt offset)
149 (if (bitclear? rs (and rt #x1F))
150 (delay 1 (set pc offset))
154 (dni bgtzal "branch if greater than zero and link" (MACH10 USES-RS USES-R31)
156 (+ OP_REGIMM rs FUNC_BGTZAL offset)
159 (set (reg h-gr 31) (add pc 8))
160 (delay 1 (set pc offset))))
164 "branch if greater than zero and link likely" (MACH10 USES-RS USES-R31)
165 "bgtzall $rs,$offset"
166 (+ OP_REGIMM rs FUNC_BGTZALL offset)
169 (set (reg h-gr 31) (add pc 8))
170 (delay 1 (set pc offset)))
174 (dni blezal "branch if less than or equal to zero and link" (MACH10 USES-RS USES-R31)
176 (+ OP_REGIMM rs FUNC_BLEZAL offset)
179 (set (reg h-gr 31) (add pc 8))
180 (delay 1 (set pc offset))))
184 "branch if less than or equal to zero and link likely" (MACH10 USES-RS USES-R31)
185 "blezall $rs,$offset"
186 (+ OP_REGIMM rs FUNC_BLEZALL offset)
189 (set (reg h-gr 31) (add pc 8))
190 (delay 1 (set pc offset)))
194 (dni bgtz-q10 "branch if greater than zero" (MACH10 USES-RS)
196 (+ OP_REGIMM rs FUNC_BGTZ offset)
198 (delay 1 (set pc offset)))
201 (dni bgtzl-q10 "branch if greater than zero likely" (MACH10 USES-RS)
203 (+ OP_REGIMM rs FUNC_BGTZL offset)
205 (delay 1 (set pc offset))
210 (dni blez-q10 "branch if less than or equal to zero" (MACH10 USES-RS)
212 (+ OP_REGIMM rs FUNC_BLEZ offset)
214 (delay 1 (set pc offset)))
217 (dni blezl-q10 "branch if less than or equal to zero likely" (MACH10 USES-RS)
219 (+ OP_REGIMM rs FUNC_BLEZL offset)
221 (delay 1 (set pc offset))
225 (dni bmb-q10 "branch if matching byte-lane" (MACH10 USES-RS USES-RT)
226 "bmb $rs,$rt,$offset"
227 (+ OP10_BMB rs rt offset)
228 (sequence ((BI branch?))
230 (if (eq (and rs #xFF) (and rt #xFF))
232 (if (eq (and rs #xFF00) (and rt #xFF00))
234 (if (eq (and rs #xFF0000) (and rt #xFF0000))
236 (if (eq (and rs #xFF000000) (and rt #xFF000000))
239 (delay 1 (set pc offset))))
242 (dni bmbl "branch if matching byte-lane likely" (MACH10 USES-RS USES-RT)
243 "bmbl $rs,$rt,$offset"
244 (+ OP10_BMBL rs rt offset)
245 (sequence ((BI branch?))
247 (if (eq (and rs #xFF) (and rt #xFF))
249 (if (eq (and rs #xFF00) (and rt #xFF00))
251 (if (eq (and rs #xFF0000) (and rt #xFF0000))
253 (if (eq (and rs #xFF000000) (and rt #xFF000000))
256 (delay 1 (set pc offset))
260 (dni bri "branch if register invalid" (MACH10 USES-RS)
262 (+ OP_REGIMM rs FUNC_BRI offset)
264 (delay 1 (set pc offset))
268 (dni brv "branch if register invalid" (MACH10 USES-RS)
270 (+ OP_REGIMM rs FUNC_BRV offset)
272 (delay 1 (set pc offset))
278 (dni bctx "branch if the current context == instruction[21]" (MACH10 USES-RS)
280 (+ OP_REGIMM rs FUNC_BCTX offset)
281 (delay 1 (set pc offset))
284 (dni yield "unconditional yield to the other context" (MACH10)
286 (+ OP_SPECIAL (f-rs 0) (f-rt 0) (f-rd 0) (f-shamt 0) FUNC10_YIELD)
290 ; Special instructions.
292 (dni crc32 "CRC, 32 bit input" (MACH10 USES-RD USES-RS USES-RT)
294 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_CRC32)
298 (dni crc32b "CRC, 8 bit input" (MACH10 USES-RD USES-RS USES-RT)
300 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_CRC32B)
304 (dni cnt1s "Count ones" (MACH10 USES-RD USES-RS)
306 (+ OP_SPECIAL rs rt rd (f-shamt 0) FUNC10_CNT1S)
311 ; Special Instructions
313 (dni avail "Mark Header Buffer Available" (MACH10 USES-RD)
315 (+ OP_COP3 (f-rs 0) (f-rt 0) rd (f-shamt 0) FUNC10_AVAIL)
319 (dni free "Mark Header Buffer Free" (MACH10 USES-RS USES-RD)
321 (+ OP_COP3 rs (f-rt 0) rd (f-shamt 0) FUNC10_FREE)
325 (dni tstod "Test Header Buffer Order Dependency" (MACH10 USES-RS USES-RD)
327 (+ OP_COP3 rs (f-rt 0) rd (f-shamt 0) FUNC10_TSTOD)
331 (dni cmphdr "Get a Complete Header" (MACH10 USES-RD)
333 (+ OP_COP3 (f-rs 0) (f-rt 0) rd (f-shamt 0) FUNC10_CMPHDR)
337 (dni mcid "Allocate a Multicast ID" (MACH10 USES-RD USES-RT)
339 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_MCID)
343 (dni dba "Allocate a Data Buffer Pointer" (MACH10 USES-RD)
345 (+ OP_COP3 (f-rs 0) (f-rt 0) rd (f-shamt 0) FUNC10_DBA)
349 (dni dbd "Deallocate a Data Buffer Pointer" (MACH10 USES-RS USES-RT USES-RD)
351 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_DBD)
355 (dni dpwt "DSTN_PORT Write" (MACH10 USES-RS USES-RD)
357 (+ OP_COP3 rs (f-rt 0) rd (f-shamt 0) FUNC10_DPWT)
361 ; Architectural and coprocessor instructions.
363 (dni chkhdrq10 "" (MACH10 USES-RS USES-RD)
365 (+ OP_COP3 rs (f-rt 0) rd (f-shamt 0) FUNC10_CHKHDR)
369 ; Coprocessor DMA Instructions (IQ10)
371 (dni rba "Read Bytes Absolute" (MACH10 USES-RS USES-RT USES-RD)
373 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_RBA)
377 (dni rbal "Read Bytes Absolute and Lock" (MACH10 USES-RS USES-RT USES-RD)
379 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_RBAL)
383 (dni rbar "Read Bytes Absolute and Release" (MACH10 USES-RS USES-RT USES-RD)
385 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_RBAR)
389 (dni wba "Write Bytes Absolute" (MACH10 USES-RS USES-RT USES-RD)
391 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_WBA)
395 (dni wbau "Write Bytes Absolute and Unlock" (MACH10 USES-RS USES-RT USES-RD)
397 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_WBAU)
401 (dni wbac "Write Bytes Absolute Cacheable" (MACH10 USES-RS USES-RT USES-RD)
403 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_WBAC)
407 (dni rbi "Read Bytes Immediate" (MACH10 USES-RD USES-RS USES-RT)
408 "rbi $rd,$rs,$rt,$bytecount"
409 (+ OP_COP3 rs rt rd FUNC10_RBI bytecount)
413 (dni rbil "Read Bytes Immediate and Lock" (MACH10 USES-RD USES-RS USES-RT)
414 "rbil $rd,$rs,$rt,$bytecount"
415 (+ OP_COP3 rs rt rd FUNC10_RBIL bytecount)
419 (dni rbir "Read Bytes Immediate and Release" (MACH10 USES-RD USES-RS USES-RT)
420 "rbir $rd,$rs,$rt,$bytecount"
421 (+ OP_COP3 rs rt rd FUNC10_RBIR bytecount)
425 (dni wbi "Write Bytes Immediate" (MACH10 USES-RD USES-RS USES-RT)
426 "wbi $rd,$rs,$rt,$bytecount"
427 (+ OP_COP3 rs rt rd FUNC10_WBI bytecount)
431 (dni wbic "Write Bytes Immediate Cacheable" (MACH10 USES-RD USES-RS USES-RT)
432 "wbic $rd,$rs,$rt,$bytecount"
433 (+ OP_COP3 rs rt rd FUNC10_WBIC bytecount)
437 (dni wbiu "Write Bytes Immediate" (MACH10 USES-RD USES-RS USES-RT)
438 "wbiu $rd,$rs,$rt,$bytecount"
439 (+ OP_COP3 rs rt rd FUNC10_WBIU bytecount)
443 (dni pkrli "Packet Release Immediate" (MACH10 USES-RD USES-RS USES-RT)
444 "pkrli $rd,$rs,$rt,$bytecount"
445 (+ OP_COP2 rs rt rd FUNC10_PKRLI bytecount)
449 (dni pkrlih "Packet Release Immediate and Hold" (MACH10 USES-RD USES-RS USES-RT)
450 "pkrlih $rd,$rs,$rt,$bytecount"
451 (+ OP_COP2 rs rt rd FUNC10_PKRLIH bytecount)
455 (dni pkrliu "Packet Release Immediate Unconditional" (MACH10 USES-RD USES-RS USES-RT)
456 "pkrliu $rd,$rs,$rt,$bytecount"
457 (+ OP_COP2 rs rt rd FUNC10_PKRLIU bytecount)
461 (dni pkrlic "Packet Release Immediate Continue" (MACH10 USES-RD USES-RS USES-RT)
462 "pkrlic $rd,$rs,$rt,$bytecount"
463 (+ OP_COP2 rs rt rd FUNC10_PKRLIC bytecount)
467 (dni pkrla "Packet Release Absolute" (MACH10 USES-RS USES-RT USES-RD)
469 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_PKRLA)
473 (dni pkrlau "Packet Release Absolute Unconditional" (MACH10 USES-RS USES-RT USES-RD)
475 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_PKRLAU)
479 (dni pkrlah "Packet Release Absolute and Hold" (MACH10 USES-RS USES-RT USES-RD)
481 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_PKRLAH)
485 (dni pkrlac "Packet Release Absolute Continue" (MACH10 USES-RS USES-RT USES-RD)
487 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_PKRLAC)
491 ; Main Memory Access Instructions
493 (dni lock "lock memory" (MACH10 USES-RD USES-RT)
495 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_LOCK)
499 (dni unlk "unlock memory" (MACH10 USES-RT USES-RD)
501 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_UNLK)
505 (dni swrd "Single Word Read" (MACH10 USES-RT USES-RD)
507 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_SWRD)
511 (dni swrdl "Single Word Read and Lock" (MACH10 USES-RT USES-RD)
513 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_SWRDL)
517 (dni swwr "Single Word Write" (MACH10 USES-RS USES-RT USES-RD)
519 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_SWWR)
523 (dni swwru "Single Word Write and Unlock" (MACH10 USES-RS USES-RT USES-RD)
525 (+ OP_COP3 rs rt rd (f-shamt 0) FUNC10_SWWRU)
529 (dni dwrd "Double Word Read" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
531 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_DWRD)
535 (dni dwrdl "Double Word Read and Lock" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
537 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_DWRDL)
541 ; CAM access instructions (IQ10)
543 (dni cam36 "CAM Access in 36-bit Mode" (MACH10 USES-RT USES-RD)
544 "cam36 $rd,$rt,${cam-z},${cam-y}"
545 (+ OP_COP3 (f-rs 0) rt rd FUNC10_CAM36 cam-z cam-y)
549 (dni cam72 "CAM Access in 72-bit Mode" (MACH10 USES-RT USES-RD)
550 "cam72 $rd,$rt,${cam-y},${cam-z}"
551 (+ OP_COP3 (f-rs 0) rt rd FUNC10_CAM72 cam-z cam-y)
555 (dni cam144 "CAM Access in 144-bit Mode" (MACH10 USES-RT USES-RD)
556 "cam144 $rd,$rt,${cam-y},${cam-z}"
557 (+ OP_COP3 (f-rs 0) rt rd FUNC10_CAM144 cam-z cam-y)
561 (dni cam288 "CAM Access in 288-bit Mode" (MACH10 USES-RT USES-RD)
562 "cam288 $rd,$rt,${cam-y},${cam-z}"
563 (+ OP_COP3 (f-rs 0) rt rd FUNC10_CAM288 cam-z cam-y)
567 ; Counter manager instructions (IQ10)
569 (dni cm32and "Counter Manager And" (MACH10 USES-RS USES-RT USES-RD)
570 "cm32and $rd,$rs,$rt"
571 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32AND)
575 (dni cm32andn "Counter Manager And With Inverse" (MACH10 USES-RS USES-RT USES-RD)
576 "cm32andn $rd,$rs,$rt"
577 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32ANDN)
581 (dni cm32or "Counter Manager Or" (MACH10 USES-RS USES-RT USES-RD)
583 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32OR)
587 (dni cm32ra "Counter Manager 32-bit Rolling Add" (MACH10 USES-RS USES-RT USES-RD)
589 (+ OP_COP3 rs rt rd (f-shamt 2) FUNC10_CM32RA)
593 (dni cm32rd "Counter Manager 32-bit Rolling Decrement" (MACH10 USES-RT USES-RD)
595 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32RD)
599 (dni cm32ri "Counter Manager 32-bit Rolling Increment" (MACH10 USES-RT USES-RD)
601 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32RI)
605 (dni cm32rs "Counter Manager 32-bit Rolling Subtract" (MACH10 USES-RS USES-RT USES-RD)
607 (+ OP_COP3 rs rt rd (f-shamt 2) FUNC10_CM32RS)
611 (dni cm32sa "Counter Manager 32-bit Saturating Add" (MACH10 USES-RS USES-RT USES-RD)
613 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32SA)
617 (dni cm32sd "Counter Manager 32-bit Saturating Decrement" (MACH10 USES-RT USES-RD)
619 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32SD)
623 (dni cm32si "Counter Manager 32-bit Saturating Increment" (MACH10 USES-RT USES-RD)
625 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32SI)
629 (dni cm32ss "Counter Manager 32-bit Saturating Subtract" (MACH10 USES-RS USES-RT USES-RD)
631 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32SS)
635 (dni cm32xor "Counter Manager Xor" (MACH10 USES-RS USES-RT USES-RD)
636 "cm32xor $rd,$rs,$rt"
637 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM32XOR)
641 (dni cm64clr "Counter Manager Clear" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
643 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64CLR)
647 (dni cm64ra "Counter Manager 64-bit Rolling Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
649 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64RA)
653 (dni cm64rd "Counter Manager 64-bit Rolling Decrement" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
655 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64RD)
659 (dni cm64ri "Counter Manager 32-bit Rolling Increment" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
661 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64RI)
665 (dni cm64ria2 "Counter Manager 32/32 Rolling Increment/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
666 "cm64ria2 $rd,$rs,$rt"
667 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64RIA2)
671 (dni cm64rs "Counter Manager 64-bit Rolling Subtract" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
673 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64RS)
677 (dni cm64sa "Counter Manager 64-bit Saturating Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
679 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64SA)
683 (dni cm64sd "Counter Manager 64-bit Saturating Decrement" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
685 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64SD)
689 (dni cm64si "Counter Manager 64-bit Saturating Increment" (MACH10 EVEN-REG-NUM USES-RT USES-RD)
691 (+ OP_COP3 (f-rs 0) rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64SI)
695 (dni cm64sia2 "Counter Manager 32/32 Saturating Increment/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
696 "cm64sia2 $rd,$rs,$rt"
697 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64SIA2)
701 (dni cm64ss "Counter Manager 64-bit Saturating Subtract" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
703 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM64SS)
707 (dni cm128ria2 "Counter Manager 128-bit 64/64 Rolling Increment/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
708 "cm128ria2 $rd,$rs,$rt"
709 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128RIA2)
713 (dni cm128ria3 "Counter Manager 128-bit 32/32/64 Rolling Increment/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
714 "cm128ria3 $rd,$rs,$rt,${cm-3z}"
715 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128RIA3 cm-3z)
719 (dni cm128ria4 "Counter Manager 128-bit 32/32/32/32 Rolling Inc/Add" (MACH10 USES-RS USES-RT USES-RD)
720 "cm128ria4 $rd,$rs,$rt,${cm-4z}"
721 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128RIA4 cm-4z)
725 (dni cm128sia2 "Counter Manager 128-bit 64/64 Saturating Inc/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
726 "cm128sia2 $rd,$rs,$rt"
727 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128SIA2)
731 (dni cm128sia3 "Counter Manager 128-bit 32/32/64 Saturating Inc/Add" (MACH10 EVEN-REG-NUM USES-RS USES-RT USES-RD)
732 "cm128sia3 $rd,$rs,$rt,${cm-3z}"
733 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128SIA3 cm-3z)
737 (dni cm128sia4 "Counter Manager 128-bit 32/32/32/32 Saturating Inc/Add" (MACH10 USES-RS USES-RT USES-RD)
738 "cm128sia4 $rd,$rs,$rt,${cm-4z}"
739 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128SIA4 cm-4z)
743 (dni cm128vsa "Counter Manager Continuous State Dual Leaky Token Bucket Policing" (MACH10 USES-RS USES-RT USES-RD)
744 "cm128vsa $rd,$rs,$rt"
745 (+ OP_COP3 rs rt rd (f-cp-op 0) (f-cp-grp 2) FUNC10_CM128VSA)
749 ; Coprocessor Data Movement Instructions
751 ; Note that we don't set the USES-RD or USES-RT attributes for many of the following
752 ; instructions, as it's the COP register that's being specified.
754 ; ??? Is YIELD-INSN the right attribute for IQ10? The IQ2000 used the attribute to warn about
755 ; yielding instructions in a delay slot, but that's not relevant in IQ10. What *is* relevant
756 ; (and unique to IQ10) is instructions that yield if the destination register is accessed
757 ; before the value is there, causing a yield.
759 (dni cfc "copy from coprocessor control register" (MACH10 LOAD-DELAY USES-RD YIELD-INSN)
761 (+ OP_COP3 (f-rs 0) rt rd (f-shamt 0) FUNC10_CFC)
765 (dni ctc "copy to coprocessor control register" (MACH10 USES-RS)
767 (+ OP_COP3 rs rt (f-rd 0) (f-shamt 0) FUNC10_CTC)
773 (dnmi m-avail "Mark Header Buffer Available" (MACH10 NO-DIS)
775 (emit avail (f-rd 0))
778 (dnmi m-cam36 "CAM Access in 36-bit Mode" (MACH10 USES-RT USES-RD NO-DIS)
779 "cam36 $rd,$rt,${cam-z}"
780 (emit cam36 rd rt cam-z (f-cam-y 0))
783 (dnmi m-cam72 "CAM Access in 72-bit Mode" (MACH10 USES-RT USES-RD NO-DIS)
784 "cam72 $rd,$rt,${cam-z}"
785 (emit cam72 rd rt cam-z (f-cam-y 0))
788 (dnmi m-cam144 "CAM Access in 144-bit Mode" (MACH10 USES-RT USES-RD NO-DIS)
789 "cam144 $rd,$rt,${cam-z}"
790 (emit cam144 rd rt cam-z (f-cam-y 0))
793 (dnmi m-cam288 "CAM Access in 288-bit Mode" (MACH10 USES-RT USES-RD NO-DIS)
794 "cam288 $rd,$rt,${cam-z}"
795 (emit cam288 rd rt cam-z (f-cam-y 0))
798 (dnmi m-cm32read "Counter Manager 32-bit Rolling Add R0" (MACH10 USES-RT USES-RD NO-DIS)
800 (emit cm32ra rd (f-rs 0) rt)
803 (dnmi m-cm64read "Counter Manager 64-bit Rolling Add R0" (MACH10 USES-RT USES-RD NO-DIS)
805 (emit cm64ra rd (f-rs 0) rt)
808 (dnmi m-cm32mlog "Counter Manager 32-bit or R0" (MACH10 USES-RS USES-RT NO-DIS)
810 (emit cm32or (f-rd 0) rs rt)
813 (dnmi m-cm32and "Counter Manager And" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
815 (emit cm32and (f-rd 0) rs rt)
818 (dnmi m-cm32andn "Counter Manager And With Inverse" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
820 (emit cm32andn (f-rd 0) rs rt)
823 (dnmi m-cm32or "Counter Manager Or" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
825 (emit cm32or (f-rd 0) rs rt)
828 (dnmi m-cm32ra "Counter Manager 32-bit Rolling Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
830 (emit cm32ra (f-rd 0) rs rt)
833 (dnmi m-cm32rd "Counter Manager 32-bit Rolling Decrement" (MACH10 USES-RT USES-RD NO-DIS)
835 (emit cm32rd (f-rd 0) rt)
838 (dnmi m-cm32ri "Counter Manager 32-bit Rolling Increment" (MACH10 USES-RT USES-RD NO-DIS)
840 (emit cm32ri (f-rd 0) rt)
843 (dnmi m-cm32rs "Counter Manager 32-bit Rolling Subtract" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
845 (emit cm32rs (f-rd 0) rs rt)
848 (dnmi m-cm32sa "Counter Manager 32-bit Saturating Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
850 (emit cm32sa (f-rd 0) rs rt)
853 (dnmi m-cm32sd "Counter Manager 32-bit Saturating Decrement" (MACH10 USES-RT USES-RD NO-DIS)
855 (emit cm32sd (f-rd 0) rt)
858 (dnmi m-cm32si "Counter Manager 32-bit Saturating Increment" (MACH10 USES-RT USES-RD NO-DIS)
860 (emit cm32si (f-rd 0) rt)
863 (dnmi m-cm32ss "Counter Manager 32-bit Saturating Subtract" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
865 (emit cm32ss (f-rd 0) rs rt)
868 (dnmi m-cm32xor "Counter Manager Xor" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
870 (emit cm32xor (f-rd 0) rs rt)
873 (dnmi m-cm64clr "Counter Manager Clear" (MACH10 USES-RT USES-RD NO-DIS)
875 (emit cm64clr (f-rd 0) rt)
878 (dnmi m-cm64ra "Counter Manager 64-bit Rolling Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
880 (emit cm64ra (f-rd 0) rs rt)
883 (dnmi m-cm64rd "Counter Manager 64-bit Rolling Decrement" (MACH10 USES-RT USES-RD NO-DIS)
885 (emit cm64rd (f-rd 0) rt)
888 (dnmi m-cm64ri "Counter Manager 32-bit Rolling Increment" (MACH10 USES-RT USES-RD NO-DIS)
890 (emit cm64ri (f-rd 0) rt)
893 (dnmi m-cm64ria2 "Counter Manager 32/32 Rolling Increment/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
895 (emit cm64ria2 (f-rd 0) rs rt)
898 (dnmi m-cm64rs "Counter Manager 64-bit Rolling Subtract" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
900 (emit cm64rs (f-rd 0) rs rt)
903 (dnmi m-cm64sa "Counter Manager 64-bit Saturating Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
905 (emit cm64sa (f-rd 0) rs rt)
908 (dnmi m-cm64sd "Counter Manager 64-bit Saturating Decrement" (MACH10 USES-RT USES-RD NO-DIS)
910 (emit cm64sd (f-rd 0) rt)
913 (dnmi m-cm64si "Counter Manager 64-bit Saturating Increment" (MACH10 USES-RT USES-RD NO-DIS)
915 (emit cm64si (f-rd 0) rt)
918 (dnmi m-cm64sia2 "Counter Manager 32/32 Saturating Increment/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
920 (emit cm64sia2 (f-rd 0) rs rt)
923 (dnmi m-cm64ss "Counter Manager 64-bit Saturating Subtract" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
925 (emit cm64ss (f-rd 0) rs rt)
928 (dnmi m-cm128ria2 "Counter Manager 128-bit 64/64 Rolling Increment/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
930 (emit cm128ria2 (f-rd 0) rs rt)
933 (dnmi m-cm128ria3 "Counter Manager 128-bit 32/32/64 Rolling Increment/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
934 "cm128ria3 $rs,$rt,${cm-3z}"
935 (emit cm128ria3 (f-rd 0) rs rt cm-3z)
938 (dnmi m-cm128ria4 "Counter Manager 128-bit 32/32/32/32 Rolling Inc/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
939 "cm128ria4 $rs,$rt,${cm-4z}"
940 (emit cm128ria4 (f-rd 0) rs rt cm-4z)
943 (dnmi m-cm128sia2 "Counter Manager 128-bit 64/64 Saturating Inc/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
945 (emit cm128sia2 (f-rd 0) rs rt)
948 (dnmi m-cm128sia3 "Counter Manager 128-bit 32/32/64 Saturating Inc/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
949 "cm128sia3 $rs,$rt,${cm-3z}"
950 (emit cm128sia3 (f-rd 0) rs rt cm-3z)
953 (dnmi m-cm128sia4 "Counter Manager 128-bit 32/32/32/32 Saturating Inc/Add" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
954 "cm128sia4 $rs,$rt,${cm-4z}"
955 (emit cm128sia4 (f-rd 0) rs rt cm-4z)
958 (dnmi m-cmphdr "Get a Complete Header" (MACH10 NO-DIS)
960 (emit cmphdr (f-rd 0))
963 (dnmi m-dbd "Deallocate a Data Buffer Pointer" (MACH10 USES-RD USES-RT NO-DIS)
965 (emit dbd rd (f-rs 0) rt)
968 (dnmi m2-dbd "Deallocate a Data Buffer Pointer" (MACH10 USES-RT NO-DIS)
970 (emit dbd (f-rd 0) (f-rs 0) rt)
973 (dnmi m-dpwt "DSTN_PORT Write" (MACH10 USES-RS NO-DIS)
975 (emit dpwt (f-rd 0) rs)
978 (dnmi m-free "" (MACH10 USES-RS USES-RD NO-DIS)
980 (emit free (f-rd 0) rs)
983 ;(dnmi m-jal "jump and link, implied r31" (MACH10 USES-RT NO-DIS)
985 ; (emit jal (f-rt 31) jmptarg)
988 (dnmi m-lock "lock memory" (MACH10 USES-RT NO-DIS)
990 (emit lock (f-rd 0) rt)
993 (dnmi m-pkrla "Packet Release Absolute" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
995 (emit pkrla (f-rd 0) rs rt)
998 (dnmi m-pkrlac "Packet Release Absolute Continue" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1000 (emit pkrlac (f-rd 0) rs rt)
1003 (dnmi m-pkrlah "Packet Release Absolute and Hold" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1005 (emit pkrlah (f-rd 0) rs rt)
1008 (dnmi m-pkrlau "Packet Release Absolute Unconditional" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1010 (emit pkrlau (f-rd 0) rs rt)
1013 (dnmi m-pkrli "Packet Release Immediate" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1014 "pkrli $rs,$rt,$bytecount"
1015 (emit pkrli (f-rd 0) rs rt bytecount)
1018 (dnmi m-pkrlic "Packet Release Immediate Continue" (MACH10 USES-RS USES-RT NO-DIS)
1019 "pkrlic $rs,$rt,$bytecount"
1020 (emit pkrlic (f-rd 0) rs rt bytecount)
1023 (dnmi m-pkrlih "Packet Release Immediate and Hold" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1024 "pkrlih $rs,$rt,$bytecount"
1025 (emit pkrlih (f-rd 0) rs rt bytecount)
1028 (dnmi m-pkrliu "Packet Release Immediate Unconditional" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1029 "pkrliu $rs,$rt,$bytecount"
1030 (emit pkrliu (f-rd 0) rs rt bytecount)
1033 (dnmi m-rba "Read Bytes Absolute" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1035 (emit rba (f-rd 0) rs rt)
1038 (dnmi m-rbal "Read Bytes Absolute and Lock" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1040 (emit rbal (f-rd 0) rs rt)
1043 (dnmi m-rbar "Read Bytes Absolute and Release" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1045 (emit rbar (f-rd 0) rs rt)
1048 (dnmi m-rbi "Read Bytes Immediate" (MACH10 USES-RS USES-RT NO-DIS)
1049 "rbi $rs,$rt,$bytecount"
1050 (emit rbi (f-rd 0) rs rt bytecount)
1053 (dnmi m-rbil "Read Bytes Immediate and Lock" (MACH10 USES-RS USES-RT NO-DIS)
1054 "rbil $rs,$rt,$bytecount"
1055 (emit rbil (f-rd 0) rs rt bytecount)
1058 (dnmi m-rbir "Read Bytes Immediate and Release" (MACH10 USES-RS USES-RT NO-DIS)
1059 "rbir $rs,$rt,$bytecount"
1060 (emit rbir (f-rd 0) rs rt bytecount)
1063 (dnmi m-swwr "Single Word Write" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1065 (emit swwr (f-rd 0) rs rt)
1068 (dnmi m-swwru "Single Word Write and Unlock" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1070 (emit swwru (f-rd 0) rs rt)
1073 (dnmi m-tstod "Test Header Buffer Order Dependency" (MACH10 USES-RS USES-RD NO-DIS)
1075 (emit tstod (f-rd 0) rs)
1078 (dnmi m-unlk "" (MACH10 USES-RT USES-RD NO-DIS)
1080 (emit unlk (f-rd 0) rt)
1083 (dnmi m-wba "Write Bytes Absolute" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1085 (emit wba (f-rd 0) rs rt)
1088 (dnmi m-wbac "Write Bytes Absolute Cacheable" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1090 (emit wbac (f-rd 0) rs rt)
1093 (dnmi m-wbau "Write Bytes Absolute and Unlock" (MACH10 USES-RS USES-RT USES-RD NO-DIS)
1095 (emit wbau (f-rd 0) rs rt)
1098 (dnmi m-wbi "Write Bytes Immediate" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1099 "wbi $rs,$rt,$bytecount"
1100 (emit wbi (f-rd 0) rs rt bytecount)
1103 (dnmi m-wbic "Write Bytes Immediate Cacheable" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1104 "wbic $rs,$rt,$bytecount"
1105 (emit wbic (f-rd 0) rs rt bytecount)
1108 (dnmi m-wbiu "Write Bytes Immediate" (MACH10 USES-RD USES-RS USES-RT NO-DIS)
1109 "wbiu $rs,$rt,$bytecount"
1110 (emit wbiu (f-rd 0) rs rt bytecount)