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