GNU Linux-libre 4.14.266-gnu1
[releases.git] / arch / tile / include / uapi / arch / opcode_tilepro.h
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* TILEPro opcode information.
3  *
4  * Copyright 2011 Tilera Corporation. All Rights Reserved.
5  *
6  *   This program is free software; you can redistribute it and/or
7  *   modify it under the terms of the GNU General Public License
8  *   as published by the Free Software Foundation, version 2.
9  *
10  *   This program is distributed in the hope that it will be useful, but
11  *   WITHOUT ANY WARRANTY; without even the implied warranty of
12  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
13  *   NON INFRINGEMENT.  See the GNU General Public License for
14  *   more details.
15  *
16  *
17  *
18  *
19  *
20  */
21
22 #ifndef __ARCH_OPCODE_H__
23 #define __ARCH_OPCODE_H__
24
25 #ifndef __ASSEMBLER__
26
27 typedef unsigned long long tilepro_bundle_bits;
28
29 /* This is the bit that determines if a bundle is in the Y encoding. */
30 #define TILEPRO_BUNDLE_Y_ENCODING_MASK ((tilepro_bundle_bits)1 << 63)
31
32 enum
33 {
34   /* Maximum number of instructions in a bundle (2 for X, 3 for Y). */
35   TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE = 3,
36
37   /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */
38   TILEPRO_NUM_PIPELINE_ENCODINGS = 5,
39
40   /* Log base 2 of TILEPRO_BUNDLE_SIZE_IN_BYTES. */
41   TILEPRO_LOG2_BUNDLE_SIZE_IN_BYTES = 3,
42
43   /* Instructions take this many bytes. */
44   TILEPRO_BUNDLE_SIZE_IN_BYTES = 1 << TILEPRO_LOG2_BUNDLE_SIZE_IN_BYTES,
45
46   /* Log base 2 of TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES. */
47   TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES = 3,
48
49   /* Bundles should be aligned modulo this number of bytes. */
50   TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES =
51     (1 << TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES),
52
53   /* Log base 2 of TILEPRO_SN_INSTRUCTION_SIZE_IN_BYTES. */
54   TILEPRO_LOG2_SN_INSTRUCTION_SIZE_IN_BYTES = 1,
55
56   /* Static network instructions take this many bytes. */
57   TILEPRO_SN_INSTRUCTION_SIZE_IN_BYTES =
58     (1 << TILEPRO_LOG2_SN_INSTRUCTION_SIZE_IN_BYTES),
59
60   /* Number of registers (some are magic, such as network I/O). */
61   TILEPRO_NUM_REGISTERS = 64,
62
63   /* Number of static network registers. */
64   TILEPRO_NUM_SN_REGISTERS = 4
65 };
66
67 /* Make a few "tile_" variables to simplify common code between
68    architectures.  */
69
70 typedef tilepro_bundle_bits tile_bundle_bits;
71 #define TILE_BUNDLE_SIZE_IN_BYTES TILEPRO_BUNDLE_SIZE_IN_BYTES
72 #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES
73 #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
74   TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
75 #define TILE_BPT_BUNDLE TILEPRO_BPT_BUNDLE
76
77 /* 64-bit pattern for a { bpt ; nop } bundle. */
78 #define TILEPRO_BPT_BUNDLE 0x400b3cae70166000ULL
79
80 static __inline unsigned int
81 get_BrOff_SN(tilepro_bundle_bits num)
82 {
83   const unsigned int n = (unsigned int)num;
84   return (((n >> 0)) & 0x3ff);
85 }
86
87 static __inline unsigned int
88 get_BrOff_X1(tilepro_bundle_bits n)
89 {
90   return (((unsigned int)(n >> 43)) & 0x00007fff) |
91          (((unsigned int)(n >> 20)) & 0x00018000);
92 }
93
94 static __inline unsigned int
95 get_BrType_X1(tilepro_bundle_bits n)
96 {
97   return (((unsigned int)(n >> 31)) & 0xf);
98 }
99
100 static __inline unsigned int
101 get_Dest_Imm8_X1(tilepro_bundle_bits n)
102 {
103   return (((unsigned int)(n >> 31)) & 0x0000003f) |
104          (((unsigned int)(n >> 43)) & 0x000000c0);
105 }
106
107 static __inline unsigned int
108 get_Dest_SN(tilepro_bundle_bits num)
109 {
110   const unsigned int n = (unsigned int)num;
111   return (((n >> 2)) & 0x3);
112 }
113
114 static __inline unsigned int
115 get_Dest_X0(tilepro_bundle_bits num)
116 {
117   const unsigned int n = (unsigned int)num;
118   return (((n >> 0)) & 0x3f);
119 }
120
121 static __inline unsigned int
122 get_Dest_X1(tilepro_bundle_bits n)
123 {
124   return (((unsigned int)(n >> 31)) & 0x3f);
125 }
126
127 static __inline unsigned int
128 get_Dest_Y0(tilepro_bundle_bits num)
129 {
130   const unsigned int n = (unsigned int)num;
131   return (((n >> 0)) & 0x3f);
132 }
133
134 static __inline unsigned int
135 get_Dest_Y1(tilepro_bundle_bits n)
136 {
137   return (((unsigned int)(n >> 31)) & 0x3f);
138 }
139
140 static __inline unsigned int
141 get_Imm16_X0(tilepro_bundle_bits num)
142 {
143   const unsigned int n = (unsigned int)num;
144   return (((n >> 12)) & 0xffff);
145 }
146
147 static __inline unsigned int
148 get_Imm16_X1(tilepro_bundle_bits n)
149 {
150   return (((unsigned int)(n >> 43)) & 0xffff);
151 }
152
153 static __inline unsigned int
154 get_Imm8_SN(tilepro_bundle_bits num)
155 {
156   const unsigned int n = (unsigned int)num;
157   return (((n >> 0)) & 0xff);
158 }
159
160 static __inline unsigned int
161 get_Imm8_X0(tilepro_bundle_bits num)
162 {
163   const unsigned int n = (unsigned int)num;
164   return (((n >> 12)) & 0xff);
165 }
166
167 static __inline unsigned int
168 get_Imm8_X1(tilepro_bundle_bits n)
169 {
170   return (((unsigned int)(n >> 43)) & 0xff);
171 }
172
173 static __inline unsigned int
174 get_Imm8_Y0(tilepro_bundle_bits num)
175 {
176   const unsigned int n = (unsigned int)num;
177   return (((n >> 12)) & 0xff);
178 }
179
180 static __inline unsigned int
181 get_Imm8_Y1(tilepro_bundle_bits n)
182 {
183   return (((unsigned int)(n >> 43)) & 0xff);
184 }
185
186 static __inline unsigned int
187 get_ImmOpcodeExtension_X0(tilepro_bundle_bits num)
188 {
189   const unsigned int n = (unsigned int)num;
190   return (((n >> 20)) & 0x7f);
191 }
192
193 static __inline unsigned int
194 get_ImmOpcodeExtension_X1(tilepro_bundle_bits n)
195 {
196   return (((unsigned int)(n >> 51)) & 0x7f);
197 }
198
199 static __inline unsigned int
200 get_ImmRROpcodeExtension_SN(tilepro_bundle_bits num)
201 {
202   const unsigned int n = (unsigned int)num;
203   return (((n >> 8)) & 0x3);
204 }
205
206 static __inline unsigned int
207 get_JOffLong_X1(tilepro_bundle_bits n)
208 {
209   return (((unsigned int)(n >> 43)) & 0x00007fff) |
210          (((unsigned int)(n >> 20)) & 0x00018000) |
211          (((unsigned int)(n >> 14)) & 0x001e0000) |
212          (((unsigned int)(n >> 16)) & 0x07e00000) |
213          (((unsigned int)(n >> 31)) & 0x18000000);
214 }
215
216 static __inline unsigned int
217 get_JOff_X1(tilepro_bundle_bits n)
218 {
219   return (((unsigned int)(n >> 43)) & 0x00007fff) |
220          (((unsigned int)(n >> 20)) & 0x00018000) |
221          (((unsigned int)(n >> 14)) & 0x001e0000) |
222          (((unsigned int)(n >> 16)) & 0x07e00000) |
223          (((unsigned int)(n >> 31)) & 0x08000000);
224 }
225
226 static __inline unsigned int
227 get_MF_Imm15_X1(tilepro_bundle_bits n)
228 {
229   return (((unsigned int)(n >> 37)) & 0x00003fff) |
230          (((unsigned int)(n >> 44)) & 0x00004000);
231 }
232
233 static __inline unsigned int
234 get_MMEnd_X0(tilepro_bundle_bits num)
235 {
236   const unsigned int n = (unsigned int)num;
237   return (((n >> 18)) & 0x1f);
238 }
239
240 static __inline unsigned int
241 get_MMEnd_X1(tilepro_bundle_bits n)
242 {
243   return (((unsigned int)(n >> 49)) & 0x1f);
244 }
245
246 static __inline unsigned int
247 get_MMStart_X0(tilepro_bundle_bits num)
248 {
249   const unsigned int n = (unsigned int)num;
250   return (((n >> 23)) & 0x1f);
251 }
252
253 static __inline unsigned int
254 get_MMStart_X1(tilepro_bundle_bits n)
255 {
256   return (((unsigned int)(n >> 54)) & 0x1f);
257 }
258
259 static __inline unsigned int
260 get_MT_Imm15_X1(tilepro_bundle_bits n)
261 {
262   return (((unsigned int)(n >> 31)) & 0x0000003f) |
263          (((unsigned int)(n >> 37)) & 0x00003fc0) |
264          (((unsigned int)(n >> 44)) & 0x00004000);
265 }
266
267 static __inline unsigned int
268 get_Mode(tilepro_bundle_bits n)
269 {
270   return (((unsigned int)(n >> 63)) & 0x1);
271 }
272
273 static __inline unsigned int
274 get_NoRegOpcodeExtension_SN(tilepro_bundle_bits num)
275 {
276   const unsigned int n = (unsigned int)num;
277   return (((n >> 0)) & 0xf);
278 }
279
280 static __inline unsigned int
281 get_Opcode_SN(tilepro_bundle_bits num)
282 {
283   const unsigned int n = (unsigned int)num;
284   return (((n >> 10)) & 0x3f);
285 }
286
287 static __inline unsigned int
288 get_Opcode_X0(tilepro_bundle_bits num)
289 {
290   const unsigned int n = (unsigned int)num;
291   return (((n >> 28)) & 0x7);
292 }
293
294 static __inline unsigned int
295 get_Opcode_X1(tilepro_bundle_bits n)
296 {
297   return (((unsigned int)(n >> 59)) & 0xf);
298 }
299
300 static __inline unsigned int
301 get_Opcode_Y0(tilepro_bundle_bits num)
302 {
303   const unsigned int n = (unsigned int)num;
304   return (((n >> 27)) & 0xf);
305 }
306
307 static __inline unsigned int
308 get_Opcode_Y1(tilepro_bundle_bits n)
309 {
310   return (((unsigned int)(n >> 59)) & 0xf);
311 }
312
313 static __inline unsigned int
314 get_Opcode_Y2(tilepro_bundle_bits n)
315 {
316   return (((unsigned int)(n >> 56)) & 0x7);
317 }
318
319 static __inline unsigned int
320 get_RROpcodeExtension_SN(tilepro_bundle_bits num)
321 {
322   const unsigned int n = (unsigned int)num;
323   return (((n >> 4)) & 0xf);
324 }
325
326 static __inline unsigned int
327 get_RRROpcodeExtension_X0(tilepro_bundle_bits num)
328 {
329   const unsigned int n = (unsigned int)num;
330   return (((n >> 18)) & 0x1ff);
331 }
332
333 static __inline unsigned int
334 get_RRROpcodeExtension_X1(tilepro_bundle_bits n)
335 {
336   return (((unsigned int)(n >> 49)) & 0x1ff);
337 }
338
339 static __inline unsigned int
340 get_RRROpcodeExtension_Y0(tilepro_bundle_bits num)
341 {
342   const unsigned int n = (unsigned int)num;
343   return (((n >> 18)) & 0x3);
344 }
345
346 static __inline unsigned int
347 get_RRROpcodeExtension_Y1(tilepro_bundle_bits n)
348 {
349   return (((unsigned int)(n >> 49)) & 0x3);
350 }
351
352 static __inline unsigned int
353 get_RouteOpcodeExtension_SN(tilepro_bundle_bits num)
354 {
355   const unsigned int n = (unsigned int)num;
356   return (((n >> 0)) & 0x3ff);
357 }
358
359 static __inline unsigned int
360 get_S_X0(tilepro_bundle_bits num)
361 {
362   const unsigned int n = (unsigned int)num;
363   return (((n >> 27)) & 0x1);
364 }
365
366 static __inline unsigned int
367 get_S_X1(tilepro_bundle_bits n)
368 {
369   return (((unsigned int)(n >> 58)) & 0x1);
370 }
371
372 static __inline unsigned int
373 get_ShAmt_X0(tilepro_bundle_bits num)
374 {
375   const unsigned int n = (unsigned int)num;
376   return (((n >> 12)) & 0x1f);
377 }
378
379 static __inline unsigned int
380 get_ShAmt_X1(tilepro_bundle_bits n)
381 {
382   return (((unsigned int)(n >> 43)) & 0x1f);
383 }
384
385 static __inline unsigned int
386 get_ShAmt_Y0(tilepro_bundle_bits num)
387 {
388   const unsigned int n = (unsigned int)num;
389   return (((n >> 12)) & 0x1f);
390 }
391
392 static __inline unsigned int
393 get_ShAmt_Y1(tilepro_bundle_bits n)
394 {
395   return (((unsigned int)(n >> 43)) & 0x1f);
396 }
397
398 static __inline unsigned int
399 get_SrcA_X0(tilepro_bundle_bits num)
400 {
401   const unsigned int n = (unsigned int)num;
402   return (((n >> 6)) & 0x3f);
403 }
404
405 static __inline unsigned int
406 get_SrcA_X1(tilepro_bundle_bits n)
407 {
408   return (((unsigned int)(n >> 37)) & 0x3f);
409 }
410
411 static __inline unsigned int
412 get_SrcA_Y0(tilepro_bundle_bits num)
413 {
414   const unsigned int n = (unsigned int)num;
415   return (((n >> 6)) & 0x3f);
416 }
417
418 static __inline unsigned int
419 get_SrcA_Y1(tilepro_bundle_bits n)
420 {
421   return (((unsigned int)(n >> 37)) & 0x3f);
422 }
423
424 static __inline unsigned int
425 get_SrcA_Y2(tilepro_bundle_bits n)
426 {
427   return (((n >> 26)) & 0x00000001) |
428          (((unsigned int)(n >> 50)) & 0x0000003e);
429 }
430
431 static __inline unsigned int
432 get_SrcBDest_Y2(tilepro_bundle_bits num)
433 {
434   const unsigned int n = (unsigned int)num;
435   return (((n >> 20)) & 0x3f);
436 }
437
438 static __inline unsigned int
439 get_SrcB_X0(tilepro_bundle_bits num)
440 {
441   const unsigned int n = (unsigned int)num;
442   return (((n >> 12)) & 0x3f);
443 }
444
445 static __inline unsigned int
446 get_SrcB_X1(tilepro_bundle_bits n)
447 {
448   return (((unsigned int)(n >> 43)) & 0x3f);
449 }
450
451 static __inline unsigned int
452 get_SrcB_Y0(tilepro_bundle_bits num)
453 {
454   const unsigned int n = (unsigned int)num;
455   return (((n >> 12)) & 0x3f);
456 }
457
458 static __inline unsigned int
459 get_SrcB_Y1(tilepro_bundle_bits n)
460 {
461   return (((unsigned int)(n >> 43)) & 0x3f);
462 }
463
464 static __inline unsigned int
465 get_Src_SN(tilepro_bundle_bits num)
466 {
467   const unsigned int n = (unsigned int)num;
468   return (((n >> 0)) & 0x3);
469 }
470
471 static __inline unsigned int
472 get_UnOpcodeExtension_X0(tilepro_bundle_bits num)
473 {
474   const unsigned int n = (unsigned int)num;
475   return (((n >> 12)) & 0x1f);
476 }
477
478 static __inline unsigned int
479 get_UnOpcodeExtension_X1(tilepro_bundle_bits n)
480 {
481   return (((unsigned int)(n >> 43)) & 0x1f);
482 }
483
484 static __inline unsigned int
485 get_UnOpcodeExtension_Y0(tilepro_bundle_bits num)
486 {
487   const unsigned int n = (unsigned int)num;
488   return (((n >> 12)) & 0x1f);
489 }
490
491 static __inline unsigned int
492 get_UnOpcodeExtension_Y1(tilepro_bundle_bits n)
493 {
494   return (((unsigned int)(n >> 43)) & 0x1f);
495 }
496
497 static __inline unsigned int
498 get_UnShOpcodeExtension_X0(tilepro_bundle_bits num)
499 {
500   const unsigned int n = (unsigned int)num;
501   return (((n >> 17)) & 0x3ff);
502 }
503
504 static __inline unsigned int
505 get_UnShOpcodeExtension_X1(tilepro_bundle_bits n)
506 {
507   return (((unsigned int)(n >> 48)) & 0x3ff);
508 }
509
510 static __inline unsigned int
511 get_UnShOpcodeExtension_Y0(tilepro_bundle_bits num)
512 {
513   const unsigned int n = (unsigned int)num;
514   return (((n >> 17)) & 0x7);
515 }
516
517 static __inline unsigned int
518 get_UnShOpcodeExtension_Y1(tilepro_bundle_bits n)
519 {
520   return (((unsigned int)(n >> 48)) & 0x7);
521 }
522
523
524 static __inline int
525 sign_extend(int n, int num_bits)
526 {
527   int shift = (int)(sizeof(int) * 8 - num_bits);
528   return (n << shift) >> shift;
529 }
530
531
532
533 static __inline tilepro_bundle_bits
534 create_BrOff_SN(int num)
535 {
536   const unsigned int n = (unsigned int)num;
537   return ((n & 0x3ff) << 0);
538 }
539
540 static __inline tilepro_bundle_bits
541 create_BrOff_X1(int num)
542 {
543   const unsigned int n = (unsigned int)num;
544   return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
545          (((tilepro_bundle_bits)(n & 0x00018000)) << 20);
546 }
547
548 static __inline tilepro_bundle_bits
549 create_BrType_X1(int num)
550 {
551   const unsigned int n = (unsigned int)num;
552   return (((tilepro_bundle_bits)(n & 0xf)) << 31);
553 }
554
555 static __inline tilepro_bundle_bits
556 create_Dest_Imm8_X1(int num)
557 {
558   const unsigned int n = (unsigned int)num;
559   return (((tilepro_bundle_bits)(n & 0x0000003f)) << 31) |
560          (((tilepro_bundle_bits)(n & 0x000000c0)) << 43);
561 }
562
563 static __inline tilepro_bundle_bits
564 create_Dest_SN(int num)
565 {
566   const unsigned int n = (unsigned int)num;
567   return ((n & 0x3) << 2);
568 }
569
570 static __inline tilepro_bundle_bits
571 create_Dest_X0(int num)
572 {
573   const unsigned int n = (unsigned int)num;
574   return ((n & 0x3f) << 0);
575 }
576
577 static __inline tilepro_bundle_bits
578 create_Dest_X1(int num)
579 {
580   const unsigned int n = (unsigned int)num;
581   return (((tilepro_bundle_bits)(n & 0x3f)) << 31);
582 }
583
584 static __inline tilepro_bundle_bits
585 create_Dest_Y0(int num)
586 {
587   const unsigned int n = (unsigned int)num;
588   return ((n & 0x3f) << 0);
589 }
590
591 static __inline tilepro_bundle_bits
592 create_Dest_Y1(int num)
593 {
594   const unsigned int n = (unsigned int)num;
595   return (((tilepro_bundle_bits)(n & 0x3f)) << 31);
596 }
597
598 static __inline tilepro_bundle_bits
599 create_Imm16_X0(int num)
600 {
601   const unsigned int n = (unsigned int)num;
602   return ((n & 0xffff) << 12);
603 }
604
605 static __inline tilepro_bundle_bits
606 create_Imm16_X1(int num)
607 {
608   const unsigned int n = (unsigned int)num;
609   return (((tilepro_bundle_bits)(n & 0xffff)) << 43);
610 }
611
612 static __inline tilepro_bundle_bits
613 create_Imm8_SN(int num)
614 {
615   const unsigned int n = (unsigned int)num;
616   return ((n & 0xff) << 0);
617 }
618
619 static __inline tilepro_bundle_bits
620 create_Imm8_X0(int num)
621 {
622   const unsigned int n = (unsigned int)num;
623   return ((n & 0xff) << 12);
624 }
625
626 static __inline tilepro_bundle_bits
627 create_Imm8_X1(int num)
628 {
629   const unsigned int n = (unsigned int)num;
630   return (((tilepro_bundle_bits)(n & 0xff)) << 43);
631 }
632
633 static __inline tilepro_bundle_bits
634 create_Imm8_Y0(int num)
635 {
636   const unsigned int n = (unsigned int)num;
637   return ((n & 0xff) << 12);
638 }
639
640 static __inline tilepro_bundle_bits
641 create_Imm8_Y1(int num)
642 {
643   const unsigned int n = (unsigned int)num;
644   return (((tilepro_bundle_bits)(n & 0xff)) << 43);
645 }
646
647 static __inline tilepro_bundle_bits
648 create_ImmOpcodeExtension_X0(int num)
649 {
650   const unsigned int n = (unsigned int)num;
651   return ((n & 0x7f) << 20);
652 }
653
654 static __inline tilepro_bundle_bits
655 create_ImmOpcodeExtension_X1(int num)
656 {
657   const unsigned int n = (unsigned int)num;
658   return (((tilepro_bundle_bits)(n & 0x7f)) << 51);
659 }
660
661 static __inline tilepro_bundle_bits
662 create_ImmRROpcodeExtension_SN(int num)
663 {
664   const unsigned int n = (unsigned int)num;
665   return ((n & 0x3) << 8);
666 }
667
668 static __inline tilepro_bundle_bits
669 create_JOffLong_X1(int num)
670 {
671   const unsigned int n = (unsigned int)num;
672   return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
673          (((tilepro_bundle_bits)(n & 0x00018000)) << 20) |
674          (((tilepro_bundle_bits)(n & 0x001e0000)) << 14) |
675          (((tilepro_bundle_bits)(n & 0x07e00000)) << 16) |
676          (((tilepro_bundle_bits)(n & 0x18000000)) << 31);
677 }
678
679 static __inline tilepro_bundle_bits
680 create_JOff_X1(int num)
681 {
682   const unsigned int n = (unsigned int)num;
683   return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
684          (((tilepro_bundle_bits)(n & 0x00018000)) << 20) |
685          (((tilepro_bundle_bits)(n & 0x001e0000)) << 14) |
686          (((tilepro_bundle_bits)(n & 0x07e00000)) << 16) |
687          (((tilepro_bundle_bits)(n & 0x08000000)) << 31);
688 }
689
690 static __inline tilepro_bundle_bits
691 create_MF_Imm15_X1(int num)
692 {
693   const unsigned int n = (unsigned int)num;
694   return (((tilepro_bundle_bits)(n & 0x00003fff)) << 37) |
695          (((tilepro_bundle_bits)(n & 0x00004000)) << 44);
696 }
697
698 static __inline tilepro_bundle_bits
699 create_MMEnd_X0(int num)
700 {
701   const unsigned int n = (unsigned int)num;
702   return ((n & 0x1f) << 18);
703 }
704
705 static __inline tilepro_bundle_bits
706 create_MMEnd_X1(int num)
707 {
708   const unsigned int n = (unsigned int)num;
709   return (((tilepro_bundle_bits)(n & 0x1f)) << 49);
710 }
711
712 static __inline tilepro_bundle_bits
713 create_MMStart_X0(int num)
714 {
715   const unsigned int n = (unsigned int)num;
716   return ((n & 0x1f) << 23);
717 }
718
719 static __inline tilepro_bundle_bits
720 create_MMStart_X1(int num)
721 {
722   const unsigned int n = (unsigned int)num;
723   return (((tilepro_bundle_bits)(n & 0x1f)) << 54);
724 }
725
726 static __inline tilepro_bundle_bits
727 create_MT_Imm15_X1(int num)
728 {
729   const unsigned int n = (unsigned int)num;
730   return (((tilepro_bundle_bits)(n & 0x0000003f)) << 31) |
731          (((tilepro_bundle_bits)(n & 0x00003fc0)) << 37) |
732          (((tilepro_bundle_bits)(n & 0x00004000)) << 44);
733 }
734
735 static __inline tilepro_bundle_bits
736 create_Mode(int num)
737 {
738   const unsigned int n = (unsigned int)num;
739   return (((tilepro_bundle_bits)(n & 0x1)) << 63);
740 }
741
742 static __inline tilepro_bundle_bits
743 create_NoRegOpcodeExtension_SN(int num)
744 {
745   const unsigned int n = (unsigned int)num;
746   return ((n & 0xf) << 0);
747 }
748
749 static __inline tilepro_bundle_bits
750 create_Opcode_SN(int num)
751 {
752   const unsigned int n = (unsigned int)num;
753   return ((n & 0x3f) << 10);
754 }
755
756 static __inline tilepro_bundle_bits
757 create_Opcode_X0(int num)
758 {
759   const unsigned int n = (unsigned int)num;
760   return ((n & 0x7) << 28);
761 }
762
763 static __inline tilepro_bundle_bits
764 create_Opcode_X1(int num)
765 {
766   const unsigned int n = (unsigned int)num;
767   return (((tilepro_bundle_bits)(n & 0xf)) << 59);
768 }
769
770 static __inline tilepro_bundle_bits
771 create_Opcode_Y0(int num)
772 {
773   const unsigned int n = (unsigned int)num;
774   return ((n & 0xf) << 27);
775 }
776
777 static __inline tilepro_bundle_bits
778 create_Opcode_Y1(int num)
779 {
780   const unsigned int n = (unsigned int)num;
781   return (((tilepro_bundle_bits)(n & 0xf)) << 59);
782 }
783
784 static __inline tilepro_bundle_bits
785 create_Opcode_Y2(int num)
786 {
787   const unsigned int n = (unsigned int)num;
788   return (((tilepro_bundle_bits)(n & 0x7)) << 56);
789 }
790
791 static __inline tilepro_bundle_bits
792 create_RROpcodeExtension_SN(int num)
793 {
794   const unsigned int n = (unsigned int)num;
795   return ((n & 0xf) << 4);
796 }
797
798 static __inline tilepro_bundle_bits
799 create_RRROpcodeExtension_X0(int num)
800 {
801   const unsigned int n = (unsigned int)num;
802   return ((n & 0x1ff) << 18);
803 }
804
805 static __inline tilepro_bundle_bits
806 create_RRROpcodeExtension_X1(int num)
807 {
808   const unsigned int n = (unsigned int)num;
809   return (((tilepro_bundle_bits)(n & 0x1ff)) << 49);
810 }
811
812 static __inline tilepro_bundle_bits
813 create_RRROpcodeExtension_Y0(int num)
814 {
815   const unsigned int n = (unsigned int)num;
816   return ((n & 0x3) << 18);
817 }
818
819 static __inline tilepro_bundle_bits
820 create_RRROpcodeExtension_Y1(int num)
821 {
822   const unsigned int n = (unsigned int)num;
823   return (((tilepro_bundle_bits)(n & 0x3)) << 49);
824 }
825
826 static __inline tilepro_bundle_bits
827 create_RouteOpcodeExtension_SN(int num)
828 {
829   const unsigned int n = (unsigned int)num;
830   return ((n & 0x3ff) << 0);
831 }
832
833 static __inline tilepro_bundle_bits
834 create_S_X0(int num)
835 {
836   const unsigned int n = (unsigned int)num;
837   return ((n & 0x1) << 27);
838 }
839
840 static __inline tilepro_bundle_bits
841 create_S_X1(int num)
842 {
843   const unsigned int n = (unsigned int)num;
844   return (((tilepro_bundle_bits)(n & 0x1)) << 58);
845 }
846
847 static __inline tilepro_bundle_bits
848 create_ShAmt_X0(int num)
849 {
850   const unsigned int n = (unsigned int)num;
851   return ((n & 0x1f) << 12);
852 }
853
854 static __inline tilepro_bundle_bits
855 create_ShAmt_X1(int num)
856 {
857   const unsigned int n = (unsigned int)num;
858   return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
859 }
860
861 static __inline tilepro_bundle_bits
862 create_ShAmt_Y0(int num)
863 {
864   const unsigned int n = (unsigned int)num;
865   return ((n & 0x1f) << 12);
866 }
867
868 static __inline tilepro_bundle_bits
869 create_ShAmt_Y1(int num)
870 {
871   const unsigned int n = (unsigned int)num;
872   return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
873 }
874
875 static __inline tilepro_bundle_bits
876 create_SrcA_X0(int num)
877 {
878   const unsigned int n = (unsigned int)num;
879   return ((n & 0x3f) << 6);
880 }
881
882 static __inline tilepro_bundle_bits
883 create_SrcA_X1(int num)
884 {
885   const unsigned int n = (unsigned int)num;
886   return (((tilepro_bundle_bits)(n & 0x3f)) << 37);
887 }
888
889 static __inline tilepro_bundle_bits
890 create_SrcA_Y0(int num)
891 {
892   const unsigned int n = (unsigned int)num;
893   return ((n & 0x3f) << 6);
894 }
895
896 static __inline tilepro_bundle_bits
897 create_SrcA_Y1(int num)
898 {
899   const unsigned int n = (unsigned int)num;
900   return (((tilepro_bundle_bits)(n & 0x3f)) << 37);
901 }
902
903 static __inline tilepro_bundle_bits
904 create_SrcA_Y2(int num)
905 {
906   const unsigned int n = (unsigned int)num;
907   return ((n & 0x00000001) << 26) |
908          (((tilepro_bundle_bits)(n & 0x0000003e)) << 50);
909 }
910
911 static __inline tilepro_bundle_bits
912 create_SrcBDest_Y2(int num)
913 {
914   const unsigned int n = (unsigned int)num;
915   return ((n & 0x3f) << 20);
916 }
917
918 static __inline tilepro_bundle_bits
919 create_SrcB_X0(int num)
920 {
921   const unsigned int n = (unsigned int)num;
922   return ((n & 0x3f) << 12);
923 }
924
925 static __inline tilepro_bundle_bits
926 create_SrcB_X1(int num)
927 {
928   const unsigned int n = (unsigned int)num;
929   return (((tilepro_bundle_bits)(n & 0x3f)) << 43);
930 }
931
932 static __inline tilepro_bundle_bits
933 create_SrcB_Y0(int num)
934 {
935   const unsigned int n = (unsigned int)num;
936   return ((n & 0x3f) << 12);
937 }
938
939 static __inline tilepro_bundle_bits
940 create_SrcB_Y1(int num)
941 {
942   const unsigned int n = (unsigned int)num;
943   return (((tilepro_bundle_bits)(n & 0x3f)) << 43);
944 }
945
946 static __inline tilepro_bundle_bits
947 create_Src_SN(int num)
948 {
949   const unsigned int n = (unsigned int)num;
950   return ((n & 0x3) << 0);
951 }
952
953 static __inline tilepro_bundle_bits
954 create_UnOpcodeExtension_X0(int num)
955 {
956   const unsigned int n = (unsigned int)num;
957   return ((n & 0x1f) << 12);
958 }
959
960 static __inline tilepro_bundle_bits
961 create_UnOpcodeExtension_X1(int num)
962 {
963   const unsigned int n = (unsigned int)num;
964   return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
965 }
966
967 static __inline tilepro_bundle_bits
968 create_UnOpcodeExtension_Y0(int num)
969 {
970   const unsigned int n = (unsigned int)num;
971   return ((n & 0x1f) << 12);
972 }
973
974 static __inline tilepro_bundle_bits
975 create_UnOpcodeExtension_Y1(int num)
976 {
977   const unsigned int n = (unsigned int)num;
978   return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
979 }
980
981 static __inline tilepro_bundle_bits
982 create_UnShOpcodeExtension_X0(int num)
983 {
984   const unsigned int n = (unsigned int)num;
985   return ((n & 0x3ff) << 17);
986 }
987
988 static __inline tilepro_bundle_bits
989 create_UnShOpcodeExtension_X1(int num)
990 {
991   const unsigned int n = (unsigned int)num;
992   return (((tilepro_bundle_bits)(n & 0x3ff)) << 48);
993 }
994
995 static __inline tilepro_bundle_bits
996 create_UnShOpcodeExtension_Y0(int num)
997 {
998   const unsigned int n = (unsigned int)num;
999   return ((n & 0x7) << 17);
1000 }
1001
1002 static __inline tilepro_bundle_bits
1003 create_UnShOpcodeExtension_Y1(int num)
1004 {
1005   const unsigned int n = (unsigned int)num;
1006   return (((tilepro_bundle_bits)(n & 0x7)) << 48);
1007 }
1008
1009
1010 enum
1011 {
1012   ADDBS_U_SPECIAL_0_OPCODE_X0 = 98,
1013   ADDBS_U_SPECIAL_0_OPCODE_X1 = 68,
1014   ADDB_SPECIAL_0_OPCODE_X0 = 1,
1015   ADDB_SPECIAL_0_OPCODE_X1 = 1,
1016   ADDHS_SPECIAL_0_OPCODE_X0 = 99,
1017   ADDHS_SPECIAL_0_OPCODE_X1 = 69,
1018   ADDH_SPECIAL_0_OPCODE_X0 = 2,
1019   ADDH_SPECIAL_0_OPCODE_X1 = 2,
1020   ADDIB_IMM_0_OPCODE_X0 = 1,
1021   ADDIB_IMM_0_OPCODE_X1 = 1,
1022   ADDIH_IMM_0_OPCODE_X0 = 2,
1023   ADDIH_IMM_0_OPCODE_X1 = 2,
1024   ADDI_IMM_0_OPCODE_X0 = 3,
1025   ADDI_IMM_0_OPCODE_X1 = 3,
1026   ADDI_IMM_1_OPCODE_SN = 1,
1027   ADDI_OPCODE_Y0 = 9,
1028   ADDI_OPCODE_Y1 = 7,
1029   ADDLIS_OPCODE_X0 = 1,
1030   ADDLIS_OPCODE_X1 = 2,
1031   ADDLI_OPCODE_X0 = 2,
1032   ADDLI_OPCODE_X1 = 3,
1033   ADDS_SPECIAL_0_OPCODE_X0 = 96,
1034   ADDS_SPECIAL_0_OPCODE_X1 = 66,
1035   ADD_SPECIAL_0_OPCODE_X0 = 3,
1036   ADD_SPECIAL_0_OPCODE_X1 = 3,
1037   ADD_SPECIAL_0_OPCODE_Y0 = 0,
1038   ADD_SPECIAL_0_OPCODE_Y1 = 0,
1039   ADIFFB_U_SPECIAL_0_OPCODE_X0 = 4,
1040   ADIFFH_SPECIAL_0_OPCODE_X0 = 5,
1041   ANDI_IMM_0_OPCODE_X0 = 1,
1042   ANDI_IMM_0_OPCODE_X1 = 4,
1043   ANDI_OPCODE_Y0 = 10,
1044   ANDI_OPCODE_Y1 = 8,
1045   AND_SPECIAL_0_OPCODE_X0 = 6,
1046   AND_SPECIAL_0_OPCODE_X1 = 4,
1047   AND_SPECIAL_2_OPCODE_Y0 = 0,
1048   AND_SPECIAL_2_OPCODE_Y1 = 0,
1049   AULI_OPCODE_X0 = 3,
1050   AULI_OPCODE_X1 = 4,
1051   AVGB_U_SPECIAL_0_OPCODE_X0 = 7,
1052   AVGH_SPECIAL_0_OPCODE_X0 = 8,
1053   BBNST_BRANCH_OPCODE_X1 = 15,
1054   BBNS_BRANCH_OPCODE_X1 = 14,
1055   BBNS_OPCODE_SN = 63,
1056   BBST_BRANCH_OPCODE_X1 = 13,
1057   BBS_BRANCH_OPCODE_X1 = 12,
1058   BBS_OPCODE_SN = 62,
1059   BGEZT_BRANCH_OPCODE_X1 = 7,
1060   BGEZ_BRANCH_OPCODE_X1 = 6,
1061   BGEZ_OPCODE_SN = 61,
1062   BGZT_BRANCH_OPCODE_X1 = 5,
1063   BGZ_BRANCH_OPCODE_X1 = 4,
1064   BGZ_OPCODE_SN = 58,
1065   BITX_UN_0_SHUN_0_OPCODE_X0 = 1,
1066   BITX_UN_0_SHUN_0_OPCODE_Y0 = 1,
1067   BLEZT_BRANCH_OPCODE_X1 = 11,
1068   BLEZ_BRANCH_OPCODE_X1 = 10,
1069   BLEZ_OPCODE_SN = 59,
1070   BLZT_BRANCH_OPCODE_X1 = 9,
1071   BLZ_BRANCH_OPCODE_X1 = 8,
1072   BLZ_OPCODE_SN = 60,
1073   BNZT_BRANCH_OPCODE_X1 = 3,
1074   BNZ_BRANCH_OPCODE_X1 = 2,
1075   BNZ_OPCODE_SN = 57,
1076   BPT_NOREG_RR_IMM_0_OPCODE_SN = 1,
1077   BRANCH_OPCODE_X1 = 5,
1078   BYTEX_UN_0_SHUN_0_OPCODE_X0 = 2,
1079   BYTEX_UN_0_SHUN_0_OPCODE_Y0 = 2,
1080   BZT_BRANCH_OPCODE_X1 = 1,
1081   BZ_BRANCH_OPCODE_X1 = 0,
1082   BZ_OPCODE_SN = 56,
1083   CLZ_UN_0_SHUN_0_OPCODE_X0 = 3,
1084   CLZ_UN_0_SHUN_0_OPCODE_Y0 = 3,
1085   CRC32_32_SPECIAL_0_OPCODE_X0 = 9,
1086   CRC32_8_SPECIAL_0_OPCODE_X0 = 10,
1087   CTZ_UN_0_SHUN_0_OPCODE_X0 = 4,
1088   CTZ_UN_0_SHUN_0_OPCODE_Y0 = 4,
1089   DRAIN_UN_0_SHUN_0_OPCODE_X1 = 1,
1090   DTLBPR_UN_0_SHUN_0_OPCODE_X1 = 2,
1091   DWORD_ALIGN_SPECIAL_0_OPCODE_X0 = 95,
1092   FINV_UN_0_SHUN_0_OPCODE_X1 = 3,
1093   FLUSH_UN_0_SHUN_0_OPCODE_X1 = 4,
1094   FNOP_NOREG_RR_IMM_0_OPCODE_SN = 3,
1095   FNOP_UN_0_SHUN_0_OPCODE_X0 = 5,
1096   FNOP_UN_0_SHUN_0_OPCODE_X1 = 5,
1097   FNOP_UN_0_SHUN_0_OPCODE_Y0 = 5,
1098   FNOP_UN_0_SHUN_0_OPCODE_Y1 = 1,
1099   HALT_NOREG_RR_IMM_0_OPCODE_SN = 0,
1100   ICOH_UN_0_SHUN_0_OPCODE_X1 = 6,
1101   ILL_UN_0_SHUN_0_OPCODE_X1 = 7,
1102   ILL_UN_0_SHUN_0_OPCODE_Y1 = 2,
1103   IMM_0_OPCODE_SN = 0,
1104   IMM_0_OPCODE_X0 = 4,
1105   IMM_0_OPCODE_X1 = 6,
1106   IMM_1_OPCODE_SN = 1,
1107   IMM_OPCODE_0_X0 = 5,
1108   INTHB_SPECIAL_0_OPCODE_X0 = 11,
1109   INTHB_SPECIAL_0_OPCODE_X1 = 5,
1110   INTHH_SPECIAL_0_OPCODE_X0 = 12,
1111   INTHH_SPECIAL_0_OPCODE_X1 = 6,
1112   INTLB_SPECIAL_0_OPCODE_X0 = 13,
1113   INTLB_SPECIAL_0_OPCODE_X1 = 7,
1114   INTLH_SPECIAL_0_OPCODE_X0 = 14,
1115   INTLH_SPECIAL_0_OPCODE_X1 = 8,
1116   INV_UN_0_SHUN_0_OPCODE_X1 = 8,
1117   IRET_UN_0_SHUN_0_OPCODE_X1 = 9,
1118   JALB_OPCODE_X1 = 13,
1119   JALF_OPCODE_X1 = 12,
1120   JALRP_SPECIAL_0_OPCODE_X1 = 9,
1121   JALRR_IMM_1_OPCODE_SN = 3,
1122   JALR_RR_IMM_0_OPCODE_SN = 5,
1123   JALR_SPECIAL_0_OPCODE_X1 = 10,
1124   JB_OPCODE_X1 = 11,
1125   JF_OPCODE_X1 = 10,
1126   JRP_SPECIAL_0_OPCODE_X1 = 11,
1127   JRR_IMM_1_OPCODE_SN = 2,
1128   JR_RR_IMM_0_OPCODE_SN = 4,
1129   JR_SPECIAL_0_OPCODE_X1 = 12,
1130   LBADD_IMM_0_OPCODE_X1 = 22,
1131   LBADD_U_IMM_0_OPCODE_X1 = 23,
1132   LB_OPCODE_Y2 = 0,
1133   LB_UN_0_SHUN_0_OPCODE_X1 = 10,
1134   LB_U_OPCODE_Y2 = 1,
1135   LB_U_UN_0_SHUN_0_OPCODE_X1 = 11,
1136   LHADD_IMM_0_OPCODE_X1 = 24,
1137   LHADD_U_IMM_0_OPCODE_X1 = 25,
1138   LH_OPCODE_Y2 = 2,
1139   LH_UN_0_SHUN_0_OPCODE_X1 = 12,
1140   LH_U_OPCODE_Y2 = 3,
1141   LH_U_UN_0_SHUN_0_OPCODE_X1 = 13,
1142   LNK_SPECIAL_0_OPCODE_X1 = 13,
1143   LWADD_IMM_0_OPCODE_X1 = 26,
1144   LWADD_NA_IMM_0_OPCODE_X1 = 27,
1145   LW_NA_UN_0_SHUN_0_OPCODE_X1 = 24,
1146   LW_OPCODE_Y2 = 4,
1147   LW_UN_0_SHUN_0_OPCODE_X1 = 14,
1148   MAXB_U_SPECIAL_0_OPCODE_X0 = 15,
1149   MAXB_U_SPECIAL_0_OPCODE_X1 = 14,
1150   MAXH_SPECIAL_0_OPCODE_X0 = 16,
1151   MAXH_SPECIAL_0_OPCODE_X1 = 15,
1152   MAXIB_U_IMM_0_OPCODE_X0 = 4,
1153   MAXIB_U_IMM_0_OPCODE_X1 = 5,
1154   MAXIH_IMM_0_OPCODE_X0 = 5,
1155   MAXIH_IMM_0_OPCODE_X1 = 6,
1156   MFSPR_IMM_0_OPCODE_X1 = 7,
1157   MF_UN_0_SHUN_0_OPCODE_X1 = 15,
1158   MINB_U_SPECIAL_0_OPCODE_X0 = 17,
1159   MINB_U_SPECIAL_0_OPCODE_X1 = 16,
1160   MINH_SPECIAL_0_OPCODE_X0 = 18,
1161   MINH_SPECIAL_0_OPCODE_X1 = 17,
1162   MINIB_U_IMM_0_OPCODE_X0 = 6,
1163   MINIB_U_IMM_0_OPCODE_X1 = 8,
1164   MINIH_IMM_0_OPCODE_X0 = 7,
1165   MINIH_IMM_0_OPCODE_X1 = 9,
1166   MM_OPCODE_X0 = 6,
1167   MM_OPCODE_X1 = 7,
1168   MNZB_SPECIAL_0_OPCODE_X0 = 19,
1169   MNZB_SPECIAL_0_OPCODE_X1 = 18,
1170   MNZH_SPECIAL_0_OPCODE_X0 = 20,
1171   MNZH_SPECIAL_0_OPCODE_X1 = 19,
1172   MNZ_SPECIAL_0_OPCODE_X0 = 21,
1173   MNZ_SPECIAL_0_OPCODE_X1 = 20,
1174   MNZ_SPECIAL_1_OPCODE_Y0 = 0,
1175   MNZ_SPECIAL_1_OPCODE_Y1 = 1,
1176   MOVEI_IMM_1_OPCODE_SN = 0,
1177   MOVE_RR_IMM_0_OPCODE_SN = 8,
1178   MTSPR_IMM_0_OPCODE_X1 = 10,
1179   MULHHA_SS_SPECIAL_0_OPCODE_X0 = 22,
1180   MULHHA_SS_SPECIAL_7_OPCODE_Y0 = 0,
1181   MULHHA_SU_SPECIAL_0_OPCODE_X0 = 23,
1182   MULHHA_UU_SPECIAL_0_OPCODE_X0 = 24,
1183   MULHHA_UU_SPECIAL_7_OPCODE_Y0 = 1,
1184   MULHHSA_UU_SPECIAL_0_OPCODE_X0 = 25,
1185   MULHH_SS_SPECIAL_0_OPCODE_X0 = 26,
1186   MULHH_SS_SPECIAL_6_OPCODE_Y0 = 0,
1187   MULHH_SU_SPECIAL_0_OPCODE_X0 = 27,
1188   MULHH_UU_SPECIAL_0_OPCODE_X0 = 28,
1189   MULHH_UU_SPECIAL_6_OPCODE_Y0 = 1,
1190   MULHLA_SS_SPECIAL_0_OPCODE_X0 = 29,
1191   MULHLA_SU_SPECIAL_0_OPCODE_X0 = 30,
1192   MULHLA_US_SPECIAL_0_OPCODE_X0 = 31,
1193   MULHLA_UU_SPECIAL_0_OPCODE_X0 = 32,
1194   MULHLSA_UU_SPECIAL_0_OPCODE_X0 = 33,
1195   MULHLSA_UU_SPECIAL_5_OPCODE_Y0 = 0,
1196   MULHL_SS_SPECIAL_0_OPCODE_X0 = 34,
1197   MULHL_SU_SPECIAL_0_OPCODE_X0 = 35,
1198   MULHL_US_SPECIAL_0_OPCODE_X0 = 36,
1199   MULHL_UU_SPECIAL_0_OPCODE_X0 = 37,
1200   MULLLA_SS_SPECIAL_0_OPCODE_X0 = 38,
1201   MULLLA_SS_SPECIAL_7_OPCODE_Y0 = 2,
1202   MULLLA_SU_SPECIAL_0_OPCODE_X0 = 39,
1203   MULLLA_UU_SPECIAL_0_OPCODE_X0 = 40,
1204   MULLLA_UU_SPECIAL_7_OPCODE_Y0 = 3,
1205   MULLLSA_UU_SPECIAL_0_OPCODE_X0 = 41,
1206   MULLL_SS_SPECIAL_0_OPCODE_X0 = 42,
1207   MULLL_SS_SPECIAL_6_OPCODE_Y0 = 2,
1208   MULLL_SU_SPECIAL_0_OPCODE_X0 = 43,
1209   MULLL_UU_SPECIAL_0_OPCODE_X0 = 44,
1210   MULLL_UU_SPECIAL_6_OPCODE_Y0 = 3,
1211   MVNZ_SPECIAL_0_OPCODE_X0 = 45,
1212   MVNZ_SPECIAL_1_OPCODE_Y0 = 1,
1213   MVZ_SPECIAL_0_OPCODE_X0 = 46,
1214   MVZ_SPECIAL_1_OPCODE_Y0 = 2,
1215   MZB_SPECIAL_0_OPCODE_X0 = 47,
1216   MZB_SPECIAL_0_OPCODE_X1 = 21,
1217   MZH_SPECIAL_0_OPCODE_X0 = 48,
1218   MZH_SPECIAL_0_OPCODE_X1 = 22,
1219   MZ_SPECIAL_0_OPCODE_X0 = 49,
1220   MZ_SPECIAL_0_OPCODE_X1 = 23,
1221   MZ_SPECIAL_1_OPCODE_Y0 = 3,
1222   MZ_SPECIAL_1_OPCODE_Y1 = 2,
1223   NAP_UN_0_SHUN_0_OPCODE_X1 = 16,
1224   NOP_NOREG_RR_IMM_0_OPCODE_SN = 2,
1225   NOP_UN_0_SHUN_0_OPCODE_X0 = 6,
1226   NOP_UN_0_SHUN_0_OPCODE_X1 = 17,
1227   NOP_UN_0_SHUN_0_OPCODE_Y0 = 6,
1228   NOP_UN_0_SHUN_0_OPCODE_Y1 = 3,
1229   NOREG_RR_IMM_0_OPCODE_SN = 0,
1230   NOR_SPECIAL_0_OPCODE_X0 = 50,
1231   NOR_SPECIAL_0_OPCODE_X1 = 24,
1232   NOR_SPECIAL_2_OPCODE_Y0 = 1,
1233   NOR_SPECIAL_2_OPCODE_Y1 = 1,
1234   ORI_IMM_0_OPCODE_X0 = 8,
1235   ORI_IMM_0_OPCODE_X1 = 11,
1236   ORI_OPCODE_Y0 = 11,
1237   ORI_OPCODE_Y1 = 9,
1238   OR_SPECIAL_0_OPCODE_X0 = 51,
1239   OR_SPECIAL_0_OPCODE_X1 = 25,
1240   OR_SPECIAL_2_OPCODE_Y0 = 2,
1241   OR_SPECIAL_2_OPCODE_Y1 = 2,
1242   PACKBS_U_SPECIAL_0_OPCODE_X0 = 103,
1243   PACKBS_U_SPECIAL_0_OPCODE_X1 = 73,
1244   PACKHB_SPECIAL_0_OPCODE_X0 = 52,
1245   PACKHB_SPECIAL_0_OPCODE_X1 = 26,
1246   PACKHS_SPECIAL_0_OPCODE_X0 = 102,
1247   PACKHS_SPECIAL_0_OPCODE_X1 = 72,
1248   PACKLB_SPECIAL_0_OPCODE_X0 = 53,
1249   PACKLB_SPECIAL_0_OPCODE_X1 = 27,
1250   PCNT_UN_0_SHUN_0_OPCODE_X0 = 7,
1251   PCNT_UN_0_SHUN_0_OPCODE_Y0 = 7,
1252   RLI_SHUN_0_OPCODE_X0 = 1,
1253   RLI_SHUN_0_OPCODE_X1 = 1,
1254   RLI_SHUN_0_OPCODE_Y0 = 1,
1255   RLI_SHUN_0_OPCODE_Y1 = 1,
1256   RL_SPECIAL_0_OPCODE_X0 = 54,
1257   RL_SPECIAL_0_OPCODE_X1 = 28,
1258   RL_SPECIAL_3_OPCODE_Y0 = 0,
1259   RL_SPECIAL_3_OPCODE_Y1 = 0,
1260   RR_IMM_0_OPCODE_SN = 0,
1261   S1A_SPECIAL_0_OPCODE_X0 = 55,
1262   S1A_SPECIAL_0_OPCODE_X1 = 29,
1263   S1A_SPECIAL_0_OPCODE_Y0 = 1,
1264   S1A_SPECIAL_0_OPCODE_Y1 = 1,
1265   S2A_SPECIAL_0_OPCODE_X0 = 56,
1266   S2A_SPECIAL_0_OPCODE_X1 = 30,
1267   S2A_SPECIAL_0_OPCODE_Y0 = 2,
1268   S2A_SPECIAL_0_OPCODE_Y1 = 2,
1269   S3A_SPECIAL_0_OPCODE_X0 = 57,
1270   S3A_SPECIAL_0_OPCODE_X1 = 31,
1271   S3A_SPECIAL_5_OPCODE_Y0 = 1,
1272   S3A_SPECIAL_5_OPCODE_Y1 = 1,
1273   SADAB_U_SPECIAL_0_OPCODE_X0 = 58,
1274   SADAH_SPECIAL_0_OPCODE_X0 = 59,
1275   SADAH_U_SPECIAL_0_OPCODE_X0 = 60,
1276   SADB_U_SPECIAL_0_OPCODE_X0 = 61,
1277   SADH_SPECIAL_0_OPCODE_X0 = 62,
1278   SADH_U_SPECIAL_0_OPCODE_X0 = 63,
1279   SBADD_IMM_0_OPCODE_X1 = 28,
1280   SB_OPCODE_Y2 = 5,
1281   SB_SPECIAL_0_OPCODE_X1 = 32,
1282   SEQB_SPECIAL_0_OPCODE_X0 = 64,
1283   SEQB_SPECIAL_0_OPCODE_X1 = 33,
1284   SEQH_SPECIAL_0_OPCODE_X0 = 65,
1285   SEQH_SPECIAL_0_OPCODE_X1 = 34,
1286   SEQIB_IMM_0_OPCODE_X0 = 9,
1287   SEQIB_IMM_0_OPCODE_X1 = 12,
1288   SEQIH_IMM_0_OPCODE_X0 = 10,
1289   SEQIH_IMM_0_OPCODE_X1 = 13,
1290   SEQI_IMM_0_OPCODE_X0 = 11,
1291   SEQI_IMM_0_OPCODE_X1 = 14,
1292   SEQI_OPCODE_Y0 = 12,
1293   SEQI_OPCODE_Y1 = 10,
1294   SEQ_SPECIAL_0_OPCODE_X0 = 66,
1295   SEQ_SPECIAL_0_OPCODE_X1 = 35,
1296   SEQ_SPECIAL_5_OPCODE_Y0 = 2,
1297   SEQ_SPECIAL_5_OPCODE_Y1 = 2,
1298   SHADD_IMM_0_OPCODE_X1 = 29,
1299   SHL8II_IMM_0_OPCODE_SN = 3,
1300   SHLB_SPECIAL_0_OPCODE_X0 = 67,
1301   SHLB_SPECIAL_0_OPCODE_X1 = 36,
1302   SHLH_SPECIAL_0_OPCODE_X0 = 68,
1303   SHLH_SPECIAL_0_OPCODE_X1 = 37,
1304   SHLIB_SHUN_0_OPCODE_X0 = 2,
1305   SHLIB_SHUN_0_OPCODE_X1 = 2,
1306   SHLIH_SHUN_0_OPCODE_X0 = 3,
1307   SHLIH_SHUN_0_OPCODE_X1 = 3,
1308   SHLI_SHUN_0_OPCODE_X0 = 4,
1309   SHLI_SHUN_0_OPCODE_X1 = 4,
1310   SHLI_SHUN_0_OPCODE_Y0 = 2,
1311   SHLI_SHUN_0_OPCODE_Y1 = 2,
1312   SHL_SPECIAL_0_OPCODE_X0 = 69,
1313   SHL_SPECIAL_0_OPCODE_X1 = 38,
1314   SHL_SPECIAL_3_OPCODE_Y0 = 1,
1315   SHL_SPECIAL_3_OPCODE_Y1 = 1,
1316   SHR1_RR_IMM_0_OPCODE_SN = 9,
1317   SHRB_SPECIAL_0_OPCODE_X0 = 70,
1318   SHRB_SPECIAL_0_OPCODE_X1 = 39,
1319   SHRH_SPECIAL_0_OPCODE_X0 = 71,
1320   SHRH_SPECIAL_0_OPCODE_X1 = 40,
1321   SHRIB_SHUN_0_OPCODE_X0 = 5,
1322   SHRIB_SHUN_0_OPCODE_X1 = 5,
1323   SHRIH_SHUN_0_OPCODE_X0 = 6,
1324   SHRIH_SHUN_0_OPCODE_X1 = 6,
1325   SHRI_SHUN_0_OPCODE_X0 = 7,
1326   SHRI_SHUN_0_OPCODE_X1 = 7,
1327   SHRI_SHUN_0_OPCODE_Y0 = 3,
1328   SHRI_SHUN_0_OPCODE_Y1 = 3,
1329   SHR_SPECIAL_0_OPCODE_X0 = 72,
1330   SHR_SPECIAL_0_OPCODE_X1 = 41,
1331   SHR_SPECIAL_3_OPCODE_Y0 = 2,
1332   SHR_SPECIAL_3_OPCODE_Y1 = 2,
1333   SHUN_0_OPCODE_X0 = 7,
1334   SHUN_0_OPCODE_X1 = 8,
1335   SHUN_0_OPCODE_Y0 = 13,
1336   SHUN_0_OPCODE_Y1 = 11,
1337   SH_OPCODE_Y2 = 6,
1338   SH_SPECIAL_0_OPCODE_X1 = 42,
1339   SLTB_SPECIAL_0_OPCODE_X0 = 73,
1340   SLTB_SPECIAL_0_OPCODE_X1 = 43,
1341   SLTB_U_SPECIAL_0_OPCODE_X0 = 74,
1342   SLTB_U_SPECIAL_0_OPCODE_X1 = 44,
1343   SLTEB_SPECIAL_0_OPCODE_X0 = 75,
1344   SLTEB_SPECIAL_0_OPCODE_X1 = 45,
1345   SLTEB_U_SPECIAL_0_OPCODE_X0 = 76,
1346   SLTEB_U_SPECIAL_0_OPCODE_X1 = 46,
1347   SLTEH_SPECIAL_0_OPCODE_X0 = 77,
1348   SLTEH_SPECIAL_0_OPCODE_X1 = 47,
1349   SLTEH_U_SPECIAL_0_OPCODE_X0 = 78,
1350   SLTEH_U_SPECIAL_0_OPCODE_X1 = 48,
1351   SLTE_SPECIAL_0_OPCODE_X0 = 79,
1352   SLTE_SPECIAL_0_OPCODE_X1 = 49,
1353   SLTE_SPECIAL_4_OPCODE_Y0 = 0,
1354   SLTE_SPECIAL_4_OPCODE_Y1 = 0,
1355   SLTE_U_SPECIAL_0_OPCODE_X0 = 80,
1356   SLTE_U_SPECIAL_0_OPCODE_X1 = 50,
1357   SLTE_U_SPECIAL_4_OPCODE_Y0 = 1,
1358   SLTE_U_SPECIAL_4_OPCODE_Y1 = 1,
1359   SLTH_SPECIAL_0_OPCODE_X0 = 81,
1360   SLTH_SPECIAL_0_OPCODE_X1 = 51,
1361   SLTH_U_SPECIAL_0_OPCODE_X0 = 82,
1362   SLTH_U_SPECIAL_0_OPCODE_X1 = 52,
1363   SLTIB_IMM_0_OPCODE_X0 = 12,
1364   SLTIB_IMM_0_OPCODE_X1 = 15,
1365   SLTIB_U_IMM_0_OPCODE_X0 = 13,
1366   SLTIB_U_IMM_0_OPCODE_X1 = 16,
1367   SLTIH_IMM_0_OPCODE_X0 = 14,
1368   SLTIH_IMM_0_OPCODE_X1 = 17,
1369   SLTIH_U_IMM_0_OPCODE_X0 = 15,
1370   SLTIH_U_IMM_0_OPCODE_X1 = 18,
1371   SLTI_IMM_0_OPCODE_X0 = 16,
1372   SLTI_IMM_0_OPCODE_X1 = 19,
1373   SLTI_OPCODE_Y0 = 14,
1374   SLTI_OPCODE_Y1 = 12,
1375   SLTI_U_IMM_0_OPCODE_X0 = 17,
1376   SLTI_U_IMM_0_OPCODE_X1 = 20,
1377   SLTI_U_OPCODE_Y0 = 15,
1378   SLTI_U_OPCODE_Y1 = 13,
1379   SLT_SPECIAL_0_OPCODE_X0 = 83,
1380   SLT_SPECIAL_0_OPCODE_X1 = 53,
1381   SLT_SPECIAL_4_OPCODE_Y0 = 2,
1382   SLT_SPECIAL_4_OPCODE_Y1 = 2,
1383   SLT_U_SPECIAL_0_OPCODE_X0 = 84,
1384   SLT_U_SPECIAL_0_OPCODE_X1 = 54,
1385   SLT_U_SPECIAL_4_OPCODE_Y0 = 3,
1386   SLT_U_SPECIAL_4_OPCODE_Y1 = 3,
1387   SNEB_SPECIAL_0_OPCODE_X0 = 85,
1388   SNEB_SPECIAL_0_OPCODE_X1 = 55,
1389   SNEH_SPECIAL_0_OPCODE_X0 = 86,
1390   SNEH_SPECIAL_0_OPCODE_X1 = 56,
1391   SNE_SPECIAL_0_OPCODE_X0 = 87,
1392   SNE_SPECIAL_0_OPCODE_X1 = 57,
1393   SNE_SPECIAL_5_OPCODE_Y0 = 3,
1394   SNE_SPECIAL_5_OPCODE_Y1 = 3,
1395   SPECIAL_0_OPCODE_X0 = 0,
1396   SPECIAL_0_OPCODE_X1 = 1,
1397   SPECIAL_0_OPCODE_Y0 = 1,
1398   SPECIAL_0_OPCODE_Y1 = 1,
1399   SPECIAL_1_OPCODE_Y0 = 2,
1400   SPECIAL_1_OPCODE_Y1 = 2,
1401   SPECIAL_2_OPCODE_Y0 = 3,
1402   SPECIAL_2_OPCODE_Y1 = 3,
1403   SPECIAL_3_OPCODE_Y0 = 4,
1404   SPECIAL_3_OPCODE_Y1 = 4,
1405   SPECIAL_4_OPCODE_Y0 = 5,
1406   SPECIAL_4_OPCODE_Y1 = 5,
1407   SPECIAL_5_OPCODE_Y0 = 6,
1408   SPECIAL_5_OPCODE_Y1 = 6,
1409   SPECIAL_6_OPCODE_Y0 = 7,
1410   SPECIAL_7_OPCODE_Y0 = 8,
1411   SRAB_SPECIAL_0_OPCODE_X0 = 88,
1412   SRAB_SPECIAL_0_OPCODE_X1 = 58,
1413   SRAH_SPECIAL_0_OPCODE_X0 = 89,
1414   SRAH_SPECIAL_0_OPCODE_X1 = 59,
1415   SRAIB_SHUN_0_OPCODE_X0 = 8,
1416   SRAIB_SHUN_0_OPCODE_X1 = 8,
1417   SRAIH_SHUN_0_OPCODE_X0 = 9,
1418   SRAIH_SHUN_0_OPCODE_X1 = 9,
1419   SRAI_SHUN_0_OPCODE_X0 = 10,
1420   SRAI_SHUN_0_OPCODE_X1 = 10,
1421   SRAI_SHUN_0_OPCODE_Y0 = 4,
1422   SRAI_SHUN_0_OPCODE_Y1 = 4,
1423   SRA_SPECIAL_0_OPCODE_X0 = 90,
1424   SRA_SPECIAL_0_OPCODE_X1 = 60,
1425   SRA_SPECIAL_3_OPCODE_Y0 = 3,
1426   SRA_SPECIAL_3_OPCODE_Y1 = 3,
1427   SUBBS_U_SPECIAL_0_OPCODE_X0 = 100,
1428   SUBBS_U_SPECIAL_0_OPCODE_X1 = 70,
1429   SUBB_SPECIAL_0_OPCODE_X0 = 91,
1430   SUBB_SPECIAL_0_OPCODE_X1 = 61,
1431   SUBHS_SPECIAL_0_OPCODE_X0 = 101,
1432   SUBHS_SPECIAL_0_OPCODE_X1 = 71,
1433   SUBH_SPECIAL_0_OPCODE_X0 = 92,
1434   SUBH_SPECIAL_0_OPCODE_X1 = 62,
1435   SUBS_SPECIAL_0_OPCODE_X0 = 97,
1436   SUBS_SPECIAL_0_OPCODE_X1 = 67,
1437   SUB_SPECIAL_0_OPCODE_X0 = 93,
1438   SUB_SPECIAL_0_OPCODE_X1 = 63,
1439   SUB_SPECIAL_0_OPCODE_Y0 = 3,
1440   SUB_SPECIAL_0_OPCODE_Y1 = 3,
1441   SWADD_IMM_0_OPCODE_X1 = 30,
1442   SWINT0_UN_0_SHUN_0_OPCODE_X1 = 18,
1443   SWINT1_UN_0_SHUN_0_OPCODE_X1 = 19,
1444   SWINT2_UN_0_SHUN_0_OPCODE_X1 = 20,
1445   SWINT3_UN_0_SHUN_0_OPCODE_X1 = 21,
1446   SW_OPCODE_Y2 = 7,
1447   SW_SPECIAL_0_OPCODE_X1 = 64,
1448   TBLIDXB0_UN_0_SHUN_0_OPCODE_X0 = 8,
1449   TBLIDXB0_UN_0_SHUN_0_OPCODE_Y0 = 8,
1450   TBLIDXB1_UN_0_SHUN_0_OPCODE_X0 = 9,
1451   TBLIDXB1_UN_0_SHUN_0_OPCODE_Y0 = 9,
1452   TBLIDXB2_UN_0_SHUN_0_OPCODE_X0 = 10,
1453   TBLIDXB2_UN_0_SHUN_0_OPCODE_Y0 = 10,
1454   TBLIDXB3_UN_0_SHUN_0_OPCODE_X0 = 11,
1455   TBLIDXB3_UN_0_SHUN_0_OPCODE_Y0 = 11,
1456   TNS_UN_0_SHUN_0_OPCODE_X1 = 22,
1457   UN_0_SHUN_0_OPCODE_X0 = 11,
1458   UN_0_SHUN_0_OPCODE_X1 = 11,
1459   UN_0_SHUN_0_OPCODE_Y0 = 5,
1460   UN_0_SHUN_0_OPCODE_Y1 = 5,
1461   WH64_UN_0_SHUN_0_OPCODE_X1 = 23,
1462   XORI_IMM_0_OPCODE_X0 = 2,
1463   XORI_IMM_0_OPCODE_X1 = 21,
1464   XOR_SPECIAL_0_OPCODE_X0 = 94,
1465   XOR_SPECIAL_0_OPCODE_X1 = 65,
1466   XOR_SPECIAL_2_OPCODE_Y0 = 3,
1467   XOR_SPECIAL_2_OPCODE_Y1 = 3
1468 };
1469
1470
1471 #endif /* __ASSEMBLER__ */
1472
1473 #endif /* __ARCH_OPCODE_H__ */