OSDN Git Service

2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com>
[pf3gnuchains/pf3gnuchains3x.git] / cgen / ia64.cpu
1 ;;; Intel IA-64 CPU description.  -*- Scheme -*-
2 ;;; Copyright (C) 2000 Red Hat, Inc.
3 ;;; This file is part of CGEN.
4 ;;; See file COPYING.CGEN for details.
5
6 (include "simplify.inc")
7
8 \f
9 ;;; Architecture and cpu family definitions.
10
11 (define-arch
12   (name ia64)
13   (comment "Intel IA-64 architecture")
14   (insn-lsb0? #t)
15   (machs ia64)
16   (isas ia64)
17 )
18
19 (define-isa
20   (name ia64)
21
22   ;; Each instruction in the 128-bit bundle is 41 bits wide.
23   (base-insn-bitsize 41)
24
25   ;; Each bundle is 3 insns wide.
26   (liw-insns 3)
27
28   ;; ??? How to specify "lots", as that's what the architecture's
29   ;; stop bits means;
30   (parallel-insns 3)
31
32   ;; Initial bit numbers to decode by.
33   (decode-assist (40 39 38 37))
34 )
35
36 (define-cpu
37   (name ia64)
38   (comment "Intel IA-64 family")
39   (insn-endian little)
40   (data-endian either)
41   (word-bitsize 64)
42 )
43
44 (eval
45  (begin
46    ;; We need 64-bit host support.
47    (set! INT (mode:add! 'INT (mode:lookup 'DI)))
48    (set! UINT (mode:add! 'UINT (mode:lookup 'UDI)))
49
50    ;; ??? This shouldn't be necessary, IMO.
51    (set! WI (mode:add! 'WI (mode:lookup 'DI)))
52    (set! UWI (mode:add! 'UWI (mode:lookup 'UDI)))
53    (set! AI (mode:add! 'AI (mode:lookup 'UDI)))
54    (set! IAI (mode:add! 'IAI (mode:lookup 'UDI)))
55    )
56 )
57
58 \f
59 (define-mach
60   (name ia64)
61   (comment "Intel IA-64 processors")
62   (cpu ia64)
63 )
64
65 ; ??? Incomplete.  Pipeline and unit info wrong.
66
67 (define-model
68   (name ia64_itanium)
69   (comment "Intel Itanium processor")
70   (mach ia64)
71   (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
72   (unit u-exec "Execution Unit" () 1 1
73         () () () ())
74 )
75 \f
76 ;;; Attributes. 
77 ;;;
78 ;;; These are used to mark instructions so that we can decode the
79 ;;; dependancy violation data in Intel's tables.
80
81 (define-attr
82   (name FORMAT)
83   (for insn)
84   (type enum)
85   (attrs META)
86   (values UNKNOWN
87
88           A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
89
90           I1  I2  I3  I4  I5  I6  I7  I8  I9  I10
91           I11 I12 I13 I14 I15 I16 I17 I18 I19 I20
92           I21 I22 I23 I24 I25 I26 I27 I28 I29
93
94           M1  M2  M3  M4  M5  M6  M7  M8  M9  M10
95           M11 M12 M13 M14 M15 M16 M17 M18 M19 M20
96           M21 M22 M23 M24 M25 M26 M27 M28 M29 M30
97           M31 M32 M33 M34 M35 M36 M37 M38 M39 M40
98           M41 M42 M43 M44 M45 M46
99
100           B1 B2 B3 B4 B5 B6 B7 B8 B9
101
102           F1  F2  F3  F4  F5  F6  F7  F8  F9  F10
103           F11 F12 F13 F14 F15
104           )
105   (default UNKNOWN)
106 )
107
108 ;; ??? NONE isn't a valid value, but non-FP insns obviously can't have
109 ;; a valid value either.
110 (define-attr
111   (name FIELD-SF)
112   (for insn)
113   (type enum)
114   (attrs META)
115   (values NONE s0 s1 s2 s3)
116   (default NONE)
117 )
118
119 (define-attr
120   (name FIELD-LFTYPE)
121   (for insn)
122   (type enum)
123   (attrs META)
124   (values NONE fault)
125   (default NONE)
126 )
127
128 (define-attr
129   (name FIELD-CTYPE)
130   (for insn)
131   (type enum)
132   (attrs META)
133   (values NONE unc or and or.andcm orcm andcm and.orcm)
134   (default NONE)
135 )
136
137 ;; Field AR3 references a register field.
138 ;; Field CR3 references a register field.
139 ;; Field ireg references a register field.
140
141 ;;; ??? IA-64 specific instruction attributes:
142 ;;;
143 ;;; FIRST       Must be at the beginning of an instruction group.
144 ;;; SLOT2       Must be in slot 2 on a bundle.
145 ;;; LAST        Must be at the end of an instruction group.
146 ;;; I_IN_MLI    Insn is allowed in I slot of MLI.
147 ;;; PRIV        Privileged instruction.
148 ;;; NO_PRED     Insn cannot be predicated.
149
150 \f
151 ;;; Instruction fields.
152 ;;;
153 ;;; ??? This is confusing (at least to me) -- note that we specify the _top_
154 ;;; of the field and a length.
155 ;;;
156 ;;; ??? There are only two fields used nearly universally.  But the
157 ;;; instruction formats are very regular in the sense that the same 
158 ;;; field specifications are re-used many times.  So we just have the 
159 ;;; raw fields here first.
160
161 ;; Fields used by most instructions.
162 (dnf f-opcode   "major opcode"          () 40 4)
163 (dnf f-qp       "qualifying predicate"  ()  5 6)
164
165 ;; Random parts used by the 109 (!) instruction formats.
166 (dnf f-36-6     "6 @ 36"                () 36 6)
167 (df f-36-1s     "1 @ 36, signed"        () 36 1 INT #f #f)
168 (dnf f-36-1     "1 @ 36"                () 36 1)
169 (dnf f-35-9     "9 @ 35"                () 35 9)
170 (dnf f-35-6     "6 @ 35"                () 35 6)
171 (dnf f-35-3     "3 @ 35"                () 35 3)
172 (dnf f-35-2     "2 @ 35"                () 35 2)
173 (dnf f-35-1     "1 @ 35"                () 35 1)
174 (dnf f-34-2     "2 @ 34"                () 34 2)
175 (dnf f-33-1     "1 @ 33"                () 33 1)
176 (dnf f-32-27    "27 @ 32"               () 32 27)
177 (dnf f-32-20    "20 @ 32"               () 32 20)
178 (dnf f-32-13    "13 @ 32"               () 32 13)
179 (dnf f-32-9     "9 @ 32"                () 32 9)
180 (dnf f-32-6     "6 @ 32"                () 32 6)
181 (dnf f-32-4     "4 @ 32"                () 32 4)
182 (dnf f-32-2     "2 @ 32"                () 32 2)
183 (dnf f-32-1     "1 @ 32"                () 32 1)
184 (dnf f-31-8     "8 @ 31"                () 31 8)
185 (dnf f-31-2     "2 @ 31"                () 31 2)
186 (dnf f-30-4     "4 @ 30"                () 30 4)
187 (dnf f-30-19    "19 @ 30"               () 30 19)
188 (dnf f-29-2     "2 @ 29"                () 29 2)
189 (dnf f-28-2     "2 @ 28"                () 28 2)
190 (dnf f-27-8     "8 @ 27"                () 27 8)
191 (dnf f-27-4     "4 @ 27"                () 27 4)
192 (dnf f-27-3     "3 @ 27"                () 27 3)
193 (dnf f-27-1     "1 @ 27"                () 27 1)
194 (dnf f-26-21    "21 @ 26"               () 26 21)
195 (dnf f-26-11    "11 @ 26"               () 26 11)
196 (dnf f-26-7     "7 @ 26"                () 26 7)
197 (dnf f-26-5     "5 @ 26"                () 26 5)
198 (dnf f-26-1     "1 @ 26"                () 26 1)
199 (dnf f-25-20    "20 @ 25"               () 25 20)
200 (dnf f-25-6     "6 @ 25"                () 25 6)
201 (dnf f-24-5     "5 @ 24"                () 24 5)
202 (dnf f-23-4     "4 @ 23"                () 23 4)
203 (dnf f-23-1     "1 @ 23"                () 23 1)
204 (dnf f-22-1     "1 @ 22"                () 22 1)
205 (dnf f-21-2     "2 @ 21"                () 21 2)
206 (dnf f-21-1     "1 @ 21"                () 21 1)
207 (dnf f-20-1     "1 @ 20"                () 20 1)
208 (dnf f-19-7     "7 @ 19"                () 19 7)
209 (dnf f-19-6     "6 @ 19"                () 19 6)
210 (dnf f-19-4     "4 @ 19"                () 19 4)
211 (dnf f-19-1     "1 @ 19"                () 19 1)
212 (dnf f-18-5     "5 @ 18"                () 18 5)
213 (dnf f-15-3     "3 @ 15"                () 15 3)
214 (dnf f-15-1     "1 @ 15"                () 15 1)
215 (dnf f-14-2     "2 @ 14"                () 14 2)
216 (dnf f-13-1     "1 @ 13"                () 13 1)
217 (dnf f-12-7     "7 @ 12"                () 12 7)
218 (dnf f-12-1     "1 @ 12"                () 12 1)
219 (dnf f-11-6     "6 @ 11"                () 11 6)
220 (dnf f-11-3     "3 @ 11"                () 11 3)
221 (dnf f-8-3      "3 @ 8"                 ()  8 3)
222
223 ;; The extra field for movl
224 (dnf f-81-41    "41 @ 81"               () 81 41)
225
226 ;; Virtual fields of the broken up constants.
227 (dnmf fv-sint8  "i8 for A3 A8 I27 M30" 
228       () INT
229
230       (f-36-1s f-19-7)
231       (sequence ()                      ; insert
232                 (set (ifield f-36-1s) (srl (ifield fv-sint8) (const 7)))
233                 (set (ifield f-19-7) (and (ifield fv-sint8) (const #x7f)))
234                 )
235       (sequence ()                      ; extract
236                 (set (ifield fv-sint8)
237                      (or (sll (ifield f-36-1s) (const 7))
238                          (ifield f-19-7)))
239                 )
240 )
241
242 (dnmf fv-sint9a "i9 for M3 M8 M15"
243       () INT
244       (f-36-1s f-27-1 f-19-7)
245       (sequence ()                      ; insert
246                 (set (ifield f-36-1s) (srl (ifield fv-sint9a) (const 8)))
247                 (set (ifield f-27-1)
248                      (and (srl (ifield fv-sint9a) (const 7)) (const 1)))
249                 (set (ifield f-19-7) (and (ifield fv-sint9a) (const #x7f)))
250                 )
251       (sequence ()                      ; extract
252                 (set (ifield fv-sint9a)
253                      (or (sll (ifield f-36-1s) (const 8))
254                          (or (sll (ifield f-27-1) (const 7))
255                              (ifield f-19-7))))
256                 )
257 )
258
259 (dnmf fv-sint9b "i9 for M5 M10"
260       () INT
261       (f-36-1s f-27-1 f-12-7)
262       (sequence ()                      ; insert
263                 (set (ifield f-36-1s) (srl (ifield fv-sint9b) (const 8)))
264                 (set (ifield f-27-1)
265                      (and (srl (ifield fv-sint9b) (const 7)) (const 1)))
266                 (set (ifield f-12-7) (and (ifield fv-sint9b) (const #x7f)))
267                 )
268       (sequence ()                      ; extract
269                 (set (ifield fv-sint9b)
270                      (or (sll (ifield f-36-1s) (const 8))
271                          (or (sll (ifield f-27-1) (const 7))
272                              (ifield f-12-7))))
273                 )
274 )
275
276 (dnmf fv-sint14 "i14 for A4"
277       () INT
278       (f-36-1s f-32-6 f-19-7)
279       (sequence ()                      ; insert
280                 (set (ifield f-36-1s) (srl (ifield fv-sint14) (const 13)))
281                 (set (ifield f-32-6)
282                      (and (srl (ifield fv-sint14) (const 7)) (const #x3f)))
283                 (set (ifield f-19-7) (and (ifield fv-sint14) (const #x7f)))
284                 )
285       (sequence ()                      ; extract
286                 (set (ifield fv-sint14)
287                      (or (sll (ifield f-36-1s) (const 13))
288                          (or (sll (ifield f-32-6) (const 7))
289                              (ifield f-19-7))))
290                 )
291 )
292
293 (dnmf fv-sint17 "mask17 for I23"
294       () INT
295       (f-36-1s f-31-8 f-12-7)
296       (sequence ()                      ; insert
297                 (set (ifield f-36-1s) (srl (ifield fv-sint17) (const 16)))
298                 (set (ifield f-31-8)
299                      (and (srl (ifield fv-sint17) (const 8)) (const #xff)))
300                 (set (ifield f-12-7)
301                      (and (srl (ifield fv-sint17) (const 1)) (const #x7f)))
302                 )
303       (sequence ()                      ; extract
304                 (set (ifield fv-sint17)
305                      (or (sll (ifield f-36-1s) (const 16))
306                          (or (sll (ifield f-31-8) (const 8))
307                              (ifield f-12-7))))
308                 )
309 )
310
311 (dnmf fv-sint22 "i22 for A5"
312       () INT
313       (f-36-1s f-35-9 f-26-5 f-19-7)
314       (sequence ()                      ; insert
315                 (set (ifield f-36-1s) (srl (ifield fv-sint22) (const 21)))
316                 (set (ifield f-26-5)
317                      (and (srl (ifield fv-sint22) (const 16)) (const #x1f)))
318                 (set (ifield f-35-9)
319                      (and (srl (ifield fv-sint22) (const 7)) (const #x1ff)))
320                 (set (ifield f-19-7) (and (ifield fv-sint22) (const #x7f)))
321                 )
322       (sequence ()                      ; extract
323                 (set (ifield fv-sint22)
324                      (or (or (sll (ifield f-36-1s) (const 21))
325                              (sll (ifield f-26-5) (const 16)))
326                          (or (sll (ifield f-35-9) (const 7))
327                              (ifield f-19-7))))
328                 )
329 )
330
331 (dnmf fv-sint44 "i44 for I24"
332       () INT
333       (f-36-1s f-32-27)
334       (sequence ()                      ; insert
335                 (set (ifield f-36-1s) (srl (ifield fv-sint44) (const 43)))
336                 (set (ifield f-19-7)
337                      (and (srl (ifield fv-sint44) (const 16))
338                           (const #x7ffffff)))
339                 )
340       (sequence ()                      ; extract
341                 (set (ifield fv-sint44)
342                      (or (sll (ifield f-36-1s) (const 43))
343                          (sll (ifield f-32-27) (const 16))))
344                 )
345 )
346
347 (dnmf fv-sint64 "i64 for I18"
348       () INT
349       (f-81-41 f-36-1s f-35-9 f-26-5 f-21-1 f-19-7)
350       (sequence ()                      ; insert
351                 (set (ifield f-36-1s) (srl (ifield fv-sint64) (const 63)))
352                 (set (ifield f-81-41)
353                      (and (srl (ifield fv-sint64) (const 22))
354                           (const #x1fffffffff)))
355                 (set (ifield f-21-1)
356                      (and (srl (ifield fv-sint64) (const 21)) (const 1)))
357                 (set (ifield f-26-5)
358                      (and (srl (ifield fv-sint64) (const 16)) (const #x1f)))
359                 (set (ifield f-35-9)
360                      (and (srl (ifield fv-sint64) (const 7)) (const #x1ff)))
361                 (set (ifield f-19-7) (and (ifield fv-sint64) (const #x7f)))
362                 )
363       (sequence ()                      ; extract
364                 (set (ifield fv-sint64)
365                      (or (or (or (sll (ifield f-36-1s) (const 63))
366                                  (sll (ifield f-81-41) (const 22)))
367                              (or (sll (ifield f-21-1) (const 21))
368                                  (sll (ifield f-26-5) (const 16))))
369                          (or (sll (ifield f-35-9) (const 7))
370                              (ifield f-19-7))))
371                 )
372 )
373
374 (dnmf fv-uint21 "u21 for I19 M37 F15"
375       () UINT
376       (f-36-1 f-25-20)
377       (sequence ()                      ; insert
378                 (set (ifield f-36-1) (srl (ifield fv-uint21) (const 20)))
379                 (set (ifield f-25-20) (and (ifield fv-uint21) (const #xfffff)))
380                 )
381       (sequence ()                      ; extract
382                 (set (ifield fv-uint21)
383                      (or (sll (ifield f-36-1) (const 20))
384                          (ifield f-25-20)))
385                 )
386 )
387
388 (dnmf fv-uint24 "u24 for M44"
389       () UINT
390       (f-36-1 f-32-2 f-26-21)
391       (sequence ()                      ; insert
392                 (set (ifield f-36-1) (srl (ifield fv-uint24) (const 23)))
393                 (set (ifield f-32-1)
394                      (and (srl (ifield fv-uint24) (const 21)) (const 3)))
395                 (set (ifield f-26-21)
396                      (and (ifield fv-uint24) (const #x1fffff)))
397                 )
398       (sequence ()                      ; extract
399                 (set (ifield fv-uint24)
400                      (or (sll (ifield f-36-1) (const 23))
401                          (or (sll (ifield f-32-2) (const 21))
402                              (ifield f-26-21))))
403                 )
404 )
405
406 (dnmf fv-tgt25a "target25 for I20 M20 M21"
407       (PCREL-ADDR) INT
408       (f-36-1s f-32-13 f-12-7)
409       (sequence ()                      ; insert
410                 ;; ??? Wherefore right shift.
411                 (set (ifield f-36-1s) (srl (ifield fv-tgt25a) (const 20)))
412                 (set (ifield f-32-13)
413                      (and (srl (ifield fv-tgt25a) (const 7)) (const #x1fff)))
414                 (set (ifield f-12-7) (and (ifield fv-tgt25a) (const #x7f)))
415                 )
416       (sequence ()                      ; extract
417                 ;; ??? Where will pc be added.
418                 ;; ??? Wherefore left shift.
419                 (set (ifield fv-tgt25a)
420                      (or (sll (ifield f-36-1s) (const 20))
421                          (or (sll (ifield f-32-13) (const 7))
422                              (ifield f-12-7))))
423                 )
424 )
425
426 (dnmf fv-tgt25b "target25 for F14"
427       (PCREL-ADDR) INT
428       (f-36-1s f-25-20)
429       (sequence ()                      ; insert
430                 ;; ??? Wherefore right shift.
431                 (set (ifield f-36-1s) (srl (ifield fv-tgt25b) (const 20)))
432                 (set (ifield f-25-20) (and (ifield fv-tgt25b) (const #xfffff)))
433                 )
434       (sequence ()                      ; extract
435                 ;; ??? Where will pc be added.
436                 ;; ??? Wherefore left shift.
437                 (set (ifield fv-tgt25b)
438                      (or (sll (ifield f-36-1) (const 20))
439                          (ifield f-25-20)))
440                 )
441 )
442
443 (dnmf fv-tgt25c "target25 for M22 M23 B1 B2 B3 B6"
444       (PCREL-ADDR) INT
445       (f-36-1s f-32-20)
446       (sequence ()                      ; insert
447                 ;; ??? Wherefore right shift.
448                 (set (ifield f-36-1s) (srl (ifield fv-tgt25c) (const 20)))
449                 (set (ifield f-32-20) (and (ifield fv-tgt25c) (const #xfffff)))
450                 )
451       (sequence ()                      ; extract
452                 ;; ??? Where will pc be added.
453                 ;; ??? Wherefore left shift.
454                 (set (ifield fv-tgt25c)
455                      (or (sll (ifield f-36-1s) (const 20))
456                          (ifield f-32-20)))
457                 )
458 )
459
460 (dnmf fv-tag13a "tag13 for I21"
461       (PCREL-ADDR) INT
462       (f-32-9)
463       (sequence ()                      ; insert
464                 ;; ??? Wherefore right shift.
465                 (set (ifield f-32-9) (and (ifield fv-tag13a (const #x1ff))))
466                 )
467       (sequence ()                      ; extract
468                 ;; ??? Where will pc be added.
469                 ;; ??? Wherefore left shift.
470                 (set (ifield fv-tag13a)
471                      (sub (xor (ifield f-32-9) (const #x100)) (const #x100)))
472                 )
473 )
474
475 (dnmf fv-tag13b "tag13 for B6 B7"
476       (PCREL-ADDR) INT
477       (f-34-2 f-12-7)
478       (sequence ()                      ; insert
479                 ;; ??? Wherefore right shift.
480                 (set (ifield f-34-2)
481                      (and (sll (ifield fv-tag13b) (const 7)) (const 3)))
482                 (set (ifield f-12-7) (and (ifield fv-tag13b) (const #x7f)))
483                 )
484       (sequence ()                      ; extract
485                 ;; ??? Where will pc be added.
486                 ;; ??? Wherefore left shift.
487                 (set (ifield fv-tag13a)
488                      (or (sll (sub (xor (ifield f-34-2) (const 2))
489                                    (const 2))
490                               (const 7))
491                          (ifield f-12-7)))
492                 )
493 )
494
495 (dnmf fv-uint9  "u9 for F5"
496       () UINT
497       (f-34-2 f-26-7)
498       (sequence ()                      ; insert
499                 (set (ifield f-26-7) (srl (ifield fv-uint9) (const 2)))
500                 (set (ifield f-34-2) (and (ifield fv-uint9) (const 3)))
501                 )
502       (sequence ()                      ; extract
503                 (set (ifield fv-uint9)
504                      (or (sll (ifield f-26-7) (const 2))
505                          (ifield f-34-2)))
506                 )
507 )
508
509 ;; Fields with funny arithmetic
510
511 (df f-count2a "count2 for A2" () 28 2 UINT
512     ((value pc) (sub WI value (const 1)))
513     ((value pc) (add WI value (const 1)))
514 )
515     
516 (df f-count2b "count2 for A10" () 28 2 UINT
517     ((value pc)
518      (if WI (le value (const 2))
519           (sub WI value (const 1))
520           (error "invalid value for field count2b")))
521     ((value pc) (add WI value (const 1)))
522 )
523
524 (df f-count2c "count2 for I1" () 31 2 UINT
525     ((value pc)
526      (cond WI
527             ((eq value (const 0)) (const 0))
528             ((eq value (const 7)) (const 1))
529             ((eq value (const 15)) (const 2))
530             ((eq value (const 16)) (const 3))
531             (else (error "invalid value for field count2c"))))
532     ((value pc)
533      (cond WI
534             ((eq value (const 0)) (const 0))
535             ((eq value (const 1)) (const 7))
536             ((eq value (const 2)) (const 15))
537             ((eq value (const 3)) (const 16))))
538 )
539
540 (df f-ccount5 "ccount5 for I8" () 24 5 UINT
541     ((value pc) (sub WI (const 31) value))
542     ((value pc) (sub WI (const 31) value))
543 )
544     
545 (df f-len4 "len4 for I15" () 30 4 UINT
546     ((value pc) (sub WI value (const 1)))
547     ((value pc) (add WI value (const 1)))
548 )
549
550 (df f-len6 "len6 for I11 I12 I13 I14" () 32 6 UINT
551     ((value pc) (sub WI value (const 1)))
552     ((value pc) (add WI value (const 1)))
553 )
554
555 (df f-cpos6a "cpos6 for I12 I13" () 25 6 UINT
556     ((value pc) (sub WI (const 63) value))
557     ((value pc) (sub WI (const 63) value))
558 )
559
560 (df f-cpos6b "cpos6 for I14" () 19 6 UINT
561     ((value pc) (sub WI (const 63) value))
562     ((value pc) (sub WI (const 63) value))
563 )
564
565 (df f-cpos6c "cpos6 for I15" () 36 6 UINT
566     ((value pc) (sub WI (const 63) value))
567     ((value pc) (sub WI (const 63) value))
568 )
569
570 (dnmf fv-inc3 "inc3 for M17" () INT
571       (f-15-1 f-14-2)
572       (sequence ()                      ; insert
573                 (set (ifield f-15-1) (lt (ifield fv-inc3) (const 0)))
574                 (set (ifield f-14-2) (abs (ifield fv-inc3)))
575                 (set (ifield f-14-2)
576                      (cond ((eq (ifield f-14-2) (const 1)) (const 3))
577                            ((eq (ifield f-14-2) (const 4)) (const 2))
578                            ((eq (ifield f-14-2) (const 8)) (const 1))
579                            ((eq (ifield f-14-2) (const 16)) (const 0))
580                            (else (error "invalid value for field inc3"))))
581                 )
582       (sequence ()                      ; extract
583                 (set (ifield fv-inc3)
584                      (mul (add (mul (neg (ifield f-15-1)) (const 2)) (const 1))
585                           (if (eq (ifield f-14-2) (const 3))
586                               (const 1)
587                               (sll (const 1) (sub (const 4)
588                                                   (ifield f-14-2))))))
589                 )
590 )
591 \f
592 ;;; Hardware pieces.
593 ;;;
594 ;;; These entries list the elements of the raw hardware.  They're also
595 ;;; used to provide tables and other elements of the assembly language.
596
597 ;; The normal h-uint only provides 32 bits of integer.
598 (dnh h-int64 "64-bit integer" ()
599      (immediate (INT 64))
600      () () ()
601 )
602
603 ;; ??? Intel calls this if IP, but from experience with the i960
604 ;; simulator using the name "ip", we know that gdb reacts badly.
605 (dnh h-pc "program counter" (PC PROFILE) (pc) () () ())
606
607 (define-pmacro (build-decpair num) ((.dec num) num))
608
609 (define-hardware
610   (name h-gr)
611   (comment "general registers")
612   (attrs CACHE-ADDR)
613   (type register WI (128))
614   (indices keyword "r"
615     (.map build-decpair (.iota 128)))
616 )
617
618 ;; ??? Skip GR NaTs for now, since we're not simulating.
619
620 (define-hardware
621   (name h-fr)
622   (comment "floating-point registers")
623   (type register XF (128))
624   (indices keyword "fr"
625     (.map build-decpair (.iota 128)))
626 )
627
628 (define-hardware
629   (name h-br)
630   (comment "branch registers")
631   (attrs CACHE-ADDR)
632   (type register WI (8))
633   (indices keyword "br"
634     (.map build-decpair (.iota 8)))
635 )
636
637 (define-hardware
638   (name h-ar)
639   (comment "application registers")
640   (type register WI (128))
641   (indices keyword "ar"
642     (.map build-decpair (.iota 128)))
643 )
644
645 (define-hardware
646   (name h-pr)
647   (comment "predicate registers")
648   (type register BI (64))
649   (indices keyword "pr"
650     (.map build-decpair (.iota 64)))
651 )
652
653 (define-hardware
654   (name h-cr)
655   (comment "control registers")
656   (type register WI (128))
657   (indices keyword "cr"
658     (.map build-decpair (.iota 128)))
659 )
660
661 ;; ??? CFM, PSR, PMD, CPUID
662 \f
663 ;;; Instruction Operands.
664 ;;;
665 ;;; These entries provide a layer between the assembler and the raw
666 ;;; hardware description, and are used to refer to hardware elements
667 ;;; in the semantic code.  Usually there's a bit of over-specification,
668 ;;; but in more complicated instruction sets there isn't.
669
670 (dnop qp        "qualifying predicate"          () h-pr f-qp)
671
672 (dnop r1        "general register 1"            () h-gr f-12-7)
673 (dnop r2        "general register 2"            () h-gr f-19-7)
674 (dnop r3        "general register 3"            () h-gr f-26-7)
675 (dnop r33       "general register 3 for A5"     () h-gr f-21-2)
676
677 (dnop f1        "floating-point register 1"     () h-fr f-12-7)
678 (dnop f2        "floating-point register 2"     () h-fr f-19-7)
679 (dnop f3        "floating-point register 3"     () h-fr f-26-7)
680
681 (dnop p1        "predicate register 1"          () h-pr f-11-6)
682 (dnop p2        "predicate register 2"          () h-pr f-32-6)
683
684 (dnop b1        "branch register 1"             () h-br f-8-3)
685 (dnop b2        "branch register 2"             () h-br f-15-3)
686
687 (dnop ar3       "application register 3"        () h-ar f-26-7)
688 (dnop cr3       "control register 3"            () h-cr f-26-7)
689
690 (dnop imm1      "imm1 for I14"                  () h-int64 f-36-1s)
691 (dnop imm8      "imm8 for A3 A8 I27 M30"        () h-int64 fv-sint8)
692 (dnop imm9a     "imm9 for M3 M8 M15"            () h-int64 fv-sint9a)
693 (dnop imm9b     "imm9 for M5 M10"               () h-int64 fv-sint9b)
694 (dnop imm14     "imm14 for A4"                  () h-int64 fv-sint14)
695 (dnop imm17     "mask17 for I23"                () h-int64 fv-sint17)
696 (dnop imm21     "imm21 for I19"                 () h-int64 fv-uint21)
697 (dnop imm22     "imm22 for A5"                  () h-int64 fv-sint22)
698 (dnop imm44     "imm44 for I24"                 () h-int64 fv-sint44)
699 (dnop imm64     "imm64 for I18"                 () h-int64 fv-sint64)
700
701 (dnop count2a   "count2 for A2"                 () h-int64 f-count2a)
702 (dnop count2b   "count2 for A10"                () h-int64 f-count2b)
703 (dnop count2c   "count2 for I1"                 () h-int64 f-count2c)
704 (dnop count5    "count5 for I6"                 () h-int64 f-18-5)
705 (dnop count6    "count6 for I10"                () h-int64 f-32-6)
706 (dnop ccount5   "ccount5 for I8"                () h-int64 f-ccount5)
707
708 (dnop len4      "len4 for I15"                  () h-int64 f-len4)
709 (dnop len6      "len6 for I11 I12 I13 I14"      () h-int64 f-len6)
710
711 (dnop pos6      "pos6 for I11"                  () h-int64 f-19-6)
712 (dnop cpos6a    "cpos6 for I12 I13"             () h-int64 f-cpos6a)
713 (dnop cpos6b    "cpos6 for I14"                 () h-int64 f-cpos6b)
714 (dnop cpos6c    "cpos6 for I15"                 () h-int64 f-cpos6c)
715
716 (dnop inc3      "inc3 for M17"                  () h-int64 fv-inc3)
717
718 (define-operand
719   (name mbtype4)
720   (comment "mbtype4 type for I3")
721   (type h-int64)
722   (index f-23-4)
723   (handlers (parse "mbtype4")
724             (print "mbtype4"))
725 )
726
727 (dnop mhtype8   "mhtype8 for I4"                () h-int64 f-27-8)
728
729 (dnop tgt25a    "tgt25 for I20 M20 M21"         () h-int64 fv-tgt25a)
730 (dnop tgt25b    "tgt25 for F14"                 () h-int64 fv-tgt25b)
731 (dnop tgt25c    "tgt25 for M22 M23 B1 B2 B3 B6" () h-int64 fv-tgt25c)
732
733 (dnop tag13a    "tag13 for I21"                 () h-int64 fv-tag13a)
734
735 ;; Completers 
736
737 (define-operand
738   (name ldhint)
739   (comment "ldhint completer")
740   (type h-int64)
741   (index f-29-2)
742   (handlers (parse "ldhint")
743             (print "ldhint"))
744 )
745
746 (define-operand
747   (name sthint)
748   (comment "sthint completer")
749   (type h-int64)
750   (index f-29-2)
751   (handlers (parse "sthint")
752             (print "sthint"))
753 )
754
755 (define-operand
756   (name movbr_mwh)
757   (comment "mwh completer for mov_br")
758   (type h-int64)
759   (index f-21-2)
760   (handlers (parse "mwh")
761             (print "mwh"))
762 )
763
764 (define-operand
765   (name movbr_ih)
766   (comment "ih completer for mov_br")
767   (type h-int64)
768   (index f-23-1)
769   (handlers (parse "ih")
770             (print "ih"))
771 )
772
773 (define-operand
774   (name lfhint)
775   (comment "lfhint for lfetch")
776   (type h-int64)
777   (index f-29-2)
778   (handlers (parse "lfhint")
779             (print "lfhint"))
780 )
781
782 (define-operand
783   (name sorsolsof)
784   (comment "combined i,l,o,r for alloc")
785   (type h-int64)
786   (index f-30-19)
787   (handlers (parse "sorsolsof")
788             (print "sorsolsof"))
789 )
790
791 ;; These are architecturally ignored bits, as opposed to architecturally
792 ;; reserved bits.  I.e. we should assemble them in with zeros, but we should
793 ;; ignore them when disassembling.
794
795 (dnop ign_36_1  "ignore 1 @ 36"                 () h-int64 f-36-1)
796 (dnop ign_32_2  "ignore 2 @ 32"                 () h-int64 f-32-2)
797 (dnop ign_32_1  "ignore 1 @ 32"                 () h-int64 f-32-1)
798 (dnop ign_29_2  "ignore 2 @ 29"                 () h-int64 f-29-2)
799 (dnop ign_27_4  "ignore 4 @ 27"                 () h-int64 f-27-4)
800 (dnop ign_27_3  "ignore 3 @ 27"                 () h-int64 f-27-3)
801 (dnop ign_27_1  "ignore 1 @ 27"                 () h-int64 f-27-1)
802 (dnop ign_26_11 "ignore 11 @ 26"                () h-int64 f-26-11)
803 (dnop ign_26_7  "ignore 7 @ 26"                 () h-int64 f-26-7)
804 (dnop ign_26_1  "ignore 1 @ 26"                 () h-int64 f-26-1)
805 (dnop ign_23_4  "ignore 4 @ 23"                 () h-int64 f-23-4)
806 (dnop ign_19_7  "ignore 7 @ 19"                 () h-int64 f-19-7)
807 (dnop ign_19_6  "ignore 6 @ 19"                 () h-int64 f-19-6)
808 (dnop ign_19_4  "ignore 4 @ 19"                 () h-int64 f-19-4)
809 (dnop ign_19_1  "ignore 1 @ 19"                 () h-int64 f-19-1)
810 (dnop ign_13_1  "ignore 1 @ 13"                 () h-int64 f-13-1)
811 (dnop ign_12_7  "ignore 7 @ 12"                 () h-int64 f-12-7)
812
813 ;; ??? Add more as needed.
814 \f
815 ;;; "A" Format Instruction definitions.
816
817 (define-pmacro (I-A1 mnemonic maybe-p1 op x2a ve x4 x2b)
818   (dni (.sym mnemonic maybe-p1)
819        (.str "Integer ALU, reg-reg, " mnemonic maybe-p1)
820        ((FORMAT A1))
821        (.str mnemonic " $r1=$r2,$r3" maybe-p1)
822        (+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4) (f-28-2 x2b)
823           ign_36_1 r3 r2 r1 qp)
824        ()
825        ()
826        )
827 )
828
829 (I-A1 add ""    8 0 0 0 0)
830 (I-A1 add ",1"  8 0 0 0 1)
831 (I-A1 sub ""    8 0 0 1 1)
832 (I-A1 sub ",1"  8 0 0 1 0)
833 (I-A1 addp4 ""  8 0 0 2 0)
834 (I-A1 and ""    8 0 0 3 0)
835 (I-A1 andcm ""  8 0 0 3 1)
836 (I-A1 or ""     8 0 0 3 2)
837 (I-A1 xor ""    8 0 0 3 3)
838
839 (define-pmacro (I-A2 mnemonic op x2a ve x4)
840   (dni mnemonic
841        (.str "Shift Left and Add, " mnemonic)
842        ((FORMAT A2))
843        (.str mnemonic " $r1=$r2,$count2a,$r3")
844        (+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4)
845           ign_36_1 count2a r3 r2 r1 qp)
846        ()
847        ()
848        )
849 )
850
851 (I-A2 shladd    8 0 0 4)
852 (I-A2 shladdp4  8 0 0 6)
853
854 (define-pmacro (I-A3 mnemonic op x2a ve x4 x2b)
855   (dni (.sym mnemonic "i")
856        (.str "Integer ALU, imm8-reg, " mnemonic)
857        ((FORMAT A3))
858        (.str mnemonic " $r1=$imm8,$r3")
859        (+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4) (f-28-2 x2b)
860           r3 imm8 r1 qp)
861        ()
862        ()
863        )
864 )
865
866 (I-A3 sub       8 0 0  9 1)
867 (I-A3 and       8 0 0 11 0)
868 (I-A3 andcm     8 0 0 11 1)
869 (I-A3 or        8 0 0 11 2)
870 (I-A3 xor       8 0 0 11 3)
871
872 (define-pmacro (I-A4 mnemonic op x2a ve)
873   (dni (.str mnemonic "i")
874        (.str "Add imm14, " mnemonic)
875        ((FORMAT A4))
876        (.str mnemonic " $r1=$imm14,$r3")
877        (+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve)
878           r3 imm14 r1 qp)
879        ()
880        ()
881        )
882 )
883
884 (I-A4 adds      8 2 0)
885 (I-A4 addp4     8 3 0)
886
887 (define-pmacro (I-A5 mnemonic op)
888   (dni (.str mnemonic)
889        (.str "Add imm22, " mnemonic)
890        ((FORMAT A5))
891        (.str mnemonic " $r1=$imm22,$r33")
892        (+ (f-opcode op) imm22 r33 r1 qp)
893        ()
894        ()
895        )
896 )
897
898 (I-A5 addl      9)
899
900 (define-pmacro (I-A6 mnemonic ctype-attr op x2 tb ta c)
901   (dni (.sym mnemonic)
902        (.str "Integer Compare, reg-reg, " mnemonic)
903        ((FORMAT A6) (FIELD-CTYPE ctype-attr))
904        (.str mnemonic " $p1,$p2=$r2,$r3")
905        (+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
906           p2 r3 r2 p1 qp)
907        ()
908        ()
909        )
910 )
911
912 (define-pmacro (I-A6-cmp-cond-ctype cmp cond ctype op x2 ta c)
913   (I-A6 (.sym cmp "." cond
914               (.eval (if (eq? (string-length ctype) 0) "" "."))
915               ctype)
916         (.eval (if (eq? (string-length ctype) 0) 'NONE (string->symbol ctype)))
917         op 0 x2 ta c)
918 )
919
920 (define-pmacro (I-A6-cmp cmp x2)
921   (begin
922     (I-A6-cmp-cond-ctype cmp lt  ""             12 x2 0 0)
923     (I-A6-cmp-cond-ctype cmp ltu ""             13 x2 0 0)
924     (I-A6-cmp-cond-ctype cmp eq  ""             14 x2 0 0)
925
926     (I-A6-cmp-cond-ctype cmp lt  "unc"          12 x2 0 1)
927     (I-A6-cmp-cond-ctype cmp ltu "unc"          13 x2 0 1)
928     (I-A6-cmp-cond-ctype cmp eq  "unc"          14 x2 0 1)
929
930     (I-A6-cmp-cond-ctype cmp eq  "and"          12 x2 1 0)
931     (I-A6-cmp-cond-ctype cmp eq  "or"           13 x2 1 0)
932     (I-A6-cmp-cond-ctype cmp eq  "or.andcm"     14 x2 1 0)
933
934     (I-A6-cmp-cond-ctype cmp ne  "and"          12 x2 1 1)
935     (I-A6-cmp-cond-ctype cmp ne  "or"           13 x2 1 1)
936     (I-A6-cmp-cond-ctype cmp ne  "or.andcm"     14 x2 1 1)
937     )
938 )
939
940 (I-A6-cmp cmp  0)
941 (I-A6-cmp cmp4 1)
942
943 (define-pmacro (I-A7 mnemonic ctype-attr op x2 tb ta c)
944   (dni (.sym mnemonic)
945        (.str "Integer Compare, zero-reg, " mnemonic)
946        ((FORMAT A7) (FIELD-CTYPE ctype-attr))
947        (.str mnemonic " $p1,$p2=r0,$r3")
948        (+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
949           p2 r3 (f-19-7 0) p1 qp)
950        ()
951        ()
952        )
953 )
954
955 (define-pmacro (I-A7-cmp-cond-ctype cmp cond ctype op x2 ta c)
956   (I-A7 (.sym cmp "." cond "." ctype) (.sym ctype) op x2 1 ta c)
957 )
958
959 (define-pmacro (I-A7-cmp-cond cmp cond x2 ta c)
960   (begin
961     (I-A7-cmp-cond-ctype cmp cond and   12 x2 ta c)
962     (I-A7-cmp-cond-ctype cmp cond or    13 x2 ta c)
963     (I-A7-cmp-cond-ctype cmp cond andcm 14 x2 ta c)
964     )
965 )
966
967 (define-pmacro (I-A7-cmp cmp x2)
968   (begin
969     (I-A7-cmp-cond cmp gt x2 0 0)
970     (I-A7-cmp-cond cmp le x2 0 1)
971     (I-A7-cmp-cond cmp ge x2 1 0)
972     (I-A7-cmp-cond cmp lt x2 1 1)
973     )
974 )
975
976 (I-A7-cmp cmp  0)
977 (I-A7-cmp cmp4 1)
978
979 (define-pmacro (I-A8 mnemonic ctype-attr op x2 ta c)
980   (dni (.sym mnemonic)
981        (.str "Integer Compare, imm8-reg, " mnemonic)
982        ((FORMAT A7) (FIELD-CTYPE ctype-attr))
983        (.str mnemonic " $p1,$p2=$imm8,$r3")
984        (+ (f-opcode op) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
985           p2 r3 imm8 p1 qp)
986        ()
987        ()
988        )
989 )
990
991 (define-pmacro (I-A8-cmp-cond-ctype cmp cond ctype op x2 ta c)
992   (I-A8 (.sym cmp "." cond
993               (.eval (if (eq? (string-length ctype) 0) "" "."))
994               ctype)
995         (.eval (if (eq? (string-length ctype) 0) 'NONE (string->symbol ctype)))
996         op x2 ta c)
997 )
998
999 (define-pmacro (I-A8-cmp cmp x2)
1000   (begin
1001     (I-A8-cmp-cond-ctype cmp lt  ""             12 x2 0 0)
1002     (I-A8-cmp-cond-ctype cmp ltu ""             13 x2 0 0)
1003     (I-A8-cmp-cond-ctype cmp eq  ""             14 x2 0 0)
1004
1005     (I-A8-cmp-cond-ctype cmp lt  "unc"          12 x2 0 1)
1006     (I-A8-cmp-cond-ctype cmp ltu "unc"          13 x2 0 1)
1007     (I-A8-cmp-cond-ctype cmp eq  "unc"          14 x2 0 1)
1008
1009     (I-A8-cmp-cond-ctype cmp eq  "and"          12 x2 1 0)
1010     (I-A8-cmp-cond-ctype cmp eq  "or"           12 x2 1 0)
1011     (I-A8-cmp-cond-ctype cmp eq  "or.andcm"     12 x2 1 0)
1012
1013     (I-A8-cmp-cond-ctype cmp ne  "and"          12 x2 1 1)
1014     (I-A8-cmp-cond-ctype cmp ne  "or"           12 x2 1 1)
1015     (I-A8-cmp-cond-ctype cmp ne  "or.andcm"     12 x2 1 1)
1016     )
1017 )
1018
1019 (I-A8-cmp cmp  2)
1020 (I-A8-cmp cmp4 3)
1021
1022 (define-pmacro (I-A9 mnemonic op x2a za zb x4 x2b)
1023   (dni (.str mnemonic)
1024        (.str "Multimetia ALU, " mnemonic)
1025        ((FORMAT A9))
1026        (.str mnemonic " $r1=$r2,$r3")
1027        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-4 x4)
1028           (f-28-2 x2b) r3 r2 r1 qp)
1029        ()
1030        ()
1031        )
1032 )
1033
1034 (I-A9 padd1     8 1 0 0 0 0)
1035 (I-A9 padd2     8 1 0 1 0 0)
1036 (I-A9 padd4     8 1 1 0 0 0)
1037 (I-A9 padd1.sss 8 1 0 0 0 1)
1038 (I-A9 padd2.sss 8 1 0 1 0 1)
1039 (I-A9 padd1.uuu 8 1 0 0 0 2)
1040 (I-A9 padd2.uuu 8 1 0 1 0 2)
1041 (I-A9 padd1.uus 8 1 0 0 0 3)
1042 (I-A9 padd2.uus 8 1 0 1 0 3)
1043
1044 (I-A9 psub1     8 1 0 0 1 0)
1045 (I-A9 psub2     8 1 0 1 1 0)
1046 (I-A9 psub4     8 1 1 0 1 0)
1047 (I-A9 psub1.sss 8 1 0 0 1 1)
1048 (I-A9 psub2.sss 8 1 0 1 1 1)
1049 (I-A9 psub1.uuu 8 1 0 0 1 2)
1050 (I-A9 psub2.uuu 8 1 0 1 1 2)
1051 (I-A9 psub1.uus 8 1 0 0 1 3)
1052 (I-A9 psub2.uus 8 1 0 1 1 3)
1053
1054 (I-A9 pavg1     8 1 0 0 2 2)
1055 (I-A9 pavg2     8 1 0 1 2 2)
1056 (I-A9 pavg1.raz 8 1 0 0 2 3)
1057 (I-A9 pavg2.raz 8 1 0 1 2 3)
1058
1059 (I-A9 pavgsub1  8 1 0 0 3 2)
1060 (I-A9 pavgsub2  8 1 0 1 3 2)
1061
1062 (I-A9 pcmp1.eq  8 1 0 0 9 0)
1063 (I-A9 pcmp2.eq  8 1 0 1 9 0)
1064 (I-A9 pcmp4.eq  8 1 1 0 9 0)
1065 (I-A9 pcmp1.gt  8 1 0 0 9 1)
1066 (I-A9 pcmp2.gt  8 1 0 1 9 1)
1067 (I-A9 pcmp4.gt  8 1 1 0 9 1)
1068
1069 (define-pmacro (I-A10 mnemonic op x2a za zb x4)
1070   (dni mnemonic
1071        (.str "Multimedia Shift and Add, " mnemonic)
1072        ((FORMAT A10))
1073        (.str mnemonic " $r1=$r2,$count2b,$r3")
1074        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-4 x4)
1075           count2b r3 r2 r1 qp)
1076        ()
1077        ()
1078        )
1079 )
1080
1081 (I-A10 pshladd2 8 1 0 1 4)
1082 (I-A10 pshradd2 8 1 0 1 6)
1083 \f
1084 ;;; "I" Format Instruction definitions.
1085
1086 (define-pmacro (I-I1 mnemonic op za zb ve x2a x2b)
1087   (dni mnemonic
1088        (.str "Multimedia Multiply and Shift, " mnemonic)
1089        ((FORMAT I1))
1090        (.str mnemonic " $r1=$r2,$r3,$count2c")
1091        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1092           (f-29-2 x2b) count2c ign_27_1 r3 r2 r1 qp)
1093        ()
1094        ()
1095        )
1096 )
1097
1098 (I-I1 pmpyshr2   7 0 1 0 0 3)
1099 (I-I1 pmpyshr2.u 7 0 1 0 0 1)
1100
1101 (define-pmacro (I-I2 mnemonic op za zb ve x2a x2b x2c)
1102   (dni mnemonic
1103        (.str "Multimedia Multiply/Mix/Pack/Unpack, " mnemonic)
1104        ((FORMAT I2))
1105        (.str mnemonic " $r1=$r2,$r3")
1106        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1107           (f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
1108        ()
1109        ()
1110        )
1111 )
1112
1113 (I-I2 pmpy2.r   7 0 1 0 2 1 3)
1114 (I-I2 pmpy2.l   7 0 1 0 2 3 3)
1115
1116 (I-I2 mix1.r    7 0 0 0 2 0 2)
1117 (I-I2 mix2.r    7 0 1 0 2 0 2)
1118 (I-I2 mix4.r    7 1 0 0 2 0 2)
1119 (I-I2 mix1.l    7 0 0 0 2 2 2)
1120 (I-I2 mix2.l    7 0 1 0 2 2 2)
1121 (I-I2 mix4.l    7 1 0 0 2 2 2)
1122
1123 (I-I2 pack2.uss 7 0 1 0 2 0 0)
1124 (I-I2 pack2.sss 7 0 1 0 2 2 0)
1125 (I-I2 pack4.sss 7 1 0 0 2 2 0)
1126
1127 (I-I2 unpack1.h 7 0 0 0 2 0 1)
1128 (I-I2 unpack2.h 7 0 1 0 2 0 1)
1129 (I-I2 unpack4.h 7 1 0 0 2 0 1)
1130 (I-I2 unpack1.l 7 0 0 0 2 2 1)
1131 (I-I2 unpack2.l 7 0 1 0 2 2 1)
1132 (I-I2 unpack4.l 7 1 0 0 2 2 1)
1133
1134 (I-I2 pmin1.u   7 0 0 0 2 1 0)
1135 (I-I2 pmax1.u   7 0 0 0 2 1 1)
1136 (I-I2 pmin2     7 0 1 0 2 3 0)
1137 (I-I2 pmax2     7 0 1 0 2 3 1)
1138
1139 (I-I2 psad1     7 0 0 0 2 3 2)
1140
1141 (define-pmacro (I-I3 mnemonic op za zb ve x2a x2b x2c)
1142   (dni mnemonic
1143        (.str "Multimedia Mux1, " mnemonic)
1144        ((FORMAT I3))
1145        (.str mnemonic " $r1=$r2,$mbtype4")
1146        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1147           (f-31-2 x2c) (f-29-2 x2b) ign_27_4 mbtype4 r2 r1 qp)
1148        ()
1149        ()
1150        )
1151 )
1152
1153 (I-I3 mux1      7 0 0 0 3 2 2)
1154
1155 (define-pmacro (I-I4 mnemonic op za zb ve x2a x2b x2c)
1156   (dni mnemonic
1157        (.str "Multimedia Mux2, " mnemonic)
1158        ((FORMAT I4))
1159        (.str mnemonic " $r1=$r2,$mhtype8")
1160        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1161           (f-31-2 x2c) (f-29-2 x2b) mhtype8 r2 r1 qp)
1162        ()
1163        ()
1164        )
1165 )
1166
1167 (I-I4 mux2      7 0 1 0 3 2 2)
1168
1169 (define-pmacro (I-I5 mnemonic op za zb ve x2a x2b x2c)
1170   (dni mnemonic
1171        (.str "Shift Right, variable, " mnemonic)
1172        ((FORMAT I5))
1173        (.str mnemonic " $r1=$r3,$r2")
1174        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1175           (f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
1176        ()
1177        ()
1178        )
1179 )
1180
1181 (I-I5 pshr2     7 0 1 0 0 2 0)
1182 (I-I5 pshr4     7 1 0 0 0 2 0)
1183 (I-I5 shr       7 1 1 0 0 2 0)
1184
1185 (I-I5 pshr2.u   7 0 1 0 0 0 0)
1186 (I-I5 pshr4.u   7 1 0 0 0 0 0)
1187 (I-I5 shr.u     7 1 1 0 0 0 0)
1188
1189 (define-pmacro (I-I6 mnemonic op za zb ve x2a x2b x2c)
1190   (dni (.sym mnemonic "i")
1191        (.str "Shift Right, fixed, " mnemonic)
1192        ((FORMAT I6))
1193        (.str mnemonic " $r1=$r3,$count5")
1194        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1195           (f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 ign_19_1 count5 ign_13_1
1196           r1 qp)
1197        ()
1198        ()
1199        )
1200 )
1201
1202 (I-I6 pshr2     7 0 1 0 1 3 0)
1203 (I-I6 pshr4     7 1 0 0 1 3 0)
1204 (I-I6 pshr2.u   7 0 1 0 1 1 0)
1205 (I-I6 pshr4.u   7 1 0 0 1 1 0)
1206
1207 (define-pmacro (I-I7 mnemonic op za zb ve x2a x2b x2c)
1208   (dni mnemonic
1209        (.str "Shift Left, variable, " mnemonic)
1210        ((FORMAT I7))
1211        (.str mnemonic " $r1=$r2,$r3")
1212        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1213           (f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
1214        ()
1215        ()
1216        )
1217 )
1218
1219 (I-I7 pshl2     7 0 1 0 0 0 1)
1220 (I-I7 pshl4     7 1 0 0 0 0 1)
1221 (I-I7 shl       7 1 1 0 0 0 1)
1222
1223 (define-pmacro (I-I8 mnemonic op za zb ve x2a x2b x2c)
1224   (dni (.sym mnemonic "i")
1225        (.str "Shift Left, fixed, " mnemonic)
1226        ((FORMAT I8))
1227        (.str mnemonic " $r1=$r2,$ccount5")
1228        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1229           (f-31-2 x2c) (f-29-2 x2b) ign_27_3 ccount5  r2 r1 qp)
1230        ()
1231        ()
1232        )
1233 )
1234
1235 (I-I8 pshl2     7 0 1 0 0 0 1)
1236 (I-I8 pshl4     7 1 0 0 0 0 1)
1237
1238 (define-pmacro (I-I9 mnemonic op za zb ve x2a x2b x2c)
1239   (dni mnemonic
1240        (.str "Population Count, " mnemonic)
1241        ((FORMAT I9))
1242        (.str mnemonic " $r1=$r3")
1243        (+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
1244           (f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 (f-19-7 0) r1 qp)
1245        ()
1246        ()
1247        )
1248 )
1249
1250 (I-I9 popcnt    7 0 1 0 1 1 2)
1251
1252 (define-pmacro (I-I10 mnemonic op x2 x)
1253   (dni mnemonic
1254        (.str "Shift Right Pair, " mnemonic)
1255        ((FORMAT I10))
1256        (.str mnemonic " $r1=$r2,$r3,$count6")
1257        (+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) count6 r3 r2 r1 qp)
1258        ()
1259        ()
1260        )
1261 )
1262
1263 (I-I10 shrp     5 3 0)
1264
1265 (define-pmacro (I-I11 mnemonic op x2 x y)
1266   (dni mnemonic
1267        (.str "Extract, " mnemonic)
1268        ((FORMAT I11))
1269        (.str mnemonic " $r1=$r3,$pos6,$len6")
1270        (+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) (f-13-1 y)
1271           r3 pos6 len6 r1 qp)
1272        ()
1273        ()
1274        )
1275 )
1276
1277 (I-I11 extr.u   5 1 0 0)
1278 (I-I11 extr     5 1 0 1)
1279
1280 (define-pmacro (I-I12 mnemonic op x2 x y)
1281   (dni mnemonic
1282        (.str "Zero and Deposit, " mnemonic)
1283        ((FORMAT I12))
1284        (.str mnemonic " $r1=$r2,$cpos6a,$len6")
1285        (+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) (f-26-1 y)
1286           r2 cpos6a len6 r1 qp)
1287        ()
1288        ()
1289        )
1290 )
1291
1292 (I-I12 dep.z    5 1 1 0)
1293
1294 (define-pmacro (I-I13 mnemonic op x2 x y)
1295   (dni (.sym mnemonic "i")
1296        (.str "Zero and Deposit Immediate, " mnemonic)
1297        ((FORMAT I13))
1298        (.str mnemonic " $r1=$imm8,$cpos6a,$len6")
1299        (+ (f-opcode op) (f-35-2 x2) (f-33-1 x) (f-26-1 y)
1300           imm8 cpos6a len6 r1 qp)
1301        ()
1302        ()
1303        )
1304 )
1305
1306 (I-I13 dep.z    5 1 1 0)
1307
1308 (define-pmacro (I-I14 mnemonic op x2 x)
1309   (dni (.sym mnemonic "i")
1310        (.str "Deposit Immediate, " mnemonic)
1311        ((FORMAT I14))
1312        (.str mnemonic " $r1=$imm1,$r3,$cpos6b,$len6")
1313        (+ (f-opcode op) (f-35-2 x2) (f-33-1 x) ign_13_1
1314           imm1 r3 cpos6b len6 r1 qp)
1315        ()
1316        ()
1317        )
1318 )
1319
1320 (I-I14 dep      5 3 1)
1321
1322 (define-pmacro (I-I15 mnemonic op)
1323   (dni mnemonic
1324        (.str "Deposit, " mnemonic)
1325        ((FORMAT I15))
1326        (.str mnemonic " $r1=$r2,$r3,$cpos6c,$len4")
1327        (+ (f-opcode op) cpos6c len4 r2 r3 r1 qp)
1328        ()
1329        ()
1330        )
1331 )
1332
1333 (I-I15 dep      4)
1334
1335 (define-pmacro (I-I16 mnemonic ctype-attr op x2 ta tb y c)
1336   (dni mnemonic
1337        (.str "Test Bit, " mnemonic)
1338        ((FORMAT I16) (FIELD-CTYPE ctype-attr))
1339        (.str mnemonic " $p1,$p2=$r3,$pos6")
1340        (+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-13-1 y)
1341           (f-12-1 c) p2 r3 pos6 p1 qp)
1342        ()
1343        ()
1344        )
1345 )
1346
1347 (define-pmacro (I-I16-ctype mnemonic ctype op x2 ta tb y c)
1348   (I-I16 (.sym mnemonic
1349                (.eval (if (eq? (string-length ctype) 0) "" "."))
1350                ctype)
1351          (.eval (if (eq? (string-length ctype) 0) 'NONE
1352                     (string->symbol ctype)))
1353          op x2 ta tb y c)
1354 )
1355
1356 (I-I16-ctype tbit.z  ""         5 0 0 0 0 0)
1357 (I-I16-ctype tbit.z  "unc"      5 0 0 0 0 1)
1358 (I-I16-ctype tbit.z  "and"      5 0 0 1 0 0)
1359 (I-I16-ctype tbit.nz "and"      5 0 0 1 0 1)
1360 (I-I16-ctype tbit.z  "or"       5 0 1 0 0 0)
1361 (I-I16-ctype tbit.nz "or"       5 0 1 0 0 1)
1362 (I-I16-ctype tbit.z  "or.andcm" 5 0 1 1 0 0)
1363 (I-I16-ctype tbit.nz "or.andcm" 5 0 1 1 0 1)
1364
1365 (define-pmacro (I-I17 mnemonic ctype-attr op x2 ta tb y c)
1366   (dni mnemonic
1367        (.str "Test Bit, " mnemonic)
1368        ((FORMAT I17) (FIELD-CTYPE ctype-attr))
1369        (.str mnemonic " $p1,$p2=$r3")
1370        (+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-13-1 y)
1371           (f-12-1 c) p2 r3 ign_19_6 p1 qp)
1372        ()
1373        ()
1374        )
1375 )
1376
1377 (define-pmacro (I-I17-ctype mnemonic ctype op x2 ta tb y c)
1378   (I-I17 (.sym mnemonic
1379                (.eval (if (eq? (string-length ctype) 0) "" "."))
1380                ctype)
1381          (.eval (if (eq? (string-length ctype) 0) 'NONE
1382                     (string->symbol ctype)))
1383          op x2 ta tb y c)
1384 )
1385
1386 (I-I17-ctype tnat.z  ""         5 0 0 0 0 0)
1387 (I-I17-ctype tnat.z  "unc"      5 0 0 0 0 1)
1388 (I-I17-ctype tnat.z  "and"      5 0 0 1 0 0)
1389 (I-I17-ctype tnat.nz "and"      5 0 0 1 0 1)
1390 (I-I17-ctype tnat.z  "or"       5 0 1 0 0 0)
1391 (I-I17-ctype tnat.nz "or"       5 0 1 0 0 1)
1392 (I-I17-ctype tnat.z  "or.andcm" 5 0 1 1 0 0)
1393 (I-I17-ctype tnat.nz "or.andcm" 5 0 1 1 0 1)
1394
1395 (define-pmacro (I-I18 mnemonic op vc)
1396   (dni mnemonic
1397        (.str "Move Long Immediate, " mnemonic)
1398        ((FORMAT I18))
1399        (.str mnemonic " $r1=$imm64")
1400        (+ (f-opcode op) (f-20-1 vc) r1 imm64 qp)
1401        ()
1402        ()
1403        )
1404 )
1405
1406 (I-I18 movl     6 0)
1407
1408 (define-pmacro (I-I19 mnemonic op x3 x6)
1409   (dni mnemonic
1410        (.str "Break/Nop, " mnemonic)
1411        ((FORMAT I19))
1412        (.str mnemonic " $imm21")
1413        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_26_1 imm21 qp)
1414        ()
1415        ()
1416        )
1417 )
1418
1419 (I-I19 break.i  0 0 0)
1420 (I-I19 nop.i    0 0 1)
1421
1422 (define-pmacro (I-I20 mnemonic op x3)
1423   (dni mnemonic
1424        (.str "Integer Speculation Check, " mnemonic)
1425        ((FORMAT I20))
1426        (.str mnemonic " $r2,$tgt25a")
1427        (+ (f-opcode op) (f-35-3 x3) tgt25a r2 qp)
1428        ()
1429        ()
1430        )
1431 )
1432
1433 (I-I20 chk.s.i  0 1)
1434
1435 (define-pmacro (I-I21 mnemonic op x3 x)
1436   (dni (.sym mnemonic _tbr)
1437        (.str "Move to BR, " mnemonic)
1438        ((FORMAT I21))
1439        (.str mnemonic
1440              "$movbr_mwh$movbr_ih $b1=$r2,$tag13a")
1441        (+ (f-opcode op) (f-35-3 x3) movbr_ih (f-22-1 x) movbr_mwh
1442           (f-12-1 x) (f-11-3 x3) ign_36_1 b1 r2 tag13a qp)
1443        ()
1444        ()
1445        )
1446 )
1447
1448 (I-I21 mov      0 7 0)
1449 (I-I21 mov.ret  0 7 1)
1450
1451 (define-pmacro (I-I22 mnemonic op x3 x6)
1452   (dni (.sym mnemonic _fbr)
1453        (.str "Move from BR, " mnemonic)
1454        ((FORMAT I22))
1455        (.str mnemonic " $r1=$b2")
1456        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_26_11
1457           r1 b2 qp)
1458        ()
1459        ()
1460        )
1461 )
1462
1463 (I-I22 mov      0 0 #x31)
1464
1465 (define-pmacro (I-I23 mnemonic op x3)
1466   (dni (.sym mnemonic _tpr)
1467        (.str "Move to PR, reg, " mnemonic)
1468        ((FORMAT I23))
1469        (.str mnemonic " pr=$r2,$imm17")
1470        (+ (f-opcode op) (f-35-3 x3) ign_32_1 ign_23_4 r2 imm17 qp)
1471        ()
1472        ()
1473        )
1474 )
1475
1476 (I-I23 mov      0 3)
1477
1478 (define-pmacro (I-I24 mnemonic op x3)
1479   (dni (.sym mnemonic _tpri)
1480        (.str "Move to PR, imm, " mnemonic)
1481        ((FORMAT I24))
1482        (.str mnemonic " pr.rot=$imm44")
1483        (+ (f-opcode op) (f-35-3 x3) imm44 qp)
1484        ()
1485        ()
1486        )
1487 )
1488
1489 (I-I24 mov      0 2)
1490
1491 (define-pmacro (I-I25 mnemonic src op x3 x6)
1492   (dni (.sym mnemonic _f src)
1493        (.str "Move from Pred/IP, " mnemonic)
1494        ((FORMAT I25))
1495        (.str mnemonic " $r1=" src)
1496        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_26_7 ign_19_7 r1 qp)
1497        ()
1498        ()
1499        )
1500 )
1501
1502 (I-I25 mov ip   0 0 #x30)
1503 (I-I25 mov pr   0 0 #x33)
1504
1505 (define-pmacro (I-I26 mnemonic op x3 x6)
1506   (dni (.sym mnemonic _tar)
1507        (.str "Move to AR, reg, " mnemonic)
1508        ((FORMAT I26))
1509        (.str mnemonic " $ar3=$r2")
1510        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_12_7 ar3 r2 qp)
1511        ()
1512        ()
1513        )
1514 )
1515
1516 (I-I26 mov.i    0 0 #x2A)
1517
1518 (define-pmacro (I-I27 mnemonic op x3 x6)
1519   (dni (.sym mnemonic _tari)
1520        (.str "Move to AR, imm, " mnemonic)
1521        ((FORMAT I27))
1522        (.str mnemonic " $ar3=$imm8")
1523        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_12_7 ar3 imm8 qp)
1524        ()
1525        ()
1526        )
1527 )
1528
1529 (I-I27 mov.i    0 0 #x0A)
1530
1531 (define-pmacro (I-I28 mnemonic op x3 x6)
1532   (dni (.sym mnemonic _far)
1533        (.str "Move from AR, " mnemonic)
1534        ((FORMAT I28))
1535        (.str mnemonic " $r1=$ar3")
1536        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 ar3 r1 qp)
1537        ()
1538        ()
1539        )
1540 )
1541
1542 (I-I28 mov.i    0 0 #x32)
1543
1544 (define-pmacro (I-I29 mnemonic op x3 x6)
1545   (dni mnemonic
1546        (.str "Sign/Zero Extend/Compute Zero Index, " mnemonic)
1547        ((FORMAT I29))
1548        (.str mnemonic " $r1=$r3")
1549        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 r3 r1 qp)
1550        ()
1551        ()
1552        )
1553 )
1554
1555 (I-I29 zxt1     0 0 #x10)
1556 (I-I29 zxt2     0 0 #x11)
1557 (I-I29 zxt4     0 0 #x12)
1558
1559 (I-I29 sxt1     0 0 #x14)
1560 (I-I29 sxt2     0 0 #x15)
1561 (I-I29 sxt4     0 0 #x16)
1562
1563 (I-I29 czx1.l   0 0 #x18)
1564 (I-I29 czx2.l   0 0 #x19)
1565 (I-I29 czx1.r   0 0 #x1C)
1566 (I-I29 czx2.r   0 0 #x1D)
1567 \f
1568 ;;; "M" Format Instruction definitions.
1569
1570 (define-pmacro (apply-ildspec macro mnemonic x6-2)
1571   (begin
1572     (.apply macro (.splice mnemonic             x6-2))
1573     (.apply macro (.splice (.sym mnemonic .s)   (.eval (+ x6-2 #x04))))
1574     (.apply macro (.splice (.sym mnemonic .a)   (.eval (+ x6-2 #x08))))
1575     (.apply macro (.splice (.sym mnemonic .sa)  (.eval (+ x6-2 #x0C))))
1576     (.apply macro (.splice (.sym mnemonic .bias) (.eval (+ x6-2 #x10))))
1577     (.apply macro (.splice (.sym mnemonic .acq)  (.eval (+ x6-2 #x14))))
1578     (.apply macro (.splice (.sym mnemonic .c.clr) (.eval (+ x6-2 #x20))))
1579     (.apply macro (.splice (.sym mnemonic .c.nc)  (.eval (+ x6-2 #x24))))
1580     (.apply macro (.splice (.sym mnemonic .c.clr.acq)  (.eval (+ x6-2 #x28))))
1581     )
1582 )
1583
1584 (define-pmacro (I-M1 mnemonic op m x x6)
1585   (dni mnemonic
1586        (.str "Integer Load, " mnemonic)
1587        ((FORMAT M1))
1588        (.str mnemonic "$ldhint $r1=[$r3]")
1589        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1590           r3 r1 ign_19_7 qp)
1591        ()
1592        ()
1593        )
1594 )
1595
1596 (apply-ildspec
1597  (.pmacro (mnemonic x6)
1598           (I-M1 mnemonic 4 0 0 x6))
1599  ld1 0)
1600
1601 (apply-ildspec
1602  (.pmacro (mnemonic x6)
1603           (I-M1 mnemonic 4 0 0 x6))
1604  ld2 1)
1605
1606 (apply-ildspec
1607  (.pmacro (mnemonic x6)
1608           (I-M1 mnemonic 4 0 0 x6))
1609  ld4 2)
1610
1611 (apply-ildspec
1612  (.pmacro (mnemonic x6)
1613           (I-M1 mnemonic 4 0 0 x6))
1614  ld8 3)
1615
1616 (I-M1 ld8.fill 4 0 0 #x1B)
1617
1618 (define-pmacro (I-M2 mnemonic op m x x6)
1619   (dni (.sym mnemonic .ir)
1620        (.str "Integer Load, incr reg, " mnemonic)
1621        ((FORMAT M2))
1622        (.str mnemonic "$ldhint $r1=[$r3],$r2")
1623        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1624           r3 r2 r1 qp)
1625        ()
1626        ()
1627        )
1628 )
1629
1630 (apply-ildspec
1631  (.pmacro (mnemonic x6)
1632           (I-M2 mnemonic 4 1 0 x6))
1633  ld1 0)
1634
1635 (apply-ildspec
1636  (.pmacro (mnemonic x6)
1637           (I-M2 mnemonic 4 1 0 x6))
1638  ld2 1)
1639
1640 (apply-ildspec
1641  (.pmacro (mnemonic x6)
1642           (I-M2 mnemonic 4 1 0 x6))
1643  ld4 2)
1644
1645 (apply-ildspec
1646  (.pmacro (mnemonic x6)
1647           (I-M2 mnemonic 4 1 0 x6))
1648  ld8 3)
1649
1650 (I-M2 ld8.fill 4 1 0 #x1B)
1651
1652 (define-pmacro (I-M3 mnemonic op x6)
1653   (dni (.sym mnemonic .ii)
1654        (.str "Integer Load, incr imm, " mnemonic)
1655        ((FORMAT M3))
1656        (.str mnemonic "$ldhint $r1=[$r3],$imm9a")
1657        (+ (f-opcode op) (f-35-6 x6) ldhint r3 imm9a r1 qp)
1658        ()
1659        ()
1660        )
1661 )
1662
1663 (apply-ildspec
1664  (.pmacro (mnemonic x6)
1665           (I-M3 mnemonic 5 x6))
1666  ld1 0)
1667
1668 (apply-ildspec
1669  (.pmacro (mnemonic x6)
1670           (I-M3 mnemonic 5 x6))
1671  ld2 1)
1672
1673 (apply-ildspec
1674  (.pmacro (mnemonic x6)
1675           (I-M3 mnemonic 5 x6))
1676  ld4 2)
1677
1678 (apply-ildspec
1679  (.pmacro (mnemonic x6)
1680           (I-M3 mnemonic 5 x6))
1681  ld8 3)
1682
1683 (I-M3 ld8.fill 5 #x1B)
1684
1685 (define-pmacro (apply-istspec macro mnemonic x6-2)
1686   (begin
1687     (.apply macro (.splice mnemonic             x6-2))
1688     (.apply macro (.splice (.sym mnemonic .rel) (.eval (+ x6-2 #x04))))
1689     )
1690 )
1691
1692 (define-pmacro (I-M4 mnemonic op m x x6)
1693   (dni mnemonic
1694        (.str "Integer Store, " mnemonic)
1695        ((FORMAT M4))
1696        (.str mnemonic "$sthint [$r3]=$r2")
1697        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
1698           sthint r3 r2 ign_12_7 qp)
1699        ()
1700        ()
1701        )
1702 )
1703
1704 (apply-istspec
1705  (.pmacro (mnemonic x6)
1706           (I-M4 mnemonic 4 0 0 x6))
1707  st1 #x30)
1708
1709 (apply-istspec
1710  (.pmacro (mnemonic x6)
1711           (I-M4 mnemonic 4 0 0 x6))
1712  st2 #x31)
1713
1714 (apply-istspec
1715  (.pmacro (mnemonic x6)
1716           (I-M4 mnemonic 4 0 0 x6))
1717  st4 #x32)
1718
1719 (apply-istspec
1720  (.pmacro (mnemonic x6)
1721           (I-M4 mnemonic 4 0 0 x6))
1722  st8 #x33)
1723
1724 (I-M4 st8.spill 4 0 0 #x3B)
1725
1726 (define-pmacro (I-M5 mnemonic op x6)
1727   (dni (.sym mnemonic .ii)
1728        (.str "Integer Store, incr imm, " mnemonic)
1729        ((FORMAT M5))
1730        (.str mnemonic "$sthint [$r3]=$r2,$imm9b")
1731        (+ (f-opcode op) (f-35-6 x6) sthint r3 imm9b r2 qp)
1732        ()
1733        ()
1734        )
1735 )
1736
1737 (apply-istspec
1738  (.pmacro (mnemonic x6)
1739           (I-M5 mnemonic 5 x6))
1740  st1 #x30)
1741
1742 (apply-istspec
1743  (.pmacro (mnemonic x6)
1744           (I-M5 mnemonic 5 x6))
1745  st2 #x31)
1746
1747 (apply-istspec
1748  (.pmacro (mnemonic x6)
1749           (I-M5 mnemonic 5 x6))
1750  st4 #x32)
1751
1752 (apply-istspec
1753  (.pmacro (mnemonic x6)
1754           (I-M5 mnemonic 5 x6))
1755  st8 #x33)
1756
1757 (I-M5 st8.spill 5 #x3B)
1758
1759 (define-pmacro (apply-fldspec macro mnemonic x6-2)
1760   (begin
1761     (.apply macro (.splice mnemonic               x6-2))
1762     (.apply macro (.splice (.sym mnemonic .s)     (.eval (+ x6-2 #x04))))
1763     (.apply macro (.splice (.sym mnemonic .a)     (.eval (+ x6-2 #x08))))
1764     (.apply macro (.splice (.sym mnemonic .sa)    (.eval (+ x6-2 #x0C))))
1765     (.apply macro (.splice (.sym mnemonic .c.clr) (.eval (+ x6-2 #x20))))
1766     (.apply macro (.splice (.sym mnemonic .c.nc)  (.eval (+ x6-2 #x24))))
1767     )
1768 )
1769
1770 (define-pmacro (I-M6 mnemonic op m x x6)
1771   (dni mnemonic
1772        (.str "Floating-point Load, " mnemonic)
1773        ((FORMAT M6))
1774        (.str mnemonic "$ldhint $f1=[$r3]")
1775        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1776           r3 f1 ign_19_7 qp)
1777        ()
1778        ()
1779        )
1780 )
1781
1782 (apply-fldspec
1783  (.pmacro (mnemonic x6)
1784           (I-M6 mnemonic 6 0 0 x6))
1785  ldfs 2)
1786
1787 (apply-fldspec
1788  (.pmacro (mnemonic x6)
1789           (I-M6 mnemonic 6 0 0 x6))
1790  ldfd 3)
1791
1792 (apply-fldspec
1793  (.pmacro (mnemonic x6)
1794           (I-M6 mnemonic 6 0 0 x6))
1795  ldf8 1)
1796
1797 (apply-fldspec
1798  (.pmacro (mnemonic x6)
1799           (I-M6 mnemonic 6 0 0 x6))
1800  ldfe 0)
1801
1802 (I-M6 ldf.fill  6 0 0 #x1B)
1803
1804 (define-pmacro (I-M7 mnemonic op m x x6)
1805   (dni (.sym mnemonic .ir)
1806        (.str "Floating-point Load, incr reg, " mnemonic)
1807        ((FORMAT M7))
1808        (.str mnemonic "$ldhint $f1=[$r3],$r2")
1809        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1810           r3 r2 f1 qp)
1811        ()
1812        ()
1813        )
1814 )
1815
1816 (apply-fldspec
1817  (.pmacro (mnemonic x6)
1818           (I-M7 mnemonic 6 1 0 x6))
1819  ldfs 2)
1820
1821 (apply-fldspec
1822  (.pmacro (mnemonic x6)
1823           (I-M7 mnemonic 6 1 0 x6))
1824  ldfd 3)
1825
1826 (apply-fldspec
1827  (.pmacro (mnemonic x6)
1828           (I-M7 mnemonic 6 1 0 x6))
1829  ldf8 1)
1830
1831 (apply-fldspec
1832  (.pmacro (mnemonic x6)
1833           (I-M7 mnemonic 6 1 0 x6))
1834  ldfe 0)
1835
1836 (I-M7 ldf.fill  6 1 0 #x1B)
1837
1838 (define-pmacro (I-M8 mnemonic op x6)
1839   (dni (.sym mnemonic .ii)
1840        (.str "Floating-point Load, incr imm, " mnemonic)
1841        ((FORMAT M8))
1842        (.str mnemonic "$ldhint $f1=[$r3],$imm9a")
1843        (+ (f-opcode op) (f-35-6 x6) ldhint r3 imm9a f1 qp)
1844        ()
1845        ()
1846        )
1847 )
1848
1849 (apply-fldspec
1850  (.pmacro (mnemonic x6)
1851           (I-M8 mnemonic 7 x6))
1852  ldfs 2)
1853
1854 (apply-fldspec
1855  (.pmacro (mnemonic x6)
1856           (I-M8 mnemonic 7 x6))
1857  ldfd 3)
1858
1859 (apply-fldspec
1860  (.pmacro (mnemonic x6)
1861           (I-M8 mnemonic 7 x6))
1862  ldf8 1)
1863
1864 (apply-fldspec
1865  (.pmacro (mnemonic x6)
1866           (I-M8 mnemonic 7 x6))
1867  ldfe 0)
1868
1869 (I-M8 ldf.fill  7 #x1B)
1870
1871 (define-pmacro (I-M9 mnemonic op m x x6)
1872   (dni mnemonic
1873        (.str "Floating-point Store, " mnemonic)
1874        ((FORMAT M9))
1875        (.str mnemonic "$sthint [$r3]=$f2")
1876        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
1877           sthint r3 f2 ign_12_7 qp)
1878        ()
1879        ()
1880        )
1881 )
1882
1883 (I-M9 stfs              6 0 0 #x32)
1884 (I-M9 stfd              6 0 0 #x33)
1885 (I-M9 stf8              6 0 0 #x31)
1886 (I-M9 stfe              6 0 0 #x30)
1887 (I-M9 stf.spill         6 0 0 #x3B)
1888
1889 (define-pmacro (I-M10 mnemonic op x6)
1890   (dni (.sym mnemonic .ii)
1891        (.str "Floating-point Store, incr imm, " mnemonic)
1892        ((FORMAT M10))
1893        (.str mnemonic "$sthint [$r3]=$f2,$imm9b")
1894        (+ (f-opcode op) (f-35-6 x6) sthint r3 imm9b f2 qp)
1895        ()
1896        ()
1897        )
1898 )
1899
1900 (I-M10 stfs             7 #x32)
1901 (I-M10 stfd             7 #x33)
1902 (I-M10 stf8             7 #x31)
1903 (I-M10 stfe             7 #x30)
1904 (I-M10 stf.spill        7 #x3B)
1905
1906 (define-pmacro (I-M11 mnemonic op m x x6)
1907   (dni mnemonic
1908        (.str "Floating-point Load Pair, " mnemonic)
1909        ((FORMAT M11))
1910        (.str mnemonic "$ldhint $f1,$f2=[$r3]")
1911        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1912           r3 f1 f2 qp)
1913        ()
1914        ()
1915        )
1916 )
1917
1918 (apply-fldspec
1919  (.pmacro (mnemonic x6)
1920           (I-M11 mnemonic 6 0 1 x6))
1921  ldfps 2)
1922
1923 (apply-fldspec
1924  (.pmacro (mnemonic x6)
1925           (I-M11 mnemonic 6 0 1 x6))
1926  ldfpd 3)
1927
1928 (apply-fldspec
1929  (.pmacro (mnemonic x6)
1930           (I-M11 mnemonic 6 0 1 x6))
1931  ldfp8 1)
1932
1933 (define-pmacro (I-M12 mnemonic n op m x x6)
1934   (dni mnemonic
1935        (.str "Floating-point Load Pair, incr imm, " mnemonic)
1936        ((FORMAT M12))
1937        (.str mnemonic "$ldhint $f1,$f2=[$r3]," n)
1938        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
1939           r3 f1 f2 qp)
1940        ()
1941        ()
1942        )
1943 )
1944
1945 (apply-fldspec
1946  (.pmacro (mnemonic x6)
1947           (I-M12 mnemonic 8 6 1 1 x6))
1948  ldfps 2)
1949
1950 (apply-fldspec
1951  (.pmacro (mnemonic x6)
1952           (I-M12 mnemonic 16 6 1 1 x6))
1953  ldfpd 3)
1954
1955 (apply-fldspec
1956  (.pmacro (mnemonic x6)
1957           (I-M12 mnemonic 16 6 1 1 x6))
1958  ldfp8 1)
1959
1960 (define-pmacro (apply-lftype macro mnemonic)
1961   (begin
1962     (.apply macro (.splice mnemonic                     NONE    #x2C))
1963     (.apply macro (.splice (.sym mnemonic .excl)        NONE    #x2D))
1964     (.apply macro (.splice (.sym mnemonic .fault)       fault   #x2E))
1965     (.apply macro (.splice (.sym mnemonic .fault.excl)  fault   #x2F))
1966     )
1967 )
1968
1969 (define-pmacro (I-M13 mnemonic fault-attr op m x x6)
1970   (dni (.sym mnemonic)
1971        (.str "Line Prefetch, " mnemonic)
1972        ((FORMAT M13) (FIELD-LFTYPE fault-attr))
1973        (.str mnemonic "$lfhint [$r3]")
1974        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) lfhint (f-27-1 x)
1975           r3 ign_19_7 ign_12_7 qp)
1976        ()
1977        ()
1978        )
1979 )
1980
1981 (apply-lftype
1982  (.pmacro (mnemonic fault-attr x6)
1983           (I-M13 mnemonic fault-attr 6 0 0 x6))
1984  lfetch)
1985
1986 (define-pmacro (I-M14 mnemonic fault-attr op m x x6)
1987   (dni (.sym mnemonic .ir)
1988        (.str "Line Prefetch, incr reg" mnemonic)
1989        ((FORMAT M14) (FIELD-LFTYPE fault-attr))
1990        (.str mnemonic "$lfhint [$r3],$r2")
1991        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) lfhint (f-27-1 x)
1992           r3 r2 ign_12_7 qp)
1993        ()
1994        ()
1995        )
1996 )
1997
1998 (apply-lftype
1999  (.pmacro (mnemonic fault-attr x6)
2000           (I-M14 mnemonic fault-attr 6 0 0 x6))
2001  lfetch)
2002
2003 (define-pmacro (I-M15 mnemonic fault-attr op x6)
2004   (dni (.sym mnemonic .ii)
2005        (.str "Line Prefetch, incr imm" mnemonic)
2006        ((FORMAT M15) (FIELD-LFTYPE fault-attr))
2007        (.str mnemonic "$lfhint [$r3],$imm9a")
2008        (+ (f-opcode op) (f-35-6 x6) lfhint r3 imm9a ign_12_7 qp)
2009        ()
2010        ()
2011        )
2012 )
2013
2014 (apply-lftype
2015  (.pmacro (mnemonic fault-attr x6)
2016           (I-M15 mnemonic fault-attr 7 x6))
2017  lfetch)
2018
2019 (define-pmacro (I-M16 mnemonic extra op m x x6)
2020   (dni mnemonic
2021        (.str "Exchange/Compare and Exchange, " mnemonic)
2022        ((FORMAT M16))
2023        (.str mnemonic "$ldhint $r1=[$r3],$r2" extra)
2024        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
2025           ldhint r3 r2 r1 qp)
2026        ()
2027        ()
2028        )
2029 )
2030
2031 (I-M16 cmpxchg1.acq ",ar.ccv"   4 0 1 #x00)
2032 (I-M16 cmpxchg2.acq ",ar.ccv"   4 0 1 #x01)
2033 (I-M16 cmpxchg4.acq ",ar.ccv"   4 0 1 #x02)
2034 (I-M16 cmpxchg8.acq ",ar.ccv"   4 0 1 #x03)
2035
2036 (I-M16 cmpxchg1.rel ",ar.ccv"   4 0 1 #x04)
2037 (I-M16 cmpxchg2.rel ",ar.ccv"   4 0 1 #x05)
2038 (I-M16 cmpxchg4.rel ",ar.ccv"   4 0 1 #x06)
2039 (I-M16 cmpxchg8.rel ",ar.ccv"   4 0 1 #x07)
2040
2041 (I-M16 xchg1.rel ""             4 0 1 #x08)
2042 (I-M16 xchg2.rel ""             4 0 1 #x09)
2043 (I-M16 xchg4.rel ""             4 0 1 #x0A)
2044 (I-M16 xchg8.rel ""             4 0 1 #x0B)
2045
2046 (define-pmacro (I-M17 mnemonic op m x x6)
2047   (dni mnemonic
2048        (.str "Fetch and Add, " mnemonic)
2049        ((FORMAT M17))
2050        (.str mnemonic "$ldhint $r1=[$r3],$inc3")
2051        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
2052           ldhint r3 ign_19_4 inc3 r1 qp)
2053        ()
2054        ()
2055        )
2056 )
2057
2058 (I-M17 fetchadd4.acq            4 0 1 #x12)
2059 (I-M17 fetchadd8.acq            4 0 1 #x13)
2060 (I-M17 fetchadd4.rel            4 0 1 #x16)
2061 (I-M17 fetchadd8.rel            4 0 1 #x17)
2062
2063 (define-pmacro (I-M18 mnemonic op m x x6)
2064   (dni mnemonic
2065        (.str "Set FR, " mnemonic)
2066        ((FORMAT M18))
2067        (.str mnemonic " $f1=$r2")
2068        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
2069           ign_26_7 ign_29_2 r2 f1 qp)
2070        ()
2071        ()
2072        )
2073 )
2074
2075 (I-M18 setf.sig                 6 0 1 #x1C)
2076 (I-M18 setf.exp                 6 0 1 #x1D)
2077 (I-M18 setf.s                   6 0 1 #x1E)
2078 (I-M18 setf.d                   6 0 1 #x1F)
2079
2080 (define-pmacro (I-M19 mnemonic op m x x6)
2081   (dni mnemonic
2082        (.str "Get FR, " mnemonic)
2083        ((FORMAT M19))
2084        (.str mnemonic " $r1=$f2")
2085        (+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
2086           ign_26_7 ign_29_2 f2 r1 qp)
2087        ()
2088        ()
2089        )
2090 )
2091
2092 (I-M19 getf.sig                 4 0 1 #x1C)
2093 (I-M19 getf.exp                 4 0 1 #x1D)
2094 (I-M19 getf.s                   4 0 1 #x1E)
2095 (I-M19 getf.d                   4 0 1 #x1F)
2096
2097 (define-pmacro (I-M20 mnemonic op x3)
2098   (dni mnemonic
2099        (.str "Integer Speculation Check, " mnemonic)
2100        ((FORMAT M20))
2101        (.str mnemonic " $r2,$tgt25a")
2102        (+ (f-opcode op) (f-35-3 x3) r2 tgt25a qp)
2103        ()
2104        ()
2105        )
2106 )
2107
2108 (I-M20 chk.s.m                  1 1)
2109
2110 (define-pmacro (I-M21 mnemonic op x3)
2111   (dni (.sym mnemonic .f)
2112        (.str "Floating-point Speculation Check, " mnemonic)
2113        ((FORMAT M21))
2114        (.str mnemonic " $f2,$tgt25a")
2115        (+ (f-opcode op) (f-35-3 x3) f2 tgt25a qp)
2116        ()
2117        ()
2118        )
2119 )
2120
2121 (I-M21 chk.s                    1 3)
2122
2123 (define-pmacro (I-M22 mnemonic op x3)
2124   (dni mnemonic
2125        (.str "Integer Advanced Load Check, " mnemonic)
2126        ((FORMAT M22))
2127        (.str mnemonic " $r1,$tgt25c")
2128        (+ (f-opcode op) (f-35-3 x3) tgt25c r1 qp)
2129        ()
2130        ()
2131        )
2132 )
2133
2134 (I-M22 chk.a.nc                 0 4)
2135 (I-M22 chk.a.clr                0 5)
2136
2137 (define-pmacro (I-M23 mnemonic op x3)
2138   (dni (.sym mnemonic .f)
2139        (.str "Floating-point Advanced Load Check, " mnemonic)
2140        ((FORMAT M23))
2141        (.str mnemonic " $f1,$tgt25c")
2142        (+ (f-opcode op) (f-35-3 x3) tgt25c f1 qp)
2143        ()
2144        ()
2145        )
2146 )
2147
2148 (I-M22 chk.a.nc                 0 6)
2149 (I-M22 chk.a.clr                0 7)
2150
2151 (define-pmacro (I-M24 mnemonic op x3 x4 x2)
2152   (dni mnemonic
2153        (.str "Sync/Fence/Serialize/ALAT Control, " mnemonic)
2154        ((FORMAT M24))
2155        (.str mnemonic)
2156        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
2157           ign_36_1 ign_26_7 ign_19_7 ign_12_7 qp)
2158        ()
2159        ()
2160        )
2161 )
2162
2163 (I-M24 invala                   0 0 0 1)
2164 (I-M24 fwb                      0 0 0 2)
2165 (I-M24 mf                       0 0 2 2)
2166 (I-M24 mf.a                     0 0 3 2)
2167 (I-M24 srlz.d                   0 0 0 3)
2168 (I-M24 srlz.i                   0 0 1 3)
2169 (I-M24 sync.i                   0 0 3 3)
2170
2171 (define-pmacro (I-M25 mnemonic op x3 x4 x2)
2172   (dni mnemonic
2173        (.str "RSE Control, " mnemonic)
2174        ((FORMAT M25))
2175        (.str mnemonic)
2176        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
2177           ign_36_1 ign_26_7 ign_19_7 ign_12_7 (f-qp 0))
2178        ()
2179        ()
2180        )
2181 )
2182
2183 (I-M25 flushrs                  0 0 #xC 0)
2184 (I-M25 loadrs                   0 0 #xA 0)
2185
2186 (define-pmacro (I-M26 mnemonic op x3 x4 x2)
2187   (dni mnemonic
2188        (.str "Integer ALAT Entry Invalidate, " mnemonic)
2189        ((FORMAT M26))
2190        (.str mnemonic " $r1")
2191        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
2192           ign_36_1 ign_26_7 ign_19_7 r1 qp)
2193        ()
2194        ()
2195        )
2196 )
2197
2198 (I-M26 invala.e                 0 0 2 1)
2199
2200 (define-pmacro (I-M27 mnemonic op x3 x4 x2)
2201   (dni (.sym mnemonic .f)
2202        (.str "Floating-point ALAT Entry Invalidate, " mnemonic)
2203        ((FORMAT M27))
2204        (.str mnemonic " $f1")
2205        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
2206           ign_36_1 ign_26_7 ign_19_7 f1 qp)
2207        ()
2208        ()
2209        )
2210 )
2211
2212 (I-M27 invala.e                 0 0 3 1)
2213
2214 (define-pmacro (I-M28 mnemonic op x3 x6)
2215   (dni mnemonic
2216        (.str "Flush Cache/Purge Translation Cache Entry, " mnemonic)
2217        ((FORMAT M28))
2218        (.str mnemonic " $r3")
2219        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
2220           ign_36_1 r3 ign_19_7 ign_12_7 qp)
2221        ()
2222        ()
2223        )
2224 )
2225
2226 (I-M28 fc                       1 0 #x30)
2227 (I-M28 ptc.e                    1 0 #x34)
2228
2229 (define-pmacro (I-M29 mnemonic op x3 x6)
2230   (dni (.sym mnemonic _tar)
2231        (.str "Move to AR, reg, " mnemonic)
2232        ((FORMAT M29))
2233        (.str mnemonic " $ar3=$r2")
2234        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
2235           ign_36_1 ar3 r2 ign_12_7 qp)
2236        ()
2237        ()
2238        )
2239 )
2240
2241 (I-M29 mov.m    1 0 #x2A)
2242
2243 (define-pmacro (I-M30 mnemonic op x3 x4 x2)
2244   (dni (.sym mnemonic _tari)
2245        (.str "Move to AR, imm," mnemonic)
2246        ((FORMAT M30))
2247        (.str mnemonic " $ar3=$imm8")
2248        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
2249           ar3 imm8 ign_12_7 qp)
2250        ()
2251        ()
2252        )
2253 )
2254
2255 (I-M30 mov.m    0 0 8 2)
2256
2257 (define-pmacro (I-M31 mnemonic op x3 x6)
2258   (dni (.sym mnemonic _far)
2259        (.str "Move from AR, " mnemonic)
2260        ((FORMAT M31))
2261        (.str mnemonic " $r1=$ar3")
2262        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 ar3 r1 qp)
2263        ()
2264        ()
2265        )
2266 )
2267
2268 (I-M31 mov.m    1 0 #x22)
2269
2270 (define-pmacro (I-M32 mnemonic op x3 x6)
2271   (dni (.sym mnemonic _tcr)
2272        (.str "Move to CR, " mnemonic)
2273        ((FORMAT M32))
2274        (.str mnemonic " $cr3=$r2")
2275        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
2276           ign_36_1 cr3 r2 ign_12_7 qp)
2277        ()
2278        ()
2279        )
2280 )
2281
2282 (I-M32 mov      1 0 #x2C)
2283
2284 (define-pmacro (I-M33 mnemonic op x3 x6)
2285   (dni (.sym mnemonic _fcr)
2286        (.str "Move from CR, " mnemonic)
2287        ((FORMAT M33))
2288        (.str mnemonic " $r1=$cr3")
2289        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
2290           ign_36_1 cr3 ign_19_7 r1 qp)
2291        ()
2292        ()
2293        )
2294 )
2295
2296 (I-M33 mov      1 0 #x24)
2297
2298 (define-pmacro (I-M34 mnemonic op x3)
2299   (dni mnemonic
2300        (.str "Allocate Register Stack Frame, " mnemonic)
2301        ((FORMAT M34))
2302        (.str mnemonic " $r1=ar.pfs,$sorsolsof")
2303        (+ (f-opcode op) (f-35-3 x3) ign_36_1 ign_32_2
2304           sorsolsof r1 (f-qp 0))
2305        ()
2306        ()
2307        )
2308 )
2309
2310 (I-M34 alloc    1 6)
2311
2312 (define-pmacro (I-M35 mnemonic which op x3 x6)
2313   (dni (.sym mnemonic _t which)
2314        (.str "Move to PSR, " mnemonic)
2315        ((FORMAT M35))
2316        (.str mnemonic " " which "=$r2")
2317        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1
2318           r2 ign_26_7 ign_12_7 qp)
2319        ()
2320        ()
2321        )
2322 )
2323
2324 (I-M35 mov psr.l        1 0 #x2D)
2325 (I-M35 mov psr.um       1 0 #x29)
2326
2327 (define-pmacro (I-M36 mnemonic which op x3 x6)
2328   (dni (.sym mnemonic _f which)
2329        (.str "Move from PSR, " mnemonic)
2330        ((FORMAT M35))
2331        (.str mnemonic " $r1=" which)
2332        (+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1
2333           ign_26_7 ign_19_7 r1 qp)
2334        ()
2335        ()
2336        )
2337 )
2338
2339 (I-M36 mov psr          1 0 #x25)
2340 (I-M36 mov psr.um       1 0 #x21)
2341
2342 (define-pmacro (I-M37 mnemonic op x3 x4 x2)
2343   (dni mnemonic
2344        (.str "Break/Nop, " mnemonic)
2345        ((FORMAT M37))
2346        (.str mnemonic " $imm21")
2347        (+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4) ign_26_1 imm21 qp)
2348        ()
2349        ()
2350        )
2351 )
2352
2353 (I-M37 break.m          0 0 0 0)
2354 (I-M37 nop.m            0 0 1 0)
2355