1 ; Infineon XC16X CPU description. -*- Scheme -*-
3 ; Copyright 2006, 2007, 2009 Free Software Foundation, Inc.
5 ; Contributed by KPIT Cummins Infosystems Ltd.; developed under contract
6 ; from Infineon Systems, GMBH , Germany.
8 ; This file is part of the GNU Binutils.
10 ; This program is free software; you can redistribute it and/or modify
11 ; it under the terms of the GNU General Public License as published by
12 ; the Free Software Foundation; either version 3 of the License, or
13 ; (at your option) any later version.
15 ; This program is distributed in the hope that it will be useful,
16 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ; GNU General Public License for more details.
20 ; You should have received a copy of the GNU General Public License
21 ; along with this program; if not, write to the Free Software
22 ; Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
25 (define-rtl-version 0 8)
27 (include "simplify.inc")
29 ; define-arch appears first
32 (name xc16x) ; name of cpu family
33 (comment "Infineon XC16X")
34 (default-alignment aligned)
41 ; An attribute to describe which pipeline an insn runs in generally OS.
46 (comment "parallel execution pipeline selection")
50 ; Instruction set parameters.
54 (default-insn-bitsize 32)
55 (base-insn-bitsize 32)
56 (default-insn-word-bitsize 16)
57 (decode-assist (15 14 13 12))
58 ; The XC16X fetches 1 insn at a time.
63 ; Cpu family definitions.
66 ; cpu names must be distinct from the architecture name and machine names.
67 ; The "b" suffix stands for "base" and is the convention.
68 ; The "f" suffix stands for "family" and is the convention.
70 (comment "Infineon XC16X base family")
72 (insn-chunk-bitsize 32)
79 (comment "Infineon XC16X cpu")
86 (name xc16x) (comment "XC16X") (attrs)
89 (pipeline p-mem "" () ((prefetch) (fetch) (decode) (address) (memory) (execute) (writeback)))
91 ; `state' is a list of variables for recording model state
93 ; bit mask of h-gr registers, =1 means value being loaded from memory
97 (unit u-exec "Execution Unit" ()
100 ((dr INT -1) (sr INT -1)) ; inputs
101 ((dr INT -1)) ; outputs
102 () ; profile action (default)
104 (unit u-cmp "Compare Unit" ()
107 ((src1 INT -1) (src2 INT -1)) ; inputs
109 () ; profile action (default)
111 (unit u-cti "Jump & Call Unit" ()
114 ((condbit) (sr INT -1)) ; inputs
116 () ; profile action (default)
118 (unit u-mov "Data Movement Unit" ()
121 ((dr INT -1) (sr INT -1)) ; inputs
122 ((dr INT -1)) ; output
123 () ; profile action (default)
127 ; Instruction fields.
130 ; PCREL-ADDR: pc relative value (for reloc and disassembly purposes)
131 ; ABS-ADDR: absolute address (for reloc and disassembly purposes)
132 ; RELOC: there is a relocation associated with this field (experiment)
138 (comment "there is a reloc associated with this field (experiment)")
141 (dnf f-op1 "op1" () 7 4)
142 (dnf f-op2 "op2" () 3 4)
143 (dnf f-condcode "condcode" () 7 4) ;condition code required in other jmps and calls
144 (dnf f-icondcode "indrct condcode" () 15 4) ;condition code required in other jmpi and calli
145 (dnf f-rcond "relative-cond" () 7 4) ;condition code required in JMPR
146 (dnf f-qcond "qbit" () 7 4) ;used in enum of bset/bclear macro
147 (dnf f-extccode "extended condcode" () 15 5) ;condition code required in other jmpa and calla
148 (dnf f-r0 "r0" () 9 2) ;required where 2 bit register used(only R0-R3)
149 (dnf f-r1 "r1" () 15 4)
150 (dnf f-r2 "r2" () 11 4)
151 (dnf f-r3 "r3" () 12 4)
152 (dnf f-r4 "r4" () 11 4)
153 (dnf f-uimm2 "uimm2" () 13 2) ;used for immediate data,eg in ADD,MOV insns
154 (dnf f-uimm3 "uimm3" () 10 3) ;used for immediate data,eg in ADD,SUB insns
155 (dnf f-uimm4 "uimm4" () 15 4) ;used for immediate data,eg in MOV insns
156 (dnf f-uimm7 "uimm7" (PCREL-ADDR RELOC) 15 7) ;used in TRAP
157 (dnf f-uimm8 "uimm8" () 23 8) ;used in immediate byte data,eg in ADDB,MOVB insns
158 (dnf f-uimm16 "uimm16" () 31 16) ;used for immediate word data
159 (dnf f-memory "memory" () 31 16) ; used for memory operands
160 (dnf f-memgr8 "memory" () 31 16) ; memory location of gr
161 (dnf f-rel8 "rel8" (PCREL-ADDR RELOC) 15 8) ;used in JMPR,CALLR
162 (dnf f-relhi8 "relhi8" (PCREL-ADDR RELOC) 23 8) ;used in JB,JBC,JNB,JNBS
163 (dnf f-reg8 "reg8" () 15 8) ;required where 8bit gp register used
164 (dnf f-regmem8 "regmem8" () 15 8) ;required where 8bit register used
165 (dnf f-regoff8 "regoff8" () 15 8) ;required for offset calc
166 (dnf f-reghi8 "reghi8" () 23 8) ;required where 8bit register number used
167 (dnf f-regb8 "regb8" () 15 8) ;required for byte registers RL0,RH0, till RL8,RH8
168 (dnf f-seg8 "seg8" () 15 8) ;used as segment number in JMPS,CALLS
169 (dnf f-segnum8 "segnum8" () 23 8) ;used in EXTS,EXTSR
170 (dnf f-mask8 "mask8" () 23 8) ;used as mask in BFLDH,BFLDL insns
171 (dnf f-pagenum "page num" () 25 10);used in EXTP,EXTPR
172 (dnf f-datahi8 "datahi8" () 31 8) ;used for filling with const data
173 (dnf f-data8 "data8" () 23 8) ;used for filling with const data
174 (dnf f-offset16 "address offset16" (ABS-ADDR RELOC) 31 16) ;used in JMPS,JMPA,CALLA,CALLS
175 (dnf f-op-bit1 "gap of 1 bit" () 11 1) ;used for filling with const data
176 (dnf f-op-bit2 "gap of 2 bits" () 11 2) ;used for filling with const data
177 (dnf f-op-bit4 "gap of 4 bits" () 11 4) ;used for filling with const data
178 (dnf f-op-bit3 "gap of 3 bits" () 10 3) ;used in CALLA, JMPA
179 (dnf f-op-2bit "gap of 2 bits" () 10 2) ;used in CALLA
180 (dnf f-op-bitone "gap of 1 bit " () 10 1) ;used in JMPA
181 (dnf f-op-onebit "gap of 1 bit " () 9 1) ;used in JMPA
182 (dnf f-op-1bit "gap of 1 bit " () 8 1) ;used in JMPA, CALLA
183 (dnf f-op-lbit4 "gap of 4 bits" () 15 4) ;used for filling with const data
184 (dnf f-op-lbit2 "gap of 2 bits" () 15 2) ;used for filling with const data
185 (dnf f-op-bit8 "gap of 8 bits" () 31 8) ;used for filling with const data
186 (dnf f-op-bit16 "gap of 16 bits" () 31 16) ;used for filling with const data
187 (dnf f-qbit "qbit" () 7 4) ;used in bit field of bset/bclear
188 (dnf f-qlobit "qlobit" () 31 4) ;used for filling with const data
189 (dnf f-qhibit "qhibit" () 27 4) ;used for filling with const data
190 (dnf f-qlobit2 "qlobit2" () 27 2) ;used for filling with const data
191 (dnf f-pof "upof16" () 31 16) ; used for memory operands
195 (define-normal-insn-enum insn-op1 "insn format enums" () OP1_ f-op1
196 ("0" "1" "2" "3" "4" "5" "6" "7"
197 "8" "9" "10" "11" "12" "13" "14" "15")
201 (define-normal-insn-enum insn-op2 "op2 enums" () OP2_ f-op2
202 ("0" "1" "2" "3" "4" "5" "6" "7"
203 "8" "9" "10" "11" "12" "13" "14" "15")
207 ; insn-rcond: bits 0-3
208 (define-normal-insn-enum insn-qcond "bit set/clear enums" () QBIT_ f-qcond
209 (("0" 0) ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7) ("8" 8) ("9" 9) ("10" 10)
210 ("11" 11) ("12" 12) ("13" 13) ("14" 14) ("15" 15))
213 ; insn-rcond: bits 0-3
214 (define-normal-insn-enum insn-rcond "relative jump condition code op2 enums" () COND_ f-rcond
215 (("UC" 0) ("NET" 1) ("Z" 2) ("NE_NZ" 3) ("V" 4) ("NV" 5) ("N" 6) ("NN" 7)
216 ("C" 8) ("NC" 9) ("SGT" 10) ("SLE" 11) ("SLT" 12) ("SGE" 13) ("UGT" 14) ("ULE" 15)
217 ("EQ" 2) ("NE" 3) ("ULT" 8) ("UGE" 9))
223 ; These entries list the elements of the raw hardware.
224 ; They're also used to provide tables and other elements of the assembly
227 (dnh h-pc "program counter" (PC) (pc) () () ())
232 (values (r0 0) (r1 1) (r2 2) (r3 3) (r4 4) (r5 5) (r6 6) (r7 7)
233 (r8 8) (r9 9) (r10 10) (r11 11) (r12 12) (r13 13) (r14 14) (r15 15))
238 (comment "general registers")
239 (attrs PROFILE CACHE-ADDR)
240 (type register HI (16))
241 (indices extern-keyword gr-names)
244 ;; HACK: Various semantics refer to h-cr.
245 ;; This is here to keep things working.
248 (comment "cr registers")
249 (attrs PROFILE CACHE-ADDR)
250 (type register HI (16))
251 (indices extern-keyword gr-names)
257 (values (0x1 0) (0x2 1) (0x3 2) (0x4 3)
258 ("1" 0) ("2" 1) ("3" 2) ("4" 3))
264 (comment "ext values")
265 (attrs PROFILE CACHE-ADDR)
266 (type register HI (8))
267 (indices extern-keyword ext-names)
273 (values ("IEN" 136) ("r0.11" 240) ("r1.11" 241) ("r2.11" 242) ("r3.11" 243) ("r4.11" 244)
274 ("r5.11" 245) ("r6.11" 246) ("r7.11" 247) ("r8.11" 248)
275 ("r9.11" 249) ("r10.11" 250) ("r11.11" 251) ("r12.11" 252)
276 ("r13.11" 253) ("r14.11" 254) ("r15.11" 255))
281 (comment "ext values")
282 (attrs PROFILE CACHE-ADDR)
283 (type register HI (1))
284 (indices extern-keyword psw-names)
290 (values (rl0 0) (rh0 1) (rl1 2) (rh1 3) (rl2 4) (rh2 5) (rl3 6) (rh3 7)
291 (rl4 8) (rh4 9) (rl5 10) (rh5 11) (rl6 12) (rh6 13) (rl7 14) (rh7 15))
296 (comment "general registers")
297 (attrs PROFILE CACHE-ADDR)
298 (type register QI (16))
299 (indices extern-keyword grb-names)
303 (name conditioncode-names)
305 (values (cc_UC 0) (cc_NET 1) (cc_Z 2) (cc_EQ 2) (cc_NZ 3) (cc_NE 3) (cc_V 4) (cc_NV 5) (cc_N 6) (cc_NN 7) (cc_ULT 8) (cc_UGE 9)
306 (cc_C 8) (cc_NC 9) (cc_SGT 10) (cc_SLE 11) (cc_SLT 12) (cc_SGE 13) (cc_UGT 14)
311 (comment "condition codes")
312 (attrs PROFILE CACHE-ADDR)
313 (type register QI (16))
314 (indices extern-keyword conditioncode-names)
318 (name extconditioncode-names)
320 (values(cc_UC 0) (cc_NET 2) (cc_Z 4) (cc_EQ 4) (cc_NZ 6) (cc_NE 6) (cc_V 8) (cc_NV 10) (cc_N 12) (cc_NN 14) (cc_ULT 16) (cc_UGE 18) (cc_C 16) (cc_NC 18) (cc_SGT 20)
321 (cc_SLE 22) (cc_SLT 24) (cc_SGE 26) (cc_UGT 28) (cc_ULE 30) (cc_nusr0 1)
322 (cc_nusr1 3) (cc_usr0 5) (cc_usr1 7))
326 (comment "extended condition codes")
327 (attrs PROFILE CACHE-ADDR)
328 (type register QI (4))
329 (indices extern-keyword extconditioncode-names)
334 (enum-prefix H-GRB8-)
335 (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3)
336 (psw 136) (cp 8) (mdl 7) (mdh 6)
337 (mdc 135) (sp 9) (csp 4) (vecseg 137)
338 (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13)
339 (zeros 142) (ones 143) (spseg 134) (tfr 214)
340 (rl0 240) (rh0 241) (rl1 242) (rh1 243) (rl2 244) (rh2 245) (rl3 246) (rh3 247)
341 (rl4 248) (rh4 249) (rl5 250) (rh5 251) (rl6 252) (rh6 253) (rl7 254) (rh7 255))
346 (comment "general byte registers")
347 (attrs PROFILE CACHE-ADDR)
348 (type register QI (36))
349 (indices extern-keyword grb8-names)
355 (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3)
356 (psw 136) (cp 8) (mdl 7) (mdh 6)
357 (mdc 135) (sp 9) (csp 4) (vecseg 137)
358 (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13)
359 (zeros 142) (ones 143) (spseg 134) (tfr 214)
360 (r0 240) (r1 241) (r2 242) (r3 243) (r4 244) (r5 245) (r6 246) (r7 247)
361 (r8 248) (r9 249) (r10 250) (r11 251) (r12 252) (r13 253) (r14 254) (r15 255))
366 (comment "registers")
367 (attrs PROFILE CACHE-ADDR)
368 (type register HI (36))
369 (indices extern-keyword r8-names)
374 (enum-prefix H-REGMEM8-)
375 (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3)
376 (psw 136) (cp 8) (mdl 7) (mdh 6)
377 (mdc 135) (sp 9) (csp 4) (vecseg 137)
378 (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13)
379 (zeros 142) (ones 143) (spseg 134) (tfr 214)
380 (r0 240) (r1 241) (r2 242) (r3 243) (r4 244) (r5 245) (r6 246) (r7 247)
381 (r8 248) (r9 249) (r10 250) (r11 251) (r12 252) (r13 253) (r14 254) (r15 255))
386 (comment "registers")
388 (type register HI (16))
389 (indices extern-keyword regmem8-names)
394 (enum-prefix H-REGDIV8-)
395 (values (r0 0) (r1 17) (r2 34) (r3 51) (r4 68) (r5 85) (r6 102) (r7 119)
396 (r8 136) (r9 153) (r10 170) (r11 187) (r12 204) (r13 221) (r14 238) (r15 255))
401 (comment "division insn registers")
402 (attrs PROFILE CACHE-ADDR)
403 (type register HI (16))
404 (indices extern-keyword regdiv8-names)
409 (enum-prefix H-REG0-)
410 (values (0x1 1) (0x2 2) (0x3 3) (0x4 4) (0x5 5) (0x6 6) (0x7 7) (0x8 8) (0x9 9) (0xa 10) (0xb 11)
411 (0xc 12) (0xd 13) (0xe 14) (0xf 15)
412 ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7) ("8" 8) ("9" 9) ("10" 10) ("11" 11)
413 ("12" 12) ("13" 13) ("14" 14) ("15" 15))
418 (comment "for 4-bit data excuding 0")
419 (attrs PROFILE CACHE-ADDR)
420 (type register HI (30))
421 (indices extern-keyword reg0-name)
426 (enum-prefix H-REG01-)
427 (values (0x1 1) (0x2 2) (0x3 3) (0x4 4) (0x5 5) (0x6 6) (0x7 7)
428 ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7))
433 (comment "for 4-bit data excuding 0")
434 (attrs PROFILE CACHE-ADDR)
435 (type register HI (14))
436 (indices extern-keyword reg0-name1)
440 (name regbmem8-names)
441 (enum-prefix H-REGBMEM8-)
442 (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3)
443 (psw 136) (cp 8) (mdl 7) (mdh 6)
444 (mdc 135) (sp 9) (csp 4) (vecseg 137)
445 (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13)
446 (zeros 142) (ones 143) (spseg 134) (tfr 214)
447 (rl0 240) (rh0 241) (rl1 242) (rh1 243) (rl2 244) (rh2 245) (rl3 246) (rh3 247)
448 (rl4 248) (rh4 249) (rl5 250) (rh5 251) (rl6 252) (rh6 253) (rl7 254) (rh7 255))
453 (comment "registers")
454 (attrs PROFILE CACHE-ADDR)
455 (type register HI (36))
456 (indices extern-keyword regbmem8-names)
461 (enum-prefix H-MEMGR8-)
462 (values (dpp0 65024) (dpp1 65026) (dpp2 65028) (dpp3 65030)
463 (psw 65296) (cp 65040) (mdl 65038) (mdh 65036)
464 (mdc 65294) (sp 65042) (csp 65032) (vecseg 65298)
465 (stkov 65044) (stkun 65046) (cpucon1 65048) (cpucon2 65050)
466 (zeros 65308) (ones 65310) (spseg 65292) (tfr 65452) )
471 (comment "memory location of registers")
473 (type register HI (20))
474 (indices extern-keyword memgr8-names)
477 (dsh h-cond "condition bit" () (register BI)) ;any bit from PSW while comparison
478 ; This bit is part of the PSW register
479 (dsh h-cbit "carry bit" () (register BI))
481 (dsh h-sgtdis "segmentation enable bit" () (register BI)) ;0 means segmentation enabled
483 ;Instruction operands
484 ; -- layer between the assembler and the raw hardware description
485 ; -- the main means of manipulating instruction fields in the semantic code
487 ; XC16X specific operand attributes:
493 (comment "immediates have an optional '#' prefix")
500 (comment "bit addr have an optional '.' prefix")
507 (comment "page offset ")
521 (comment "segment offset selection")
531 (dnop sr "source register" () h-gr f-r2)
532 (dnop dr "destination register" () h-gr f-r1)
533 (dnop dri "destination register" () h-gr f-r4)
534 (dnop srb "source register" () h-grb f-r2)
535 (dnop drb "destination register" () h-grb f-r1)
536 (dnop sr2 "2 bit source register" () h-gr f-r0)
537 (dnop src1 "source register 1" () h-gr f-r1)
538 (dnop src2 "source register 2" () h-gr f-r2)
539 (dnop srdiv "source register 2" () h-regdiv8 f-reg8)
540 (dnop RegNam "PSW bits" () h-psw f-reg8)
541 (dnop uimm2 "2 bit unsigned number" (HASH-PREFIX) h-ext f-uimm2)
542 (dnop uimm3 "3 bit unsigned number" (HASH-PREFIX) h-r01 f-uimm3)
543 (dnop uimm4 "4 bit unsigned number" (HASH-PREFIX) h-uint f-uimm4)
544 (dnop uimm7 "7 bit trap number" (HASH-PREFIX) h-uint f-uimm7)
545 (dnop uimm8 "8 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm8)
546 (dnop uimm16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm16)
547 (dnop upof16 "16 bit unsigned immediate" (POF-PREFIX) h-addr f-memory)
548 (dnop reg8 "8 bit word register number" () h-r8 f-reg8)
549 (dnop regmem8 "8 bit word register number" () h-regmem8 f-regmem8)
550 (dnop regbmem8 "8 bit byte register number" () h-regbmem8 f-regmem8)
551 (dnop regoff8 "8 bit word register number" () h-r8 f-regoff8)
552 (dnop reghi8 "8 bit word register number" () h-r8 f-reghi8)
553 (dnop regb8 "8 bit byte register number" () h-grb8 f-regb8)
554 (dnop genreg "8 bit word register number" () h-r8 f-regb8)
555 (dnop seg "8 bit segment number" () h-uint f-seg8)
556 (dnop seghi8 "8 bit hi segment number" () h-uint f-segnum8)
557 (dnop caddr "16 bit address offset" () h-addr f-offset16)
558 (dnop rel "8 bit signed relative offset" () h-sint f-rel8)
559 (dnop relhi "hi 8 bit signed relative offset" () h-sint f-relhi8)
560 (dnop condbit "condition bit" (SEM-ONLY) h-cond f-nil)
561 (dnop bit1 "gap of 1 bit" () h-uint f-op-bit1)
562 (dnop bit2 "gap of 2 bits" () h-uint f-op-bit2)
563 (dnop bit4 "gap of 4 bits" () h-uint f-op-bit4)
564 (dnop lbit4 "gap of 4 bits" () h-uint f-op-lbit4)
565 (dnop lbit2 "gap of 2 bits" () h-uint f-op-lbit2)
566 (dnop bit8 "gap of 8 bits" () h-uint f-op-bit8)
567 (dnop u4 "gap of 4 bits" () h-r0 f-uimm4)
568 (dnop bitone "field of 1 bit" () h-uint f-op-onebit)
569 (dnop bit01 "field of 1 bit" () h-uint f-op-1bit)
570 (dnop cond "condition code" () h-cc f-condcode)
571 (dnop icond "indirect condition code" () h-cc f-icondcode)
572 (dnop extcond "extended condition code" () h-ecc f-extccode)
573 (dnop memory "16 bit memory" () h-addr f-memory)
574 (dnop memgr8 "16 bit memory" () h-memgr8 f-memgr8)
575 (dnop cbit "carry bit" (SEM-ONLY) h-cbit f-nil)
576 (dnop qbit "bit addr" (DOT-PREFIX) h-uint f-qbit)
577 (dnop qlobit "bit addr" (DOT-PREFIX) h-uint f-qlobit)
578 (dnop qhibit "bit addr" (DOT-PREFIX) h-uint f-qhibit)
579 (dnop mask8 "8 bit mask" (HASH-PREFIX) h-uint f-mask8)
580 (dnop masklo8 "8 bit mask" (HASH-PREFIX) h-uint f-datahi8)
581 (dnop pagenum "10 bit page number" (HASH-PREFIX) h-uint f-pagenum)
582 (dnop data8 "8 bit data" (HASH-PREFIX) h-uint f-data8)
583 (dnop datahi8 "8 bit data" (HASH-PREFIX) h-uint f-datahi8)
584 (dnop sgtdisbit "segmentation enable bit" (SEM-ONLY) h-sgtdis f-nil)
585 (dnop upag16 "16 bit unsigned immediate" (PAG-PREFIX) h-uint f-uimm16)
586 (dnop useg8 "8 bit segment " (SEG-PREFIX) h-uint f-seg8)
587 (dnop useg16 "16 bit address offset" (SEG-PREFIX) h-uint f-offset16)
588 (dnop usof16 "16 bit address offset" (SOF-PREFIX) h-uint f-offset16)
590 ; define hash operator
591 (define-operand (name hash) (comment "# prefix") (attrs)
594 (handlers (parse "hash") (print "hash"))
597 ; define dot operator
598 (define-operand (name dot) (comment ". prefix") (attrs)
601 (handlers (parse "dot") (print "dot"))
604 ; define pof operator
605 (define-operand (name pof) (comment "pof: prefix") (attrs)
608 (handlers (parse "pof") (print "pof"))
611 ; define pag operator
612 (define-operand (name pag) (comment "pag: prefix") (attrs)
615 (handlers (parse "pag") (print "pag"))
618 ; define sof operator
619 (define-operand (name sof) (comment "sof: prefix") (attrs)
622 (handlers (parse "sof") (print "sof"))
625 ; define seg operator
626 (define-operand (name segm) (comment "seg: prefix") (attrs)
629 (handlers (parse "seg") (print "seg"))
632 ; IDOC attribute for instruction documentation.
637 (comment "insn kind for documentation")
640 (MOVE - () "Data Movement")
641 (ALU - () "Arithmatic & logical")
643 (JMP - () "Jump & Call")
644 (MISC - () "Miscellaneous")
645 (SYSC - () "System control")
649 ; Include the instruction set descriptions from their respective
653 ;******************************************************************
655 ;add/sub register and immediate
656 (define-pmacro (arithmetic16 name insn insn1 opc1 opc2 op1 op2 mode dir)
658 (.str name "arithmetic" )
659 ((PIPE OS) (IDOC ALU))
660 (.str insn " $"op1 ",$"dir"$"op2)
661 (+ opc1 opc2 op1 op2)
662 (set mode op1 (insn1 mode op1 (mem HI op2)))
666 (arithmetic16 addrpof add add OP1_0 OP2_2 reg8 upof16 HI "pof")
667 (arithmetic16 subrpof sub sub OP1_2 OP2_2 reg8 upof16 HI "pof")
668 (arithmetic16 addbrpof addb add OP1_0 OP2_3 regb8 upof16 QI "pof")
669 (arithmetic16 subbrpof subb sub OP1_2 OP2_3 regb8 upof16 QI "pof")
670 (arithmetic16 addrpag add add OP1_0 OP2_2 reg8 upag16 HI "pag")
671 (arithmetic16 subrpag sub sub OP1_2 OP2_2 reg8 upag16 HI "pag")
672 (arithmetic16 addbrpag addb add OP1_0 OP2_3 regb8 upag16 QI "pag")
673 (arithmetic16 subbrpag subb sub OP1_2 OP2_3 regb8 upag16 QI "pag")
675 ;add/sub register and immediate
676 (define-pmacro (arithmetic17 name insn insn1 opc1 opc2 op1 op2 mode dir)
678 (.str name "arithmetic" )
679 ((PIPE OS) (IDOC ALU))
680 (.str insn " $"op1 ",$"dir"$"op2)
681 (+ opc1 opc2 op1 op2)
682 (set mode op1 (insn1 mode op1 (mem HI op2) cbit))
686 (arithmetic17 addcrpof addc addc OP1_1 OP2_2 reg8 upof16 HI "pof")
687 (arithmetic17 subcrpof subc subc OP1_3 OP2_2 reg8 upof16 HI "pof")
688 (arithmetic17 addcbrpof addcb addc OP1_1 OP2_3 regb8 upof16 QI "pof")
689 (arithmetic17 subcbrpof subcb subc OP1_3 OP2_3 regb8 upof16 QI "pof")
690 (arithmetic17 addcrpag addc addc OP1_1 OP2_2 reg8 upag16 HI "pag")
691 (arithmetic17 subcrpag subc subc OP1_3 OP2_2 reg8 upag16 HI "pag")
692 (arithmetic17 addcbrpag addcb addc OP1_1 OP2_3 regb8 upag16 QI "pag")
693 (arithmetic17 subcbrpag subcb subc OP1_3 OP2_3 regb8 upag16 QI "pag")
695 ;add/sub register and immediate
696 (define-pmacro (arithmetic18 name insn insn1 opc1 opc2 op1 op2 mode dir)
698 (.str name "arithmetic" )
699 ((PIPE OS) (IDOC ALU))
700 (.str insn " $"dir"$"op1 ",$"op2)
701 (+ opc1 opc2 op2 op1)
702 (set (mem HI op1) (insn1 (mem HI op1) op2 ))
706 (arithmetic18 addrpofr add add OP1_0 OP2_4 upof16 reg8 HI "pof")
707 (arithmetic18 subrpofr sub sub OP1_2 OP2_4 upof16 reg8 HI "pof")
708 (arithmetic18 addbrpofr addb add OP1_0 OP2_5 upof16 regb8 QI "pof")
709 (arithmetic18 subbrpofr subb sub OP1_2 OP2_5 upof16 regb8 QI "pof")
711 ;add/sub register and immediate
712 (define-pmacro (arithmetic19 name insn insn1 opc1 opc2 op1 op2 mode dir)
714 (.str name "arithmetic" )
715 ((PIPE OS) (IDOC ALU))
716 (.str insn " $"dir"$"op1 ",$"op2)
717 (+ opc1 opc2 op2 op1)
718 (set (mem HI op1) (insn1 mode (mem HI op1) op2 cbit))
722 (arithmetic19 addcrpofr addc addc OP1_1 OP2_4 upof16 reg8 HI "pof")
723 (arithmetic19 subcrpofr subc subc OP1_3 OP2_4 upof16 reg8 HI "pof")
724 (arithmetic19 addcbrpofr addcb addc OP1_1 OP2_5 upof16 regb8 QI "pof")
725 (arithmetic19 subcbrpofr subcb subc OP1_3 OP2_5 upof16 regb8 QI "pof")
727 ;add/sub register and immediate
728 (define-pmacro (arithmetic20 name insn insn1 opc1 opc2 op1 op2 mode dir)
730 (.str name "arithmetic" )
731 ((PIPE OS) (IDOC ALU))
732 (.str insn " $"op1 ",$hash$"dir"$"op2)
733 (+ opc1 opc2 op1 op2)
734 (set mode op1 (insn1 mode op1 op2))
738 (arithmetic20 addrhpof add add OP1_0 OP2_6 reg8 uimm16 HI "pof")
739 (arithmetic20 subrhpof sub sub OP1_2 OP2_6 reg8 uimm16 HI "pof")
740 (arithmetic20 addbrhpof add add OP1_0 OP2_6 reg8 uimm16 HI "pag")
741 (arithmetic20 subbrhpof sub sub OP1_2 OP2_6 reg8 uimm16 HI "pag")
743 ;add/sub register and immediate
744 (define-pmacro (arithmetic21 name insn insn1 opc1 opc2 op1 op2 mode dir)
746 (.str name "arithmetic" )
747 ((PIPE OS) (IDOC ALU))
748 (.str insn " $"op1 ",$hash$"dir"$"op2)
749 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
750 (set mode op1 (insn1 mode op1 op2))
754 (arithmetic21 addrhpof3 add add OP1_0 OP2_8 dr uimm3 HI "pof")
755 (arithmetic21 subrhpof3 sub sub OP1_2 OP2_8 dr uimm3 HI "pof")
756 (arithmetic21 addbrhpag3 addb add OP1_0 OP2_9 drb uimm3 QI "pag")
757 (arithmetic21 subbrhpag3 subb sub OP1_2 OP2_9 drb uimm3 QI "pag")
758 (arithmetic21 addrhpag3 add add OP1_0 OP2_8 dr uimm3 HI "pag")
759 (arithmetic21 subrhpag3 sub sub OP1_2 OP2_8 dr uimm3 HI "pag")
760 (arithmetic21 addbrhpof3 addb add OP1_0 OP2_9 drb uimm3 QI "pof")
761 (arithmetic21 subbrhpof3 subb sub OP1_2 OP2_9 drb uimm3 QI "pof")
763 ;add/sub register and immediate
764 (define-pmacro (arithmetic22 name insn insn1 opc1 opc2 op1 op2 mode dir)
766 (.str name "arithmetic" )
767 ((PIPE OS) (IDOC ALU))
768 (.str insn " $"op1 ",$hash$"dir"$"op2)
769 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
770 (set mode op1 (insn1 mode op1 op2))
774 (arithmetic22 addrbhpof addb add OP1_0 OP2_7 regb8 uimm8 QI "pof")
775 (arithmetic22 subrbhpof subb sub OP1_2 OP2_7 regb8 uimm8 QI "pof")
776 (arithmetic22 addbrhpag addb add OP1_0 OP2_7 regb8 uimm8 QI "pag")
777 (arithmetic22 subbrhpag subb sub OP1_2 OP2_7 regb8 uimm8 QI "pag")
779 ;add/sub register and immediate
780 (define-pmacro (arithmetic23 name insn insn1 opc1 opc2 op1 op2 mode dir)
782 (.str name "arithmetic" )
783 ((PIPE OS) (IDOC ALU))
784 (.str insn " $"op1 ",$hash$"dir"$"op2)
785 (+ opc1 opc2 op1 op2)
786 (set mode op1 (insn1 mode op1 op2 cbit))
790 (arithmetic23 addcrhpof addc addc OP1_1 OP2_6 reg8 uimm16 HI "pof")
791 (arithmetic23 subcrhpof subc subc OP1_3 OP2_6 reg8 uimm16 HI "pof")
792 (arithmetic23 addcbrhpof addc addc OP1_1 OP2_6 reg8 uimm16 HI "pag")
793 (arithmetic23 subcbrhpof subc subc OP1_3 OP2_6 reg8 uimm16 HI "pag")
795 ;add/sub register and immediate
796 (define-pmacro (arithmetic24 name insn insn1 opc1 opc2 op1 op2 mode dir)
798 (.str name "arithmetic" )
799 ((PIPE OS) (IDOC ALU))
800 (.str insn " $"op1 ",$hash$"dir"$"op2)
801 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
802 (set mode op1 (insn1 mode op1 op2 cbit))
806 (arithmetic24 addcrhpof3 addc addc OP1_1 OP2_8 dr uimm3 HI "pof")
807 (arithmetic24 subcrhpof3 subc subc OP1_3 OP2_8 dr uimm3 HI "pof")
808 (arithmetic24 addcbrhpag3 addcb addc OP1_1 OP2_9 drb uimm3 QI "pag")
809 (arithmetic24 subcbrhpag3 subcb subc OP1_3 OP2_9 drb uimm3 QI "pag")
810 (arithmetic24 addcrhpag3 addc addc OP1_1 OP2_8 dr uimm3 HI "pag")
811 (arithmetic24 subcrhpag3 subc subc OP1_3 OP2_8 dr uimm3 HI "pag")
812 (arithmetic24 addcbrhpof3 addcb addc OP1_1 OP2_9 drb uimm3 QI "pof")
813 (arithmetic24 subcbrhpof3 subcb subc OP1_3 OP2_9 drb uimm3 QI "pof")
815 ;add/sub register and immediate
816 (define-pmacro (arithmetic25 name insn insn1 opc1 opc2 op1 op2 mode dir)
818 (.str name "arithmetic" )
819 ((PIPE OS) (IDOC ALU))
820 (.str insn " $"op1 ",$hash$"dir"$"op2)
821 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
822 (set mode op1 (insn1 mode op1 op2 cbit))
826 (arithmetic25 addcrbhpof addcb addc OP1_1 OP2_7 regb8 uimm8 QI "pof")
827 (arithmetic25 subcrbhpof subcb subc OP1_3 OP2_7 regb8 uimm8 QI "pof")
828 (arithmetic25 addcbrhpag addcb addc OP1_1 OP2_7 regb8 uimm8 QI "pag")
829 (arithmetic25 subcbrhpag subcb subc OP1_3 OP2_7 regb8 uimm8 QI "pag")
831 ;add/sub register and immediate
832 (define-pmacro (arithmetic10 name insn insn1 opc1 opc2 op1 op2 mode)
834 (.str name "arithmetic" )
835 ((PIPE OS) (IDOC ALU))
836 (.str insn " $"op1 ",$hash$"op2)
837 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
838 (set mode op1 (insn1 mode op1 op2))
842 (arithmetic10 addri add add OP1_0 OP2_8 dr uimm3 HI)
843 (arithmetic10 subri sub sub OP1_2 OP2_8 dr uimm3 HI)
844 (arithmetic10 addbri addb add OP1_0 OP2_9 drb uimm3 QI)
845 (arithmetic10 subbri subb sub OP1_2 OP2_9 drb uimm3 QI)
847 ;add/sub register and immediate
848 (define-pmacro (arithmetic11 name insn insn1 opc1 opc2 op1 op2 mode)
850 (.str name "arithmetic" )
851 ((PIPE OS) (IDOC ALU))
852 (.str insn " $"op1 ",$hash$"op2)
853 (+ opc1 opc2 op1 op2)
854 (set mode op1 (insn1 mode op1 op2))
858 (arithmetic11 addrim add add OP1_0 OP2_6 reg8 uimm16 HI)
859 (arithmetic11 subrim sub sub OP1_2 OP2_6 reg8 uimm16 HI)
861 ;add/sub register and immediate
862 (define-pmacro (arithmetic12 name insn insn1 opc1 opc2 op1 op2 mode)
864 (.str name "arithmetic" )
865 ((PIPE OS) (IDOC ALU))
866 (.str insn " $"op1 ",$hash$"op2)
867 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
868 (set mode op1 (insn1 mode op1 op2))
872 (arithmetic12 addbrim addb add OP1_0 OP2_7 regb8 uimm8 QI)
873 (arithmetic12 subbrim subb sub OP1_2 OP2_7 regb8 uimm8 QI)
875 ;add/sub register and immediate with carry
876 (define-pmacro (arithmetic13 name insn insn1 opc1 opc2 op1 op2 mode)
878 (.str name "arithmetic" )
879 ((PIPE OS) (IDOC ALU))
880 (.str insn " $"op1 ",$hash$"op2)
881 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
882 (set mode op1 (insn1 mode op1 op2 cbit))
886 (arithmetic13 addcri addc addc OP1_1 OP2_8 dr uimm3 HI)
887 (arithmetic13 subcri subc subc OP1_3 OP2_8 dr uimm3 HI)
888 (arithmetic13 addcbri addcb addc OP1_1 OP2_9 drb uimm3 QI)
889 (arithmetic13 subcbri subcb subc OP1_3 OP2_9 drb uimm3 QI)
891 ;add/sub register and immediate with carry
892 (define-pmacro (arithmetic14 name insn insn1 opc1 opc2 op1 op2 mode)
894 (.str name "arithmetic" )
895 ((PIPE OS) (IDOC ALU))
896 (.str insn " $"op1 ",$hash$"op2)
897 (+ opc1 opc2 op1 op2)
898 (set mode op1 (insn1 mode op1 op2 cbit))
902 (arithmetic14 addcrim addc addc OP1_1 OP2_6 reg8 uimm16 HI)
903 (arithmetic14 subcrim subc subc OP1_3 OP2_6 reg8 uimm16 HI)
905 ;add/sub register and immediate with carry
906 (define-pmacro (arithmetic15 name insn insn1 opc1 opc2 op1 op2 mode)
908 (.str name "arithmetic" )
909 ((PIPE OS) (IDOC ALU))
910 (.str insn " $"op1 ",$hash$"op2)
911 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
912 (set mode op1 (insn1 mode op1 op2 cbit))
916 (arithmetic15 addcbrim addcb addc OP1_1 OP2_7 regb8 uimm8 QI)
917 (arithmetic15 subcbrim subcb subc OP1_3 OP2_7 regb8 uimm8 QI)
921 (define-pmacro (arithmetic name insn insn1 opc1 opc2 op1 op2 mode)
923 (.str name "arithmetic" )
924 ((PIPE OS) (IDOC ALU))
925 (.str insn " $"op1 ",$"op2)
926 (+ opc1 opc2 op1 op2)
927 (set mode op1 (insn1 mode op1 op2))
931 (arithmetic addr add add OP1_0 OP2_0 dr sr HI)
932 (arithmetic subr sub sub OP1_2 OP2_0 dr sr HI)
933 (arithmetic addbr addb add OP1_0 OP2_1 drb srb QI)
934 (arithmetic subbr subb sub OP1_2 OP2_1 drb srb QI)
936 ;add/sub register and indirect memory
937 (define-pmacro (arithmetic1 name insn insn1 opc1 opc2 op1 op2 mode)
939 (.str name "arithmetic" )
940 ((PIPE OS) (IDOC ALU))
941 (.str insn " $"op1 ",[$"op2"]")
942 (+ opc1 opc2 op1 (f-op-bit2 2) op2)
943 (set mode op1 (insn1 mode op1 (mem HI op2)))
947 (arithmetic1 add2 add add OP1_0 OP2_8 dr sr2 HI)
948 (arithmetic1 sub2 sub sub OP1_2 OP2_8 dr sr2 HI)
949 (arithmetic1 addb2 addb add OP1_0 OP2_9 drb sr2 QI)
950 (arithmetic1 subb2 subb sub OP1_2 OP2_9 drb sr2 QI)
952 ;add/sub register and indirect memory post increment
953 (define-pmacro (arithmetic2 name insn insn1 opc1 opc2 op1 op2 mode)
955 (.str name "arithmetic" )
956 ((PIPE OS) (IDOC ALU))
957 (.str insn " $"op1 ",[$"op2"+]")
958 (+ opc1 opc2 op1 (f-op-bit2 3) op2)
960 (set mode op1 (insn1 mode op1 (mem HI op2)))
961 (set HI op2 (add HI op2 (const 2)))
966 (arithmetic2 add2i add add OP1_0 OP2_8 dr sr2 HI)
967 (arithmetic2 sub2i sub sub OP1_2 OP2_8 dr sr2 HI)
968 (arithmetic2 addb2i addb add OP1_0 OP2_9 drb sr2 QI)
969 (arithmetic2 subb2i subb sub OP1_2 OP2_9 drb sr2 QI)
971 ;add/sub registers with carry
972 (define-pmacro (arithmetic3 name insn insn1 opc1 opc2 op1 op2 mode)
974 (.str name "arithmetic" )
975 ((PIPE OS) (IDOC ALU))
976 (.str insn " $"op1 ",$"op2)
977 (+ opc1 opc2 op1 op2)
978 (set mode op1 (insn1 mode op1 op2 cbit))
982 (arithmetic3 addcr addc addc OP1_1 OP2_0 dr sr HI)
983 (arithmetic3 subcr subc subc OP1_3 OP2_0 dr sr HI)
984 (arithmetic3 addbcr addcb addc OP1_1 OP2_1 drb srb QI)
985 (arithmetic3 subbcr subcb subc OP1_3 OP2_1 drb srb QI)
988 ;add/sub register and indirect memory
989 (define-pmacro (arithmetic4 name insn insn1 opc1 opc2 op1 op2 mode)
991 (.str name "arithmetic" )
992 ((PIPE OS) (IDOC ALU))
993 (.str insn " $"op1 ",[$"op2"]")
994 (+ opc1 opc2 op1 (f-op-bit2 2) op2)
995 (set mode op1 (insn1 mode op1 (mem HI op2) cbit))
999 (arithmetic4 addcr2 addc addc OP1_1 OP2_8 dr sr2 HI)
1000 (arithmetic4 subcr2 subc subc OP1_3 OP2_8 dr sr2 HI)
1001 (arithmetic4 addbcr2 addcb addc OP1_1 OP2_9 drb sr2 QI)
1002 (arithmetic4 subbcr2 subcb subc OP1_3 OP2_9 drb sr2 QI)
1004 ;add/sub register and indirect memory post increment
1005 (define-pmacro (arithmetic5 name insn insn1 opc1 opc2 op1 op2 mode)
1007 (.str name "arithmetic" )
1008 ((PIPE OS) (IDOC ALU))
1009 (.str insn " $"op1 ",[$"op2"+]")
1010 (+ opc1 opc2 op1 (f-op-bit2 3) op2)
1012 (set mode op1 (insn1 mode op1 (mem HI op2) cbit))
1013 (set HI op2 (add HI op2 (const 2)))
1018 (arithmetic5 addcr2i addc addc OP1_1 OP2_8 dr sr2 HI)
1019 (arithmetic5 subcr2i subc subc OP1_3 OP2_8 dr sr2 HI)
1020 (arithmetic5 addbcr2i addcb addc OP1_1 OP2_9 drb sr2 QI)
1021 (arithmetic5 subbcr2i subcb subc OP1_3 OP2_9 drb sr2 QI)
1023 ;add/sub register and direct memory
1024 (define-pmacro (arithmetic6 name insn insn1 opc1 opc2 op1 op2 mode)
1026 (.str name "arithmetic" )
1027 ((PIPE OS) (IDOC ALU))
1028 (.str insn " $"op1 ",$"op2)
1029 (+ opc1 opc2 op1 op2)
1030 (set mode op1 (insn1 mode op1 op2))
1035 ;add/sub register and direct memory
1036 (define-pmacro (arithmetic7 name insn insn1 opc1 opc2 op1 op2 mode)
1038 (.str name "arithmetic" )
1039 ((PIPE OS) (IDOC ALU))
1040 (.str insn " $"op1 ",$"op2)
1041 (+ opc1 opc2 op2 op1)
1042 (set (mem HI op1) (insn1 (mem HI op1) op2))
1046 (arithmetic6 addrm2 add add OP1_0 OP2_2 regmem8 memgr8 HI)
1047 (arithmetic7 addrm3 add add OP1_0 OP2_4 memgr8 regmem8 HI)
1048 (arithmetic6 addrm add add OP1_0 OP2_2 reg8 memory HI)
1049 (arithmetic7 addrm1 add add OP1_0 OP2_4 memory reg8 HI)
1050 (arithmetic6 subrm3 sub sub OP1_2 OP2_2 regmem8 memgr8 HI)
1051 (arithmetic7 subrm2 sub sub OP1_2 OP2_4 memgr8 regmem8 HI)
1052 (arithmetic6 subrm1 sub sub OP1_2 OP2_2 reg8 memory HI)
1053 (arithmetic7 subrm sub sub OP1_2 OP2_4 memory reg8 HI)
1054 (arithmetic6 addbrm2 addb add OP1_0 OP2_3 regbmem8 memgr8 QI)
1055 (arithmetic7 addbrm3 addb add OP1_0 OP2_5 memgr8 regbmem8 QI)
1056 (arithmetic6 addbrm addb add OP1_0 OP2_3 regb8 memory QI)
1057 (arithmetic7 addbrm1 addb add OP1_0 OP2_5 memory regb8 QI)
1058 (arithmetic6 subbrm3 subb sub OP1_2 OP2_3 regbmem8 memgr8 QI)
1059 (arithmetic7 subbrm2 subb sub OP1_2 OP2_5 memgr8 regbmem8 QI)
1060 (arithmetic6 subbrm1 subb sub OP1_2 OP2_3 regb8 memory QI)
1061 (arithmetic7 subbrm subb sub OP1_2 OP2_5 memory regb8 QI)
1063 ;add/sub registers with carry
1064 (define-pmacro (arithmetic8 name insn insn1 opc1 opc2 op1 op2 mode)
1066 (.str name "arithmetic" )
1067 ((PIPE OS) (IDOC ALU))
1068 (.str insn " $"op1 ",$"op2)
1069 (+ opc1 opc2 op1 op2)
1070 (set mode op1 (insn1 mode op1 op2 cbit))
1075 ;add/sub registers with carry
1076 (define-pmacro (arithmetic9 name insn insn1 opc1 opc2 op1 op2 mode)
1078 (.str name "arithmetic" )
1079 ((PIPE OS) (IDOC ALU))
1080 (.str insn " $"op1 ",$"op2)
1081 (+ opc1 opc2 op2 op1)
1082 (set (mem HI op1) (insn1 (mem HI op1) op2 cbit))
1086 (arithmetic8 addcrm2 addc addc OP1_1 OP2_2 regmem8 memgr8 HI)
1087 (arithmetic9 addcrm3 addc addc OP1_1 OP2_4 memgr8 regmem8 HI)
1088 (arithmetic8 addcrm addc addc OP1_1 OP2_2 reg8 memory HI)
1089 (arithmetic9 addcrm1 addc addc OP1_1 OP2_4 memory reg8 HI)
1090 (arithmetic8 subcrm3 subc subc OP1_3 OP2_2 regmem8 memgr8 HI)
1091 (arithmetic9 subcrm2 subc subc OP1_3 OP2_4 memgr8 regmem8 HI)
1092 (arithmetic8 subcrm1 subc subc OP1_3 OP2_2 reg8 memory HI)
1093 (arithmetic9 subcrm subc subc OP1_3 OP2_4 memory reg8 HI)
1094 (arithmetic8 addcbrm2 addcb addc OP1_1 OP2_3 regbmem8 memgr8 QI)
1095 (arithmetic9 addcbrm3 addcb addc OP1_1 OP2_5 memgr8 regbmem8 QI)
1096 (arithmetic8 addcbrm addcb addc OP1_1 OP2_3 regb8 memory QI)
1097 (arithmetic9 addcbrm1 addcb addc OP1_1 OP2_5 memory regb8 QI)
1098 (arithmetic8 subcbrm3 subcb subc OP1_3 OP2_3 regbmem8 memgr8 QI)
1099 (arithmetic9 subcbrm2 subcb subc OP1_3 OP2_5 memgr8 regbmem8 QI)
1100 (arithmetic8 subcbrm1 subcb subc OP1_3 OP2_3 regb8 memory QI)
1101 (arithmetic9 subcbrm subcb subc OP1_3 OP2_5 memory regb8 QI)
1104 (dni muls "signed multiplication"
1105 ((PIPE OS) (IDOC ALU))
1107 (+ OP1_0 OP2_11 src1 src2)
1108 (nop) ;; FIXME: (reg SI h-md 0)
1112 (dni mulu "unsigned multiplication"
1113 ((PIPE OS) (IDOC ALU))
1115 (+ OP1_1 OP2_11 src1 src2)
1116 (nop) ;; FIXME: (reg SI h-md 0)
1120 (dni div "16-by-16 signed division"
1121 ((PIPE OS) (IDOC ALU))
1123 (+ OP1_4 OP2_11 srdiv )
1125 (set HI (reg HI h-cr 6) (div HI (reg HI h-cr 6) srdiv))
1126 (set HI (reg HI h-cr 7) (mod HI (reg HI h-cr 6) srdiv))
1131 (dni divl "32-by16 signed division"
1132 ((PIPE OS) (IDOC ALU))
1134 (+ OP1_6 OP2_11 srdiv )
1136 (set HI (reg HI h-cr 6) 0) ;; FIXME: (div SI (reg SI h-md 0) srdiv))
1137 (set HI (reg HI h-cr 7) 0) ;; FIXME: (mod SI (reg SI h-md 0) srdiv))
1142 (dni divlu "32-by16 unsigned division"
1143 ((PIPE OS) (IDOC ALU))
1145 (+ OP1_7 OP2_11 srdiv )
1147 (set HI (reg HI h-cr 6) 0) ;; FIXME: (udiv SI (reg SI h-md 0) srdiv))
1148 (set HI (reg HI h-cr 7) 0) ;; FIXME: (umod SI (reg SI h-md 0) srdiv))
1153 (dni divu "16-by-16 unsigned division"
1154 ((PIPE OS) (IDOC ALU))
1156 (+ OP1_5 OP2_11 srdiv )
1158 (set HI (reg HI h-cr 6) (udiv HI (reg HI h-cr 6) srdiv))
1159 (set HI (reg HI h-cr 7) (umod HI (reg HI h-cr 6) srdiv))
1164 ;Integer one's complement
1166 (dni cpl "Integer Ones complement"
1167 ((PIPE OS) (IDOC MISC))
1169 (+ OP1_9 OP2_1 dr (f-op-bit4 0))
1170 (set dr (inv HI dr))
1174 ;Bytes one's complement
1176 (dni cplb "Byte Ones complement"
1177 ((PIPE OS) (IDOC MISC))
1179 (+ OP1_11 OP2_1 drb (f-op-bit4 0))
1180 (set drb (inv QI drb))
1183 ;Integer two's complement
1185 (dni neg "Integer two's complement"
1186 ((PIPE OS) (IDOC MISC))
1188 (+ OP1_8 OP2_1 dr (f-op-bit4 0))
1189 (set dr (neg HI dr))
1192 ;Bytes two's complement
1194 (dni negb "byte twos complement"
1195 ((PIPE OS) (IDOC MISC))
1197 (+ OP1_10 OP2_1 drb (f-op-bit4 0))
1198 (set drb (neg QI drb))
1202 ;****************************************************************
1204 ;****************************************************************
1205 ;and/or/xor registers
1206 (define-pmacro (logical name insn insn1 opc1 opc2 op1 op2 mode)
1208 (.str name "logical" )
1209 ((PIPE OS) (IDOC ALU))
1210 (.str insn " $"op1 ",$"op2)
1211 (+ opc1 opc2 op1 op2)
1212 (set mode op1 (insn1 mode op1 op2))
1217 (logical andr and and OP1_6 OP2_0 dr sr HI)
1218 (logical orr or or OP1_7 OP2_0 dr sr HI)
1219 (logical xorr xor xor OP1_5 OP2_0 dr sr HI)
1220 (logical andbr andb and OP1_6 OP2_1 drb srb QI)
1221 (logical orbr orb or OP1_7 OP2_1 drb srb QI)
1222 (logical xorbr xorb xor OP1_5 OP2_1 drb srb QI)
1224 ;and/or/xor register and immediate
1225 (define-pmacro (logical1 name insn insn1 opc1 opc2 op1 op2 mode)
1227 (.str name "logical" )
1228 ((PIPE OS) (IDOC ALU))
1229 (.str insn " $"op1 ",$hash$"op2)
1230 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
1231 (set mode op1 (insn1 mode op1 op2))
1235 (logical1 andri and and OP1_6 OP2_8 dr uimm3 HI)
1236 (logical1 orri or or OP1_7 OP2_8 dr uimm3 HI)
1237 (logical1 xorri xor xor OP1_5 OP2_8 dr uimm3 HI)
1238 (logical1 andbri andb and OP1_6 OP2_9 drb uimm3 QI)
1239 (logical1 orbri orb or OP1_7 OP2_9 drb uimm3 QI)
1240 (logical1 xorbri xorb xor OP1_5 OP2_9 drb uimm3 QI)
1242 ;and/or/xor register and immediate
1243 (define-pmacro (logical2 name insn insn1 opc1 opc2 op1 op2 mode)
1245 (.str name "logical" )
1246 ((PIPE OS) (IDOC ALU))
1247 (.str insn " $"op1 ",$hash$"op2)
1248 (+ opc1 opc2 op1 op2)
1249 (set mode op1 (insn1 mode op1 op2))
1253 (logical2 andrim and and OP1_6 OP2_6 reg8 uimm16 HI)
1254 (logical2 orrim or or OP1_7 OP2_6 reg8 uimm16 HI)
1255 (logical2 xorrim xor xor OP1_5 OP2_6 reg8 uimm16 HI)
1257 ;and/or/xor register and immediate
1258 (define-pmacro (logical3 name insn insn1 opc1 opc2 op1 op2 mode)
1260 (.str name "logical" )
1261 ((PIPE OS) (IDOC ALU))
1262 (.str insn " $"op1 ",$hash$"op2)
1263 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
1264 (set mode op1 (insn1 mode op1 op2))
1268 (logical3 andbrim andb and OP1_6 OP2_7 regb8 uimm8 QI)
1269 (logical3 orbrim orb or OP1_7 OP2_7 regb8 uimm8 QI)
1270 (logical3 xorbrim xorb xor OP1_5 OP2_7 regb8 uimm8 QI)
1272 ;and/or/xor register and indirect memory
1273 (define-pmacro (logical4 name insn insn1 opc1 opc2 op1 op2 mode)
1275 (.str name "logical" )
1276 ((PIPE OS) (IDOC ALU))
1277 (.str insn " $"op1 ",[$"op2"]")
1278 (+ opc1 opc2 op1 (f-op-bit2 2) op2)
1279 (set mode op1 (insn1 mode op1 (mem HI op2)))
1283 (logical4 and2 and and OP1_6 OP2_8 dr sr2 HI)
1284 (logical4 or2 or or OP1_7 OP2_8 dr sr2 HI)
1285 (logical4 xor2 xor xor OP1_5 OP2_8 dr sr2 HI)
1286 (logical4 andb2 andb and OP1_6 OP2_9 drb sr2 QI)
1287 (logical4 orb2 orb or OP1_7 OP2_9 drb sr2 QI)
1288 (logical4 xorb2 xorb xor OP1_5 OP2_9 drb sr2 QI)
1290 ;and/or/xor register and indirect memory post increment
1291 (define-pmacro (logical5 name insn insn1 opc1 opc2 op1 op2 mode)
1293 (.str name "logical" )
1294 ((PIPE OS) (IDOC ALU))
1295 (.str insn " $"op1 ",[$"op2"+]")
1296 (+ opc1 opc2 op1 (f-op-bit2 3) op2)
1298 (set mode op1 (insn1 mode op1 (mem HI op2)))
1299 (set HI op2 (add HI op2 (const 2)))
1304 (logical5 and2i and and OP1_6 OP2_8 dr sr2 HI)
1305 (logical5 or2i or or OP1_7 OP2_8 dr sr2 HI)
1306 (logical5 xor2i xor xor OP1_5 OP2_8 dr sr2 HI)
1307 (logical5 andb2i andb and OP1_6 OP2_9 drb sr2 QI)
1308 (logical5 orb2i orb or OP1_7 OP2_9 drb sr2 QI)
1309 (logical5 xorb2i xorb xor OP1_5 OP2_9 drb sr2 QI)
1311 ;add/sub register and immediate
1312 (define-pmacro (logical7 name insn insn1 opc1 opc2 op1 op2 mode dir)
1314 (.str name "arithmetic" )
1315 ((PIPE OS) (IDOC ALU))
1316 (.str insn " $"dir"$"op1 ",$"op2)
1317 (+ opc1 opc2 op1 op2)
1318 (set (mem HI op1) (insn1 (mem HI op1) op2 ))
1322 (logical7 andpofr and and OP1_6 OP2_2 reg8 upof16 HI "pof")
1323 (logical7 orpofr or or OP1_7 OP2_2 reg8 upof16 HI "pof")
1324 (logical7 xorpofr xor xor OP1_5 OP2_2 reg8 upof16 HI "pof")
1325 (logical7 andbpofr andb and OP1_6 OP2_3 regb8 upof16 QI "pof")
1326 (logical7 orbpofr orb or OP1_7 OP2_3 regb8 upof16 QI "pof")
1327 (logical7 xorbpofr xorb xor OP1_5 OP2_3 regb8 upof16 QI "pof")
1329 ;add/sub register and immediate
1330 (define-pmacro (logical8 name insn insn1 opc1 opc2 op1 op2 mode dir)
1332 (.str name "arithmetic" )
1333 ((PIPE OS) (IDOC ALU))
1334 (.str insn " $"dir"$"op1 ",$"op2)
1335 (+ opc1 opc2 op1 op2)
1336 (set (mem HI op1) (insn1 (mem HI op1) op2 ))
1340 (logical8 andrpofr and and OP1_6 OP2_4 upof16 reg8 HI "pof")
1341 (logical8 orrpofr or or OP1_7 OP2_4 upof16 reg8 HI "pof")
1342 (logical8 xorrpofr xor xor OP1_5 OP2_4 upof16 reg8 HI "pof")
1343 (logical8 andbrpofr andb and OP1_6 OP2_5 upof16 regb8 QI "pof")
1344 (logical8 orbrpofr orb or OP1_7 OP2_5 upof16 regb8 QI "pof")
1345 (logical8 xorbrpofr xorb xor OP1_5 OP2_5 upof16 regb8 QI "pof")
1347 ;and/or/xor register and direct memory
1348 (define-pmacro (logical6 name insn insn1 opc1 opc2 op1 op2 mode)
1350 (.str name "arithmetic" )
1351 ((PIPE OS) (IDOC ALU))
1352 (.str insn " $"op1 ",$"op2)
1353 (+ opc1 opc2 op1 op2)
1354 (set mode op1 (insn1 mode op1 op2))
1359 ;and/or/xor register and direct memory
1360 (define-pmacro (logical7 name insn insn1 opc1 opc2 op1 op2 mode)
1362 (.str name "arithmetic" )
1363 ((PIPE OS) (IDOC ALU))
1364 (.str insn " $"op1 ",$"op2)
1365 (+ opc1 opc2 op2 op1)
1366 (set (mem HI op1) (insn1 (mem HI op1) op2))
1370 (logical6 andrm2 and and OP1_6 OP2_2 regmem8 memgr8 HI)
1371 (logical7 andrm3 and and OP1_6 OP2_4 memgr8 regmem8 HI)
1372 (logical6 andrm and and OP1_6 OP2_2 reg8 memory HI)
1373 (logical7 andrm1 and and OP1_6 OP2_4 memory reg8 HI)
1374 (logical6 orrm3 or or OP1_7 OP2_2 regmem8 memgr8 HI)
1375 (logical7 orrm2 or or OP1_7 OP2_4 memgr8 regmem8 HI)
1376 (logical6 orrm1 or or OP1_7 OP2_2 reg8 memory HI)
1377 (logical7 orrm or or OP1_7 OP2_4 memory reg8 HI)
1378 (logical6 xorrm3 xor xor OP1_5 OP2_2 regmem8 memgr8 HI)
1379 (logical7 xorrm2 xor xor OP1_5 OP2_4 memgr8 regmem8 HI)
1380 (logical6 xorrm1 xor xor OP1_5 OP2_2 reg8 memory HI)
1381 (logical7 xorrm xor xor OP1_5 OP2_4 memory reg8 HI)
1382 (logical6 andbrm2 andb and OP1_6 OP2_3 regbmem8 memgr8 QI)
1383 (logical7 andbrm3 andb and OP1_6 OP2_5 memgr8 regbmem8 QI)
1384 (logical6 andbrm andb and OP1_6 OP2_3 regb8 memory QI)
1385 (logical7 andbrm1 andb and OP1_6 OP2_5 memory regb8 QI)
1386 (logical6 orbrm3 orb or OP1_7 OP2_3 regbmem8 memgr8 QI)
1387 (logical7 orbrm2 orb or OP1_7 OP2_5 memgr8 regbmem8 QI)
1388 (logical6 orbrm1 orb or OP1_7 OP2_3 regb8 memory QI)
1389 (logical7 orbrm orb or OP1_7 OP2_5 memory regb8 QI)
1390 (logical6 xorbrm3 xorb xor OP1_5 OP2_3 regbmem8 memgr8 QI)
1391 (logical7 xorbrm2 xorb xor OP1_5 OP2_5 memgr8 regbmem8 QI)
1392 (logical6 xorbrm1 xorb xor OP1_5 OP2_3 regb8 memory QI)
1393 (logical7 xorbrm xorb xor OP1_5 OP2_5 memory regb8 QI)
1395 ;****************************************************************
1397 ;****************************************************************
1399 (define-pmacro (move name insn opc1 opc2 op1 op2 mode)
1401 (.str name "mov registers" )
1402 ((PIPE OS) (IDOC MOVE))
1403 (.str insn " $"op1 ",$"op2)
1404 (+ opc1 opc2 op1 op2)
1409 (move movr mov OP1_15 OP2_0 dr sr HI)
1410 (move movrb movb OP1_15 OP2_1 drb srb HI)
1412 ;mov register and immediate
1413 (define-pmacro (move1 name insn opc1 opc2 op1 op2 mode)
1416 ((PIPE OS) (IDOC MOVE))
1417 (.str insn " $"op1 ",$hash$"op2)
1418 (+ opc1 opc2 op2 op1)
1423 (move1 movri mov OP1_14 OP2_0 dri u4 HI)
1424 (move1 movbri movb OP1_14 OP2_1 srb u4 QI)
1427 (dni movi "move immediate to register"
1428 ((PIPE OS) (IDOC MOVE))
1429 "mov $reg8,$hash$uimm16"
1430 (+ OP1_14 OP2_6 reg8 uimm16)
1431 (set HI reg8 uimm16)
1436 (dni movbi "move immediate to register"
1437 ((PIPE OS) (IDOC MOVE))
1438 "movb $regb8,$hash$uimm8"
1439 (+ OP1_14 OP2_7 regb8 uimm8 (f-op-bit8 0))
1440 (set QI regb8 uimm8)
1444 ;move and indirect memory
1445 (define-pmacro (mov2 name insn opc1 opc2 op1 op2 mode)
1448 ((PIPE OS) (IDOC MOVE))
1449 (.str insn " $"op1 ",[$"op2"]")
1450 (+ opc1 opc2 op1 op2)
1451 (set mode op1 (mem HI op2))
1455 (mov2 movr2 mov OP1_10 OP2_8 dr sr HI)
1456 (mov2 movbr2 movb OP1_10 OP2_9 drb sr QI)
1458 ;move and indirect memory
1459 (define-pmacro (mov3 name insn opc1 opc2 op1 op2 mode)
1462 ((PIPE OS) (IDOC MOVE))
1463 (.str insn " [$"op2 "],$"op1)
1464 (+ opc1 opc2 op1 op2)
1465 (set mode op1 (mem HI op2))
1469 (mov3 movri2 mov OP1_11 OP2_8 dr sr HI)
1470 (mov3 movbri2 movb OP1_11 OP2_9 drb sr QI)
1472 ;move and indirect memory
1473 (define-pmacro (mov4 name insn opc1 opc2 op1 op2 mode)
1476 ((PIPE OS) (IDOC MOVE))
1477 (.str insn " [-$"op2 "],$"op1)
1478 (+ opc1 opc2 op1 op2)
1480 (set op1 (sub op2 (const HI 2)))
1481 (set HI (mem HI op2) op1)
1486 (mov4 movri3 mov OP1_8 OP2_8 dr sr HI)
1487 (mov4 movbri3 movb OP1_8 OP2_9 drb sr QI)
1489 ;mov register and indirect memory post increment
1490 (define-pmacro (mov5 name insn opc1 opc2 op1 op2 mode)
1493 ((PIPE OS) (IDOC MOVE))
1494 (.str insn " $"op1 ",[$"op2"+]")
1495 (+ opc1 opc2 op1 op2)
1497 (set mode op1 (mem HI op2))
1498 (set HI op2 (add HI op2 (const 2)))
1503 (mov5 mov2i mov OP1_9 OP2_8 dr sr HI)
1504 (mov5 movb2i movb OP1_9 OP2_9 drb sr HI)
1506 ;mov indirect memory
1507 (define-pmacro (mov6 name insn opc1 opc2 op1 op2 mode)
1510 ((PIPE OS) (IDOC MOVE))
1511 (.str insn " [$"op1 "],[$"op2"]")
1512 (+ opc1 opc2 op1 op2)
1513 (set HI (mem HI op1) (mem HI op2))
1517 (mov6 mov6i mov OP1_12 OP2_8 dr sr HI)
1518 (mov6 movb6i movb OP1_12 OP2_9 dr sr HI)
1520 ;mov indirect memory
1521 (define-pmacro (mov7 name insn opc1 opc2 op1 op2 mode)
1524 ((PIPE OS) (IDOC MOVE))
1525 (.str insn " [$"op1 "+],[$"op2"]")
1526 (+ opc1 opc2 op1 op2)
1528 (set mode (mem mode op1) (mem mode op2))
1529 (set mode op1 (add mode op1 (const mode 2)))
1534 (mov7 mov7i mov OP1_13 OP2_8 dr sr HI)
1535 (mov7 movb7i movb OP1_13 OP2_9 dr sr HI)
1537 ;mov indirect memory
1538 (define-pmacro (mov8 name insn opc1 opc2 op1 op2 mode)
1541 ((PIPE OS) (IDOC MOVE))
1542 (.str insn " [$"op1 "],[$"op2"+]")
1543 (+ opc1 opc2 op1 op2)
1545 (set mode (mem mode op1) (mem mode op2))
1546 (set mode op2 (add mode op2 (const mode 2)))
1551 (mov8 mov8i mov OP1_14 OP2_8 dr sr HI)
1552 (mov8 movb8i movb OP1_14 OP2_9 dr sr HI)
1554 ;mov indirect memory
1555 (define-pmacro (mov9 name insn opc1 opc2 op1 op2 mode)
1558 ((PIPE OS) (IDOC MOVE))
1559 (.str insn " $"op1 ",[$"op2"+$hash$"uimm16"]")
1560 (+ opc1 opc2 op1 op2 uimm16)
1561 (sequence mode ((mode tmp1))
1562 (set mode tmp1 (add HI op2 uimm16))
1563 (set mode op1 (mem HI tmp1))
1568 (mov9 mov9i mov OP1_13 OP2_4 dr sr HI)
1569 (mov9 movb9i movb OP1_15 OP2_4 drb sr QI)
1571 ;mov indirect memory
1572 (define-pmacro (mov10 name insn opc1 opc2 op1 op2 mode)
1575 ((PIPE OS) (IDOC MOVE))
1576 (.str insn " [$"op2"+$hash$"uimm16 "],$"op1)
1577 (+ opc1 opc2 op1 op2 uimm16)
1578 (sequence mode ((mode tmp1))
1579 (set mode tmp1 (add HI op1 uimm16))
1580 (set mode (mem HI tmp1) op1)
1585 (mov10 mov10i mov OP1_12 OP2_4 dr sr HI)
1586 (mov10 movb10i movb OP1_14 OP2_4 drb sr QI)
1588 ;move and indirect memory
1589 (define-pmacro (mov11 name insn opc1 opc2 op1 op2 mode)
1592 ((PIPE OS) (IDOC MOVE))
1593 (.str insn " [$"op1 "],$"op2)
1594 (+ opc1 opc2 (f-op-lbit4 0) op1 op2)
1595 (set (mem mode op1) (mem HI op2))
1599 (mov11 movri11 mov OP1_8 OP2_4 src2 memory HI)
1600 (mov11 movbri11 movb OP1_10 OP2_4 src2 memory HI)
1602 ;move and indirect memory
1603 (define-pmacro (mov12 name insn opc1 opc2 op1 op2 mode)
1606 ((PIPE OS) (IDOC MOVE))
1607 (.str insn " $"op2 ",[$"op1"]")
1608 (+ opc1 opc2 (f-op-lbit4 0) op1 op2)
1609 (set (mem HI op2) (mem mode op1))
1613 (mov12 movri12 mov OP1_9 OP2_4 src2 memory HI)
1614 (mov12 movbri12 movb OP1_11 OP2_4 src2 memory HI)
1616 (define-pmacro (movemem3 name insn opc1 opc2 op1 op2 dir)
1619 ((PIPE OS) (IDOC MOVE))
1620 (.str insn " $"op1 ",$hash$"dir"$"op2)
1621 (+ opc1 opc2 op1 op2)
1626 (movemem3 movehm5 mov OP1_14 OP2_6 regoff8 upof16 "pof")
1627 (movemem3 movehm6 mov OP1_14 OP2_6 regoff8 upag16 "pag")
1628 (movemem3 movehm7 mov OP1_14 OP2_6 regoff8 useg16 "segm")
1629 (movemem3 movehm8 mov OP1_14 OP2_6 regoff8 usof16 "sof")
1631 (define-pmacro (movemem4 name insn opc1 opc2 op1 op2 dir)
1634 ((PIPE OS) (IDOC MOVE))
1635 (.str insn " $"op1 ",$hash$"dir"$"op2)
1636 (+ opc1 opc2 op1 op2 (f-op-bit8 0))
1641 (movemem4 movehm9 movb OP1_14 OP2_7 regb8 uimm8 "pof")
1642 (movemem4 movehm10 movb OP1_14 OP2_7 regoff8 uimm8 "pag")
1644 (define-pmacro (movemem name insn opc1 opc2 op1 op2 mode dir)
1647 ((PIPE OS) (IDOC MOVE))
1648 (.str insn " $"op1 ",$"dir"$"op2)
1649 (+ opc1 opc2 op1 op2)
1650 (set mode op1 (mem HI op2))
1654 (movemem movrmp mov OP1_15 OP2_2 regoff8 upof16 HI "pof")
1655 (movemem movrmp1 movb OP1_15 OP2_3 regb8 upof16 QI "pof")
1656 (movemem movrmp2 mov OP1_15 OP2_2 regoff8 upag16 HI "pag")
1657 (movemem movrmp3 movb OP1_15 OP2_3 regb8 upag16 QI "pag")
1659 (define-pmacro (movemem1 name insn opc1 opc2 op1 op2 dir)
1662 ((PIPE OS) (IDOC MOVE))
1663 (.str insn " $"dir"$"op1 ",$"op2)
1664 (+ opc1 opc2 op2 op1)
1665 (set (mem HI op1) op2 )
1669 (movemem1 movrmp4 mov OP1_15 OP2_6 upof16 regoff8 "pof")
1670 (movemem1 movrmp5 movb OP1_15 OP2_7 upof16 regb8 "pof")
1672 (define-pmacro (movemem2 name insn opc1 opc2 op1 op2 mode dir)
1675 ((PIPE OS) (IDOC MOVE))
1676 (.str insn " $"op1 ",$hash$"dir"$"op2)
1677 (+ opc1 opc2 op2 op1)
1682 (movemem2 movehm1 mov OP1_14 OP2_0 dri u4 HI "pof")
1683 (movemem2 movehm2 movb OP1_14 OP2_1 srb u4 QI "pof")
1684 (movemem2 movehm3 mov OP1_14 OP2_0 dri u4 HI "pag")
1685 (movemem2 movehm4 movb OP1_14 OP2_1 srb u4 QI "pag")
1687 ;move register and direct memory
1688 (define-pmacro (move12 name insn opc1 opc2 op1 op2 mode)
1691 ((PIPE OS) (IDOC MOVE))
1692 (.str insn " $"op1 ",$"op2)
1693 (+ opc1 opc2 op1 op2)
1694 (set mode op1 (mem HI op2))
1699 ;move register and direct memory
1700 (define-pmacro (move13 name insn opc1 opc2 op1 op2 mode)
1703 ((PIPE OS) (IDOC MOVE))
1704 (.str insn " $"op1 ",$"op2)
1705 (+ opc1 opc2 op2 op1)
1706 (set (mem HI op1) op2)
1710 (move12 mve12 mov OP1_15 OP2_2 regmem8 memgr8 HI)
1711 (move13 mve13 mov OP1_15 OP2_6 memgr8 regmem8 HI)
1712 (move12 mover12 mov OP1_15 OP2_2 reg8 memory HI)
1713 (move13 mvr13 mov OP1_15 OP2_6 memory reg8 HI)
1714 (move12 mver12 movb OP1_15 OP2_3 regbmem8 memgr8 QI)
1715 (move13 mver13 movb OP1_15 OP2_7 memgr8 regbmem8 QI)
1716 (move12 movr12 movb OP1_15 OP2_3 regb8 memory QI)
1717 (move13 movr13 movb OP1_15 OP2_7 memory regb8 QI)
1720 (dni movbsrr "mov byte register with sign extension to word register"
1721 ((PIPE OS) (IDOC MOVE))
1723 (+ OP1_13 OP2_0 drb sr)
1725 (if QI (and QI drb (const 128))
1726 (set HI sr (or HI (const HI 65280) drb)))
1727 (set HI sr (and HI (const HI 255) drb))
1733 (dni movbzrr "mov byte register with zero extension to word register"
1734 ((PIPE OS) (IDOC MOVE))
1736 (+ OP1_12 OP2_0 drb sr)
1737 (set HI sr (and HI (const HI 255) drb))
1742 (dni movbsrpofm "mov memory to byte register"
1743 ((PIPE OS) (IDOC MOVE))
1744 "movbs $regmem8,$pof$upof16"
1745 (+ OP1_13 OP2_2 regmem8 upof16)
1746 (set QI regmem8 (mem HI upof16))
1751 (dni movbspofmr "mov memory to byte register"
1752 ((PIPE OS) (IDOC MOVE))
1753 "movbs $pof$upof16,$regbmem8"
1754 (+ OP1_13 OP2_5 upof16 regbmem8 )
1755 (set QI (mem HI upof16) regbmem8)
1760 (dni movbzrpofm "mov memory to byte register"
1761 ((PIPE OS) (IDOC MOVE))
1762 "movbz $reg8,$pof$upof16"
1763 (+ OP1_12 OP2_2 reg8 upof16)
1764 (set QI reg8 (mem HI upof16))
1769 (dni movbzpofmr "mov memory to byte register"
1770 ((PIPE OS) (IDOC MOVE))
1771 "movbz $pof$upof16,$regb8"
1772 (+ OP1_12 OP2_5 upof16 regb8 )
1773 (set QI (mem HI upof16) regb8)
1777 ;move register and direct memory
1778 (define-pmacro (move14 name insn opc1 opc2 op1 op2 )
1781 ((PIPE OS) (IDOC MOVE))
1782 (.str insn " $"op1 ",$"op2)
1783 (+ opc1 opc2 op1 op2)
1784 (set HI op1 (and HI (const HI 255) (mem QI op2)))
1789 ;move register and direct memory
1790 (define-pmacro (move15 name insn opc1 opc2 op1 op2 )
1793 ((PIPE OS) (IDOC MOVE))
1794 (.str insn " $"op1 ",$"op2)
1795 (+ opc1 opc2 op2 op1)
1796 (set HI (mem HI op1) (and HI (const HI 255) op2))
1800 (move14 movebs14 movbs OP1_13 OP2_2 regmem8 memgr8 )
1801 (move15 movebs15 movbs OP1_13 OP2_5 memgr8 regbmem8 )
1802 (move14 moverbs14 movbs OP1_13 OP2_2 reg8 memory )
1803 (move15 movrbs15 movbs OP1_13 OP2_5 memory regb8 )
1804 (move14 movebz14 movbz OP1_12 OP2_2 regmem8 memgr8 )
1805 (move15 movebz15 movbz OP1_12 OP2_5 memgr8 regbmem8 )
1806 (move14 moverbz14 movbz OP1_12 OP2_2 reg8 memory )
1807 (move15 movrbz15 movbz OP1_12 OP2_5 memory regb8 )
1811 (define-pmacro (moveb1 name insn opc1 opc2 op1 op2)
1814 ((PIPE OS) (IDOC MOVE))
1815 (.str insn " $"op2 ",$"op1)
1816 (+ opc1 opc2 op1 op2)
1818 (if QI (and QI op1 (const 128))
1819 (set HI op2 (or HI (const HI 65280) op1)))
1820 (set HI op2 (and HI (const HI 255) op1))
1825 (moveb1 movrbs movbs OP1_13 OP2_0 drb sr )
1826 (moveb1 movrbz movbz OP1_12 OP2_0 drb sr )
1830 ;jump and call insns
1831 ;******************************************************************
1832 ;Absolute conditional jump
1833 (define-pmacro (jmpabs name insn)
1835 (.str name "Absolute conditional jump" )
1836 ((PIPE OS) (IDOC JMP))
1837 (.str insn " $extcond,$caddr")
1838 (+ OP1_14 OP2_10 extcond (f-op-bitone 0) bitone bit01 caddr)
1839 (sequence ((HI tmp1) (HI tmp2))
1840 (set tmp1 (mem HI caddr))
1841 (set tmp2 (sub HI pc (mem HI caddr)))
1842 (if (gt tmp2 (const 0)) ;; FIXME: (lt tmp2 (const 32)) (eq tmp2 (const 32))
1843 (set bitone (const 1)))
1844 (if (lt tmp2 (const 0)) ;; FIXME: (eq tmp2 (const 0)) (gt tmp2 (const 32))
1845 (set bitone (const 0)))
1846 (if (eq extcond (const 1)) ;; FIXME: (ne extcond cc_Z))
1847 (set bit01 (const 0))
1848 (set HI pc (mem HI caddr)))
1849 (if (ne extcond (const 1)) ;; FIXME: (eq extcond cc_Z))
1850 (set bit01 (const 1))
1851 (set HI pc (add HI pc (const 2))))
1857 (jmpabs jmpa0 jmpa+)
1861 (dni jmpa- "Absolute conditional jump"
1862 (COND-CTI (PIPE OS) (IDOC JMP))
1863 "jmpa- $extcond,$caddr"
1864 (+ OP1_14 OP2_10 extcond (f-op-bitone 0) bitone (f-op-1bit 1) caddr)
1865 (sequence ((HI tmp1) (HI tmp2))
1866 (set tmp1 (mem HI caddr))
1867 (set tmp2 (sub HI pc (mem HI caddr)))
1868 (if (gt tmp2 (const 0)) ;; FIXME: (lt tmp2 (const 32)) (eq tmp2 (const 32))
1869 (set bitone (const 1)))
1870 (if (lt tmp2 (const 0)) ;; FIXME: (eq tmp2 (const 0)) (gt tmp2 (const 32))
1871 (set bitone (const 0)))
1872 (set HI pc (add HI pc (const 2)))
1878 (dni jmpi "Indirect conditional jump"
1879 (COND-CTI (PIPE OS) (IDOC JMP))
1881 (+ OP1_9 OP2_12 icond sr)
1883 (if (eq icond (const 1))
1884 (set HI pc (mem HI sr)))
1885 (set HI pc (add HI pc (const 2)))
1890 (define-pmacro (jmprel name insn opc1)
1892 (.str name "conditional" )
1893 (COND-CTI (PIPE OS) (IDOC JMP))
1894 (.str insn " $cond,$rel")
1897 (if (eq cond (const 1))
1899 (if QI (lt QI rel (const 0))
1901 ;; FIXME: (neg QI rel)
1902 ;; FIXME: (add QI rel (const 1))
1903 ;; FIXME: (mul QI rel (const 2))
1904 (set HI pc (sub HI pc rel))
1906 (set HI pc (add HI pc (mul QI rel (const 2))))
1915 (jmprel jmpr_nenz jmpr COND_NE_NZ )
1916 (jmprel jmpr_sgt jmpr COND_SGT )
1917 (jmprel jmpr_z jmpr COND_Z )
1918 (jmprel jmpr_v jmpr COND_V )
1919 (jmprel jmpr_nv jmpr COND_NV )
1920 (jmprel jmpr_n jmpr COND_N )
1921 (jmprel jmpr_nn jmpr COND_NN )
1922 (jmprel jmpr_c jmpr COND_C )
1923 (jmprel jmpr_nc jmpr COND_NC )
1924 (jmprel jmpr_eq jmpr COND_EQ )
1925 (jmprel jmpr_ne jmpr COND_NE )
1926 (jmprel jmpr_ult jmpr COND_ULT )
1927 (jmprel jmpr_ule jmpr COND_ULE )
1928 (jmprel jmpr_uge jmpr COND_UGE )
1929 (jmprel jmpr_ugt jmpr COND_UGT )
1930 (jmprel jmpr_sle jmpr COND_SLE )
1931 (jmprel jmpr_sge jmpr COND_SGE )
1932 (jmprel jmpr_net jmpr COND_NET )
1933 (jmprel jmpr_uc jmpr COND_UC )
1934 (jmprel jmpr_slt jmpr COND_SLT )
1940 (dni jmpseg "absolute inter-segment jump"
1941 (UNCOND-CTI(PIPE OS) (IDOC JMP))
1942 "jmps $hash$segm$useg8,$hash$sof$usof16"
1943 (+ OP1_15 OP2_10 seg usof16)
1945 (if QI (eq BI sgtdisbit (const BI 0))
1946 (set QI (reg h-cr 10) useg8))
1954 (dni jmps "absolute inter-segment jump"
1955 (UNCOND-CTI(PIPE OS) (IDOC JMP))
1957 (+ OP1_15 OP2_10 seg caddr)
1959 (if QI (eq BI sgtdisbit (const BI 0))
1960 (set QI (reg h-cr 10) seg))
1968 ;relative jump if bit set
1970 (dni jb "relative jump if bit set"
1971 ((PIPE OS) (IDOC JMP))
1972 "jb $genreg$dot$qlobit,$relhi"
1973 (+ OP1_8 OP2_10 genreg relhi qlobit (f-qhibit 0))
1974 (sequence ((HI tmp1) (HI tmp2))
1975 (set HI tmp1 genreg)
1976 (set HI tmp2 (const 1))
1977 (sll HI tmp2 qlobit)
1978 (set HI tmp2 (and tmp1 tmp2))
1979 (if (eq tmp2 (const 1))
1981 (if QI (lt QI relhi (const 0))
1982 (set HI pc (add HI pc (mul QI relhi (const 2)))))
1984 (set HI pc (add HI pc (const 4)))
1989 ;relative jump if bit set and clear bit
1991 (dni jbc "relative jump if bit set and clear bit"
1992 ((PIPE OS) (IDOC JMP))
1993 "jbc $genreg$dot$qlobit,$relhi"
1994 (+ OP1_10 OP2_10 genreg relhi qlobit (f-qhibit 0))
1995 (sequence ((HI tmp1) (HI tmp2))
1996 (set HI tmp1 genreg)
1997 (set HI tmp2 (const 1))
1998 (sll HI tmp2 qlobit)
1999 (set HI tmp2 (and tmp1 tmp2))
2000 (if (eq tmp2 (const 1))
2002 (if QI (lt QI relhi (const 0))
2003 (set tmp2 (const 1))
2005 ;; FIXME: (sll tmp2 qlobit)
2006 ;; FIXME: (inv tmp2)
2007 (set HI tmp1(and tmp1 tmp2))
2008 (set HI genreg tmp1)
2009 (set HI pc (add HI pc (mul QI relhi (const 2)))))
2011 (set HI pc (add HI pc (const 4)))
2016 ;relative jump if bit set
2018 (dni jnb "relative jump if bit not set"
2019 ((PIPE OS) (IDOC JMP))
2020 "jnb $genreg$dot$qlobit,$relhi"
2021 (+ OP1_9 OP2_10 genreg relhi qlobit (f-qhibit 0))
2022 (sequence ((HI tmp1) (HI tmp2))
2023 (set HI tmp1 genreg)
2024 (set HI tmp2 (const 1))
2025 (sll HI tmp2 qlobit)
2026 (set HI tmp2 (and tmp1 tmp2))
2027 (if (eq tmp2 (const 0))
2029 (if QI (lt QI relhi (const 0))
2030 (set HI pc (add HI pc (mul QI relhi (const 2)))))
2032 (set HI pc (add HI pc (const 4)))
2037 ;relative jump if bit not set and set bit
2038 ;JNBS bitaddrQ.q,rel
2039 (dni jnbs "relative jump if bit not set and set bit"
2040 ((PIPE OS) (IDOC JMP))
2041 "jnbs $genreg$dot$qlobit,$relhi"
2042 (+ OP1_11 OP2_10 genreg relhi qlobit (f-qhibit 0))
2043 (sequence ((HI tmp1) (HI tmp2))
2044 (set HI tmp1 genreg)
2045 (set HI tmp2 (const 1))
2046 (sll HI tmp2 qlobit)
2047 (set HI tmp2 (and tmp1 tmp2))
2048 (if (eq tmp2 (const 0))
2050 (if QI (lt QI relhi (const 0))
2051 (set tmp2 (const 1))
2053 ;; FIXME: (sll tmp2 qbit)
2054 (set BI tmp1(or tmp1 tmp2))
2056 (set HI pc (add HI pc (mul QI relhi (const 2)))))
2058 (set HI pc (add HI pc (const 4)))
2064 ;Absolute conditional call
2065 (define-pmacro (callabs name insn)
2067 (.str name "Absolute conditional call" )
2068 ((PIPE OS) (IDOC JMP))
2069 (.str insn " $extcond,$caddr")
2070 (+ OP1_12 OP2_10 extcond (f-op-2bit 0) bit01 caddr)
2072 (if (eq extcond (const 1))
2073 (set bit01 (const 0))
2074 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2075 (set HI (mem HI (reg h-cr 9)) pc)
2076 (set HI pc (mem HI caddr)))
2077 (if (ne extcond (const 1))
2078 (set bit01 (const 1))
2079 (set HI pc (add HI pc (const 2))))
2085 (callabs calla0 calla+)
2086 (callabs calla1 calla)
2089 (dni calla- "Absolute conditional call"
2090 (COND-CTI (PIPE OS) (IDOC JMP))
2091 "calla- $extcond,$caddr"
2092 (+ OP1_12 OP2_10 extcond (f-op-bit3 1) caddr)
2094 (if (eq extcond (const 1))
2095 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2096 (set HI (mem HI (reg h-cr 9)) pc)
2097 (set HI pc (mem HI caddr)))
2098 (set HI pc (add HI pc (const 2)))
2104 (dni calli "indirect subroutine call"
2105 (COND-CTI (PIPE OS) (IDOC JMP))
2106 "calli $icond,[$sr]"
2107 (+ OP1_10 OP2_11 icond sr)
2109 (if (eq icond (const 1))
2111 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2112 (set HI (mem HI (reg h-cr 9)) pc)
2113 (set HI pc (mem HI sr))
2116 (set HI pc (add HI pc (const 2)))
2122 (dni callr "Call subroutine with PC relative signed 8 bit offset"
2123 ( COND-CTI (PIPE OS) (IDOC JMP))
2125 (+ OP1_11 OP2_11 rel)
2127 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2128 (set HI (mem HI (reg h-cr 9)) pc)
2130 (if QI (lt QI rel (const 0))
2132 ;; FIXME: (neg QI rel)
2133 ;; FIXME: (add QI rel (const 1))
2134 ;; FIXME: (mul QI rel (const 2))
2135 (set HI pc (sub HI pc rel))
2137 (set HI pc (add HI pc (mul QI rel (const 2))))
2145 (dni callseg "call inter-segment subroutine"
2146 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2147 "calls $hash$segm$useg8,$hash$sof$usof16"
2148 (+ OP1_13 OP2_10 useg8 usof16)
2150 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2151 (set HI (mem HI (reg h-cr 9)) (reg h-cr 10))
2152 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2153 (set HI (mem HI (reg h-cr 9)) pc)
2154 (if QI (eq BI sgtdisbit (const BI 0))
2155 (set QI (reg h-cr 10) useg8))
2163 (dni calls "call inter-segment subroutine"
2164 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2166 (+ OP1_13 OP2_10 seg caddr)
2168 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2169 (set HI (mem HI (reg h-cr 9)) (reg h-cr 10))
2170 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2171 (set HI (mem HI (reg h-cr 9)) pc)
2172 (if QI (eq BI sgtdisbit (const BI 0))
2173 (set QI (reg h-cr 10) seg))
2181 (dni pcall "push word and call absolute subroutine"
2182 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2183 "pcall $reg8,$caddr"
2184 (+ OP1_14 OP2_2 reg8 caddr)
2185 (sequence ((HI tmp1))
2187 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2188 (set HI (mem HI (reg h-cr 9)) tmp1)
2189 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2190 (set HI (mem HI (reg h-cr 9)) pc)
2197 (dni trap "software trap"
2198 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2200 (+ OP1_9 OP2_11 uimm7 (f-op-1bit 0))
2202 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2203 (set HI (mem HI (reg h-cr 9)) (reg h-cr 4))
2204 (if QI (eq BI sgtdisbit (const BI 0))
2205 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2206 (set HI (mem HI (reg h-cr 9)) (reg h-cr 10) )
2209 (set HI (reg h-cr 10) (reg h-cr 11))
2210 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2211 (set HI (mem HI (reg h-cr 9)) pc)
2212 (set HI pc (mul QI uimm7 (const 4)))
2219 (dni ret "return from subroutine"
2220 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2222 (+ OP1_12 OP2_11 (f-op-bit8 0))
2224 (set HI pc (mem HI (reg h-cr 9)))
2225 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2231 (dni rets "return from inter-segment sunroutine"
2232 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2234 (+ OP1_13 OP2_11 (f-op-bit8 0))
2236 (set HI pc (mem HI (reg h-cr 9)))
2237 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2238 (if QI (eq BI sgtdisbit (const BI 0))
2239 (set HI (reg h-cr 10) (mem HI (reg h-cr 9)))
2242 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2248 (dni retp "return from subroutine and pop word register"
2249 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2251 (+ OP1_14 OP2_11 reg8)
2252 (sequence ((HI tmp1))
2253 (set HI pc (mem HI (reg h-cr 9)))
2254 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2255 (set HI tmp1 (mem HI (reg h-cr 9)))
2256 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2263 (dni reti "return from ISR"
2264 (UNCOND-CTI (PIPE OS) (IDOC JMP))
2266 (+ OP1_15 OP2_11 (f-op-lbit4 8) (f-op-bit4 8))
2268 (set HI pc (mem HI (reg h-cr 9)))
2269 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2270 (if QI (eq BI sgtdisbit (const BI 0))
2272 (set HI (reg h-cr 10) (mem HI (reg h-cr 9)))
2273 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2277 (set HI (reg h-cr 4) (mem HI (reg h-cr 9)))
2278 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2283 ;stack operation insn
2284 ;******************************************************************
2286 (dni pop "restore register from system stack"
2287 ((PIPE OS) (IDOC MISC))
2289 (+ OP1_15 OP2_12 reg8)
2290 (sequence ((HI tmp1))
2291 (set HI tmp1 (mem HI (reg h-cr 9)))
2292 (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2)))
2299 (dni push "save register on system stack"
2300 ((PIPE OS) (IDOC MISC))
2302 (+ OP1_14 OP2_12 reg8)
2303 (sequence ((HI tmp1))
2305 (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2)))
2306 (set HI (mem HI (reg h-cr 9)) tmp1)
2311 ;context switching insns
2313 (dni scxti "Push word register on stack and update same with immediate data"
2314 ((PIPE OS) (IDOC MISC))
2315 "scxt $reg8,$hash$uimm16"
2316 (+ OP1_12 OP2_6 reg8 uimm16)
2317 (sequence ((HI tmp1) (HI tmp2))
2319 (set HI tmp2 uimm16)
2320 ;; FIXME: (sub HI (reg HI h-cr 9) (const 2))
2321 (set HI (reg HI h-cr 9) tmp1)
2328 (dni scxtrpofm "mov memory to byte register"
2329 ((PIPE OS) (IDOC MOVE))
2330 "scxt $reg8,$pof$upof16"
2331 (+ OP1_13 OP2_6 reg8 upof16)
2332 (set QI reg8 (mem HI upof16))
2336 ; SCXT regmem8,memgr8
2337 (dni scxtmg "Push word register on stack and update same with direct memory"
2338 ((PIPE OS) (IDOC MISC))
2339 "scxt $regmem8,$memgr8"
2340 (+ OP1_13 OP2_6 regmem8 memgr8)
2341 (sequence ((HI tmp1) (HI tmp2))
2342 (set HI tmp1 regmem8)
2343 (set HI tmp2 memgr8)
2344 ;; FIXME: (sub HI (reg HI h-cr 9) (const 2))
2345 (set HI (reg HI h-cr 9) tmp1)
2346 (set HI regmem8 tmp2)
2352 (dni scxtm "Push word register on stack and update same with direct memory"
2353 ((PIPE OS) (IDOC MISC))
2354 "scxt $reg8,$memory"
2355 (+ OP1_13 OP2_6 reg8 memory)
2356 (sequence ((HI tmp1) (HI tmp2))
2358 (set HI tmp2 memory)
2359 ;; FIXME: (sub HI (reg HI h-cr 9) (const 2))
2360 (set HI (reg HI h-cr 9) tmp1)
2369 ((PIPE OS) (IDOC MISC))
2371 (+ OP1_12 OP2_12 (f-op-bit8 0))
2376 ;*********system control instructions *********************/
2378 (define-pmacro (sysctrl name insn opc1 opc2 op1 op2 op3)
2380 (.str name "miscellaneous" )
2381 ((PIPE OS) (IDOC MISC))
2383 (+ opc1 opc2 (f-op-lbit4 op1) (f-op-bit4 op2) (f-data8 op3) (f-op-bit8 op3))
2388 (sysctrl srstm srst OP1_11 OP2_7 4 8 183 )
2389 (sysctrl idlem idle OP1_8 OP2_7 7 8 135)
2390 (sysctrl pwrdnm pwrdn OP1_9 OP2_7 6 8 151)
2391 (sysctrl diswdtm diswdt OP1_10 OP2_5 5 10 165)
2392 (sysctrl enwdtm enwdt OP1_8 OP2_5 7 10 133)
2393 (sysctrl einitm einit OP1_11 OP2_5 4 10 181)
2394 (sysctrl srvwdtm srvwdt OP1_10 OP2_7 5 8 167 )
2399 ((PIPE OS) (IDOC MISC))
2401 (+ OP1_8 OP2_12 (f-op-bit8 0))
2408 (dni atomic "begin atomic sequence"
2409 ((PIPE OS) (IDOC SYSC))
2410 "atomic $hash$uimm2"
2411 (+ OP1_13 OP2_1 (f-op-lbit2 0) uimm2 (f-op-bit4 0))
2412 (sequence ((HI count))
2413 (set HI count uimm2)
2415 ((ne HI count (const 0))
2417 (set HI pc (add HI pc (const 2)))
2418 (set HI count (sub HI count (const 1)))
2421 (set HI count (const 0))
2426 ;extended register sequence
2428 (dni extr "begin extended register sequence"
2429 ((PIPE OS) (IDOC SYSC))
2431 (+ OP1_13 OP2_1 (f-op-lbit2 2) uimm2 (f-op-bit4 0))
2432 (sequence ((HI count))
2433 (set HI count uimm2)
2435 ((ne HI count (const 0))
2437 (set HI pc (add HI pc (const 2)))
2438 (set HI count (sub HI count (const 1)))
2441 (set HI count (const 0))
2446 ;extended page sequence
2448 (dni extp "begin extended page sequence"
2449 ((PIPE OS) (IDOC SYSC))
2450 "extp $sr,$hash$uimm2"
2451 (+ OP1_13 OP2_12 (f-op-lbit2 1) uimm2 sr)
2452 (sequence ((HI count))
2453 (set HI count uimm2)
2455 ((ne HI count (const 0))
2457 (set HI pc (add HI pc (const 2)))
2458 (set HI count (sub HI count (const 1)))
2461 (set HI count (const 0))
2466 ;extended page sequence
2467 ; EXTP #pag10,#irang2
2468 (dni extp1 "begin extended page sequence"
2469 ((PIPE OS) (IDOC SYSC))
2470 "extp $hash$pagenum,$hash$uimm2"
2471 (+ OP1_13 OP2_7 (f-op-lbit2 1) uimm2 (f-op-bit4 0) pagenum (f-qlobit 0) (f-qlobit2 0))
2472 (sequence ((HI count))
2473 (set HI count uimm2)
2475 ((ne HI count (const 0))
2477 (set HI pc (add HI pc (const 2)))
2478 (set HI count (sub HI count (const 1)))
2481 (set HI count (const 0))
2486 ; EXTP #pag10,#irang2
2487 (dni extpg1 "begin extended page sequence"
2488 ((PIPE OS) (IDOC SYSC))
2489 "extp $hash$pag$upag16,$hash$uimm2"
2490 (+ OP1_13 OP2_7 (f-op-lbit2 1) uimm2 (f-op-bit4 0) upag16 )
2491 (sequence ((HI count))
2492 (set HI count uimm2)
2494 ((ne HI count (const 0))
2496 (set HI pc (add HI pc (const 2)))
2497 (set HI count (sub HI count (const 1)))
2500 (set HI count (const 0))
2505 ;extended page and register sequence
2507 (dni extpr "begin extended page and register sequence"
2508 ((PIPE OS) (IDOC SYSC))
2509 "extpr $sr,$hash$uimm2"
2510 (+ OP1_13 OP2_12 (f-op-lbit2 3) uimm2 sr)
2511 (sequence ((HI count))
2512 (set HI count uimm2)
2514 ((ne HI count (const 0))
2516 (set HI pc (add HI pc (const 2)))
2517 (set HI count (sub HI count (const 1)))
2520 (set HI count (const 0))
2525 ;extended page and register sequence
2526 ; EXTPR #pag10,#irang2
2527 (dni extpr1 "begin extended page sequence"
2528 ((PIPE OS) (IDOC SYSC))
2529 "extpr $hash$pagenum,$hash$uimm2"
2530 (+ OP1_13 OP2_7 (f-op-lbit2 3) uimm2 (f-op-bit4 0) pagenum (f-qlobit 0) (f-qlobit2 0))
2531 (sequence ((HI count))
2532 (set HI count uimm2)
2534 ((ne HI count (const 0))
2536 (set HI pc (add HI pc (const 2)))
2537 (set HI count (sub HI count (const 1)))
2540 (set HI count (const 0))
2545 ;extended segment sequence
2547 (dni exts "begin extended segment sequence"
2548 ((PIPE OS) (IDOC SYSC))
2549 "exts $sr,$hash$uimm2"
2550 (+ OP1_13 OP2_12 (f-op-lbit2 0) uimm2 sr)
2551 (sequence ((HI count))
2552 (set HI count uimm2)
2554 ((ne HI count (const 0))
2556 (set HI pc (add HI pc (const 2)))
2557 (set HI count (sub HI count (const 1)))
2560 (set HI count (const 0))
2565 ;extended segment sequence
2566 ; EXTS #seg8,#irang2
2567 (dni exts1 "begin extended segment sequence"
2568 ((PIPE OS) (IDOC SYSC))
2569 "exts $hash$seghi8,$hash$uimm2"
2570 (+ OP1_13 OP2_7 (f-op-lbit2 0) uimm2 (f-op-bit4 0) seghi8 (f-op-bit8 0))
2571 (sequence ((HI count))
2572 (set HI count uimm2)
2574 ((ne HI count (const 0))
2576 (set HI pc (add HI pc (const 2)))
2577 (set HI count (sub HI count (const 1)))
2580 (set HI count (const 0))
2585 ;extended segment register sequence
2587 (dni extsr "begin extended segment and register sequence"
2588 ((PIPE OS) (IDOC SYSC))
2589 "extsr $sr,$hash$uimm2"
2590 (+ OP1_13 OP2_12 (f-op-lbit2 2) uimm2 sr)
2591 (sequence ((HI count))
2592 (set HI count uimm2)
2594 ((ne HI count (const 0))
2596 (set HI pc (add HI pc (const 2)))
2597 (set HI count (sub HI count (const 1)))
2600 (set HI count (const 0))
2605 ;extended segment register sequence
2606 ; EXTSR #pag10,#irang2
2607 (dni extsr1 "begin extended segment and register sequence"
2608 ((PIPE OS) (IDOC SYSC))
2609 "extsr $hash$seghi8,$hash$uimm2"
2610 (+ OP1_13 OP2_7 (f-op-lbit2 2) uimm2 (f-op-bit4 0) seghi8 (f-op-bit8 0))
2611 (sequence ((HI count))
2612 (set HI count uimm2)
2614 ((ne HI count (const 0))
2616 (set HI pc (add HI pc (const 2)))
2617 (set HI count (sub HI count (const 1)))
2620 (set HI count (const 0))
2625 ;prioritize register
2627 (dni prior "add registers"
2628 ((PIPE OS) (IDOC ALU))
2630 (+ OP1_2 OP2_11 dr sr)
2631 (sequence ((HI count) (HI tmp1) (HI tmp2))
2632 (set HI count (const 0))
2634 (set HI tmp2 (and tmp1 (const 32768)))
2636 ((ne HI tmp2 (const 1)) (ne HI sr (const 0))
2637 (sll HI tmp1 (const 1))
2638 (set HI tmp2 (and tmp1 (const 32768)))
2639 (set HI count (add HI count (const 1)))
2649 ;******************************************************************
2651 (define-pmacro (bclear name insn opc1)
2653 (.str name "bit clear" )
2654 ((PIPE OS) (IDOC ALU))
2655 (.str insn " $reg8$dot$qbit")
2656 (+ opc1 OP2_14 reg8)
2657 (sequence ((HI tmp1) (HI tmp2))
2658 (set tmp2 (const 1))
2660 ;; FIXME: (sll tmp2 qbit)
2661 ;; FIXME: (inv tmp2)
2662 (set BI tmp1(and tmp1 tmp2))
2669 (dni bclr18 "bit logical MOVN"
2670 ((PIPE OS) (IDOC ALU))
2672 (+ OP1_11 OP2_14 RegNam)
2673 (sequence ((HI tmp1) (HI tmp2))
2674 (set tmp2 (const 1))
2676 ;; FIXME: (sll tmp2 qbit)
2677 ;; FIXME: (inv tmp2)
2678 (set BI tmp1(and tmp1 tmp2))
2684 (bclear bclr0 bclr QBIT_0 )
2685 (bclear bclr1 bclr QBIT_1 )
2686 (bclear bclr2 bclr QBIT_2 )
2687 (bclear bclr3 bclr QBIT_3 )
2688 (bclear bclr4 bclr QBIT_4 )
2689 (bclear bclr5 bclr QBIT_5 )
2690 (bclear bclr6 bclr QBIT_6 )
2691 (bclear bclr7 bclr QBIT_7 )
2692 (bclear bclr8 bclr QBIT_8 )
2693 (bclear bclr9 bclr QBIT_9 )
2694 (bclear bclr10 bclr QBIT_10 )
2695 (bclear bclr11 bclr QBIT_11 )
2696 (bclear bclr12 bclr QBIT_12 )
2697 (bclear bclr13 bclr QBIT_13 )
2698 (bclear bclr14 bclr QBIT_14 )
2699 (bclear bclr15 bclr QBIT_15 )
2702 (dni bset19 "bit logical MOVN"
2703 ((PIPE OS) (IDOC ALU))
2705 (+ OP1_11 OP2_15 RegNam)
2706 (sequence ((HI tmp1) (HI tmp2))
2707 (set tmp2 (const 1))
2709 ;; FIXME: (sll tmp2 qbit)
2710 (set BI tmp1(or tmp1 tmp2))
2716 (define-pmacro (bitset name insn opc1)
2718 (.str name "bit set" )
2719 ((PIPE OS) (IDOC ALU))
2720 (.str insn " $reg8$dot$qbit")
2721 (+ opc1 OP2_15 reg8)
2722 (sequence ((HI tmp1) (HI tmp2))
2723 (set tmp2 (const 1))
2725 ;; FIXME: (sll tmp2 qbit)
2726 (set BI tmp1(or tmp1 tmp2))
2733 (bitset bset0 bset QBIT_0 )
2734 (bitset bset1 bset QBIT_1 )
2735 (bitset bset2 bset QBIT_2 )
2736 (bitset bset3 bset QBIT_3 )
2737 (bitset bset4 bset QBIT_4 )
2738 (bitset bset5 bset QBIT_5 )
2739 (bitset bset6 bset QBIT_6 )
2740 (bitset bset7 bset QBIT_7 )
2741 (bitset bset8 bset QBIT_8 )
2742 (bitset bset9 bset QBIT_9 )
2743 (bitset bset10 bset QBIT_10 )
2744 (bitset bset11 bset QBIT_11 )
2745 (bitset bset12 bset QBIT_12 )
2746 (bitset bset13 bset QBIT_13 )
2747 (bitset bset14 bset QBIT_14 )
2748 (bitset bset15 bset QBIT_15 )
2751 ;BMOV bitaddrZ.z,bitaddrQ.q
2752 (dni bmov "bit logical MOV"
2753 ((PIPE OS) (IDOC ALU))
2754 "bmov $reghi8$dot$qhibit,$reg8$dot$qlobit"
2755 (+ OP1_4 OP2_10 reg8 reghi8 qhibit qlobit)
2756 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2757 (set HI tmp1 reghi8)
2759 (set tmp3 (const 1))
2760 (set tmp4 (const 1))
2761 ;; FIXME: (sll tmp3 qlobit)
2762 ;; FIXME: (sll tmp4 qhibit)
2763 ;; FIXME: (and tmp1 tmp3)
2764 ;; FIXME: (and tmp2 tmp4)
2766 (set HI reghi8 tmp1)
2772 ;BMOVN bitaddrZ.z,bitaddrQ.q
2773 (dni bmovn "bit logical MOVN"
2774 ((PIPE OS) (IDOC ALU))
2775 "bmovn $reghi8$dot$qhibit,$reg8$dot$qlobit"
2776 (+ OP1_3 OP2_10 reg8 reghi8 qhibit qlobit)
2777 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2778 (set HI tmp1 reghi8)
2780 (set tmp3 (const 1))
2781 (set tmp4 (const 1))
2782 ;; FIXME: (sll tmp3 qlobit)
2783 ;; FIXME: (sll tmp4 qhibit)
2784 ;; FIXME: (and tmp1 tmp3)
2785 ;; FIXME: (and tmp2 tmp4)
2786 ;; FIXME: (inv HI tmp2)
2788 (set HI reghi8 tmp1)
2794 ;BAND bitaddrZ.z,bitaddrQ.q
2795 (dni band "bit logical AND"
2796 ((PIPE OS) (IDOC ALU))
2797 "band $reghi8$dot$qhibit,$reg8$dot$qlobit"
2798 (+ OP1_6 OP2_10 reg8 reghi8 qhibit qlobit)
2799 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2800 (set HI tmp1 reghi8)
2802 (set tmp3 (const 1))
2803 (set tmp4 (const 1))
2804 ;; FIXME: (sll tmp3 qlobit)
2805 ;; FIXME: (sll tmp4 qhibit)
2806 ;; FIXME: (and tmp1 tmp3)
2807 ;; FIXME: (and tmp2 tmp4)
2808 (set BI tmp1(and tmp1 tmp2))
2809 (set HI reghi8 tmp1)
2815 ;BOR bitaddrZ.z,bitaddrQ.q
2816 (dni bor "bit logical OR"
2817 ((PIPE OS) (IDOC ALU))
2818 "bor $reghi8$dot$qhibit,$reg8$dot$qlobit"
2819 (+ OP1_5 OP2_10 reg8 reghi8 qhibit qlobit)
2820 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2821 (set HI tmp1 reghi8)
2823 (set tmp3 (const 1))
2824 (set tmp4 (const 1))
2825 ;; FIXME: (sll tmp3 qlobit)
2826 ;; FIXME: (sll tmp4 qhibit)
2827 ;; FIXME: (and tmp1 tmp3)
2828 ;; FIXME: (and tmp2 tmp4)
2829 (set BI tmp1(or tmp1 tmp2))
2830 (set HI reghi8 tmp1)
2836 ;BXOR bitaddrZ.z,bitaddrQ.q
2837 (dni bxor "bit logical XOR"
2838 ((PIPE OS) (IDOC ALU))
2839 "bxor $reghi8$dot$qhibit,$reg8$dot$qlobit"
2840 (+ OP1_7 OP2_10 reg8 reghi8 qhibit qlobit)
2841 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2842 (set HI tmp1 reghi8)
2844 (set tmp3 (const 1))
2845 (set tmp4 (const 1))
2846 ;; FIXME: (sll tmp3 qlobit)
2847 ;; FIXME: (sll tmp4 qhibit)
2848 ;; FIXME: (and tmp1 tmp3)
2849 ;; FIXME: (and tmp2 tmp4)
2850 (set BI tmp1(xor tmp1 tmp2))
2851 (set HI reghi8 tmp1)
2856 ;cmp direct bit to bit
2857 ;BCMP bitaddrZ.z,bitaddrQ.q
2858 (dni bcmp "bit to bit compare"
2859 ((PIPE OS) (IDOC ALU))
2860 "bcmp $reghi8$dot$qhibit,$reg8$dot$qlobit"
2861 (+ OP1_2 OP2_10 reg8 reghi8 qhibit qlobit)
2862 (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4))
2863 (set HI tmp1 reghi8)
2865 (set tmp3 (const 1))
2866 (set tmp4 (const 1))
2867 ;; FIXME: (sll tmp3 qlobit)
2868 ;; FIXME: (sll tmp4 qhibit)
2869 ;; FIXME: (and tmp1 tmp3)
2870 ;; FIXME: (and tmp2 tmp4)
2871 (set BI tmp1(xor tmp1 tmp2))
2872 (set HI reghi8 tmp1)
2879 (dni bfldl "bit field low byte"
2880 ((PIPE OS) (IDOC MOVE))
2881 "bfldl $reg8,$hash$mask8,$hash$datahi8"
2882 (+ OP1_0 OP2_10 reg8 mask8 datahi8)
2883 (sequence ((HI tmp1) (QI tmp2) (QI tmp3))
2886 (set QI tmp3 datahi8)
2887 ;; FIXME: (inv QI tmp2)
2888 (set HI tmp1 (and tmp1 tmp2))
2889 (set HI tmp1 (or tmp1 tmp3))
2895 ;bit field high byte
2897 (dni bfldh "bit field high byte"
2898 ((PIPE OS) (IDOC MOVE))
2899 "bfldh $reg8,$hash$masklo8,$hash$data8"
2900 (+ OP1_1 OP2_10 reg8 masklo8 data8)
2901 (sequence ((HI tmp1) (HI tmp2) (HI tmp3))
2903 (set QI tmp2 masklo8)
2905 ;; FIXME: (sll tmp2 (const 8))
2906 ;; FIXME: (inv HI tmp2)
2907 ;; FIXME: (sll tmp3 (const 8))
2908 (set HI tmp1 (and tmp1 tmp2))
2909 (set HI tmp1 (or tmp1 tmp3))
2915 ;/**********compare instructions******************
2919 (dni cmpr "compare two registers"
2920 ((PIPE OS) (IDOC CMP))
2922 (+ OP1_4 OP2_0 src1 src2)
2923 (set condbit (lt HI src1 src2))
2927 ;Compare byte register
2929 (dni cmpbr "compare two byte registers"
2930 ((PIPE OS) (IDOC CMP))
2932 (+ OP1_4 OP2_1 drb srb)
2933 (set condbit (lt QI drb srb))
2937 (define-pmacro (cmp1 name insn opc1 opc2 op1 op2 mode)
2939 (.str name "compare" )
2940 ((PIPE OS) (IDOC CMP))
2941 (.str insn " $"op1 ",$hash$"op2)
2942 (+ opc1 opc2 op1 (f-op-bit1 0) op2)
2943 (set condbit (lt mode op1 op2))
2947 (cmp1 cmpri cmp OP1_4 OP2_8 src1 uimm3 HI)
2948 (cmp1 cmpbri cmpb OP1_4 OP2_9 drb uimm3 QI)
2952 ((PIPE OS) (IDOC CMP))
2953 "cmp $reg8,$hash$uimm16"
2954 (+ OP1_4 OP2_6 reg8 uimm16)
2955 (set condbit (lt HI reg8 uimm16))
2960 (dni cmpbi "compare"
2961 ((PIPE OS) (IDOC CMP))
2962 "cmpb $regb8,$hash$uimm8"
2963 (+ OP1_4 OP2_7 regb8 uimm8 (f-op-bit8 0))
2964 (set condbit (lt QI regb8 uimm8))
2968 ;compare reg and indirect memory
2969 (define-pmacro (cmp2 name insn opc1 opc2 op1 op2 mode)
2971 (.str name "compare" )
2972 ((PIPE OS) (IDOC CMP))
2973 (.str insn " $"op1 ",[$"op2"]")
2974 (+ opc1 opc2 op1 (f-op-bit2 2) op2)
2975 (set condbit (lt mode op1 op2))
2979 (cmp2 cmpr2 cmp OP1_4 OP2_8 dr sr2 HI)
2980 (cmp2 cmpbr2 cmpb OP1_4 OP2_9 drb sr2 QI)
2982 ;compare register and indirect memory post increment
2983 (define-pmacro (cmp3 name insn opc1 opc2 op1 op2 mode)
2985 (.str name "compare" )
2986 ((PIPE OS) (IDOC CMP))
2987 (.str insn " $"op1 ",[$"op2"+]")
2988 (+ opc1 opc2 op1 (f-op-bit2 3) op2)
2990 (set condbit (lt mode op1 op2))
2991 (set HI op2 (add HI op2 (const 2)))
2996 (cmp3 cmp2i cmp OP1_4 OP2_8 dr sr2 HI)
2997 (cmp3 cmpb2i cmpb OP1_4 OP2_9 drb sr2 QI)
2999 ;compare register and direct memory
3000 (define-pmacro (cmp4 name insn opc1 opc2 op1 op2 mode)
3002 (.str name "compare" )
3003 ((PIPE OS) (IDOC CMP))
3004 (.str insn " $"op1 ",$pof$"op2)
3005 (+ opc1 opc2 op1 op2)
3006 (set condbit (lt HI op1 (mem HI op2)))
3010 (cmp4 cmp04 cmp OP1_4 OP2_2 reg8 upof16 HI)
3011 (cmp4 cmpb4 cmpb OP1_4 OP2_3 regb8 upof16 QI)
3013 ;compare register and direct memory
3014 (define-pmacro (cmp4 name insn opc1 opc2 op1 op2 mode)
3016 (.str name "compare" )
3017 ((PIPE OS) (IDOC CMP))
3018 (.str insn " $"op1 ",$"op2)
3019 (+ opc1 opc2 op1 op2)
3020 (set condbit (lt HI op1 (mem HI op2)))
3024 (cmp4 cmp004 cmp OP1_4 OP2_2 regmem8 memgr8 HI)
3025 (cmp4 cmp0004 cmp OP1_4 OP2_2 reg8 memory HI)
3026 (cmp4 cmpb04 cmpb OP1_4 OP2_3 regbmem8 memgr8 QI)
3027 (cmp4 cmpb004 cmpb OP1_4 OP2_3 regb8 memory QI)
3029 ;compare register and immediate
3030 (define-pmacro (cmp5 name insn opc1 opc2 op1 op2 mode)
3032 (.str name "compare" )
3033 ((PIPE OS) (IDOC CMP))
3034 (.str insn " $"op1 ",$hash$"op2)
3035 (+ opc1 opc2 op2 op1)
3037 (set condbit (lt HI op1 op2))
3038 (set mode op1 (sub HI op1 (const 1)))
3043 (cmp5 cmpd1ri cmpd1 OP1_10 OP2_0 sr uimm4 HI)
3044 (cmp5 cmpd2ri cmpd2 OP1_11 OP2_0 sr uimm4 HI)
3045 (cmp5 cmpi1ri cmpi1 OP1_8 OP2_0 sr uimm4 HI)
3046 (cmp5 cmpi2ri cmpi2 OP1_9 OP2_0 sr uimm4 HI)
3047 (cmp5 cmpd1rim cmpd1 OP1_10 OP2_6 reg8 uimm16 HI)
3048 (cmp5 cmpd2rim cmpd2 OP1_11 OP2_6 reg8 uimm16 HI)
3049 (cmp5 cmpi1rim cmpi1 OP1_8 OP2_6 reg8 uimm16 HI)
3050 (cmp5 cmpi2rim cmpi2 OP1_9 OP2_6 reg8 uimm16 HI)
3052 ;compare register and direct memory
3053 (define-pmacro (cmp6 name insn opc1 opc2 op1 op2 mode )
3055 (.str name "compare" )
3056 ((PIPE OS) (IDOC CMP))
3057 (.str insn " $"op1 ",$pof$"op2)
3058 (+ opc1 opc2 op1 op2)
3060 (set condbit (lt HI op1 (mem HI op2)))
3061 (set mode op1 (sub HI op1 (const 1)))
3066 (cmp6 cmpd1rp cmpd1 OP1_10 OP2_2 reg8 upof16 HI )
3067 (cmp6 cmpd2rp cmpd2 OP1_11 OP2_2 reg8 upof16 HI )
3068 (cmp6 cmpi1rp cmpi1 OP1_8 OP2_2 reg8 upof16 HI )
3069 (cmp6 cmpi2rp cmpi2 OP1_9 OP2_2 reg8 upof16 HI )
3071 ;compare register and direct memory
3072 (define-pmacro (cmp7 name insn opc1 opc2 op1 op2 mode)
3074 (.str name "compare" )
3075 ((PIPE OS) (IDOC CMP))
3076 (.str insn " $"op1 ",$"op2)
3077 (+ opc1 opc2 op1 op2)
3079 (set condbit (lt HI op1 (mem HI op2)))
3080 (set mode op1 (sub HI op1 (const 1)))
3085 (cmp7 cmpd1rm cmpd1 OP1_10 OP2_2 regmem8 memgr8 HI)
3086 (cmp7 cmpd2rm cmpd2 OP1_11 OP2_2 regmem8 memgr8 HI)
3087 (cmp7 cmpi1rm cmpi1 OP1_8 OP2_2 regmem8 memgr8 HI)
3088 (cmp7 cmpi2rm cmpi2 OP1_9 OP2_2 regmem8 memgr8 HI)
3089 (cmp7 cmpd1rmi cmpd1 OP1_10 OP2_2 reg8 memory HI)
3090 (cmp7 cmpd2rmi cmpd2 OP1_11 OP2_2 reg8 memory HI)
3091 (cmp7 cmpi1rmi cmpi1 OP1_8 OP2_2 reg8 memory HI)
3092 (cmp7 cmpi2rmi cmpi2 OP1_9 OP2_2 reg8 memory HI)
3095 ;Shift and rotate insns
3096 ;****************************************************************
3097 (define-pmacro (shift name insn insn1 opc1 opc2 op1 op2 mode)
3099 (.str name "shift" )
3100 ((PIPE OS) (IDOC ALU))
3101 (.str insn " $"op1 ",$"op2)
3102 (+ opc1 opc2 op1 op2)
3103 (set mode op1 (insn1 mode op1 op2))
3107 (shift shlr shl sll OP1_4 OP2_12 dr sr HI)
3108 (shift shrr shr srl OP1_6 OP2_12 dr sr HI)
3109 (shift rolr rol rol OP1_0 OP2_12 dr sr HI)
3110 (shift rorr ror ror OP1_2 OP2_12 dr sr HI)
3111 (shift ashrr ashr sra OP1_10 OP2_12 dr sr HI)
3113 (define-pmacro (shift1 name insn insn1 opc1 opc2 op1 op2 mode)
3115 (.str name "shift" )
3116 ((PIPE OS) (IDOC ALU))
3117 (.str insn " $"op1 ",$hash$"op2)
3118 (+ opc1 opc2 op2 op1)
3119 (set mode op1 (insn1 mode op1 op2))
3123 (shift1 shlri shl sll OP1_5 OP2_12 sr uimm4 HI)
3124 (shift1 shrri shr srl OP1_7 OP2_12 sr uimm4 HI)
3125 (shift1 rolri rol rol OP1_1 OP2_12 sr uimm4 HI)
3126 (shift1 rorri ror ror OP1_3 OP2_12 sr uimm4 HI)
3127 (shift1 ashrri ashr sra OP1_11 OP2_12 sr uimm4 HI)