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