OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [cpu/] [ia64.cpu] - Blame information for rev 6

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.