Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
opcode_tilepro.h
Go to the documentation of this file.
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). */
35 
36  /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */
38 
39  /* Log base 2 of TILEPRO_BUNDLE_SIZE_IN_BYTES. */
41 
42  /* Instructions take this many bytes. */
44 
45  /* Log base 2 of TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES. */
47 
48  /* Bundles should be aligned modulo this number of bytes. */
51 
52  /* Log base 2 of TILEPRO_SN_INSTRUCTION_SIZE_IN_BYTES. */
54 
55  /* Static network instructions take this many bytes. */
58 
59  /* Number of registers (some are magic, such as network I/O). */
61 
62  /* Number of static network registers. */
64 };
65 
66 /* Make a few "tile_" variables to simplify common code between
67  architectures. */
68 
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
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
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
93 get_BrType_X1(tilepro_bundle_bits n)
94 {
95  return (((unsigned int)(n >> 31)) & 0xf);
96 }
97 
98 static __inline unsigned int
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
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
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
120 get_Dest_X1(tilepro_bundle_bits n)
121 {
122  return (((unsigned int)(n >> 31)) & 0x3f);
123 }
124 
125 static __inline unsigned int
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
133 get_Dest_Y1(tilepro_bundle_bits n)
134 {
135  return (((unsigned int)(n >> 31)) & 0x3f);
136 }
137 
138 static __inline unsigned int
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
146 get_Imm16_X1(tilepro_bundle_bits n)
147 {
148  return (((unsigned int)(n >> 43)) & 0xffff);
149 }
150 
151 static __inline unsigned int
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
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
166 get_Imm8_X1(tilepro_bundle_bits n)
167 {
168  return (((unsigned int)(n >> 43)) & 0xff);
169 }
170 
171 static __inline unsigned int
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
179 get_Imm8_Y1(tilepro_bundle_bits n)
180 {
181  return (((unsigned int)(n >> 43)) & 0xff);
182 }
183 
184 static __inline unsigned int
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
192 get_ImmOpcodeExtension_X1(tilepro_bundle_bits n)
193 {
194  return (((unsigned int)(n >> 51)) & 0x7f);
195 }
196 
197 static __inline unsigned int
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
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
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
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
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
239 get_MMEnd_X1(tilepro_bundle_bits n)
240 {
241  return (((unsigned int)(n >> 49)) & 0x1f);
242 }
243 
244 static __inline unsigned int
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
252 get_MMStart_X1(tilepro_bundle_bits n)
253 {
254  return (((unsigned int)(n >> 54)) & 0x1f);
255 }
256 
257 static __inline unsigned int
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
266 get_Mode(tilepro_bundle_bits n)
267 {
268  return (((unsigned int)(n >> 63)) & 0x1);
269 }
270 
271 static __inline unsigned int
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
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
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
293 get_Opcode_X1(tilepro_bundle_bits n)
294 {
295  return (((unsigned int)(n >> 59)) & 0xf);
296 }
297 
298 static __inline unsigned int
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
306 get_Opcode_Y1(tilepro_bundle_bits n)
307 {
308  return (((unsigned int)(n >> 59)) & 0xf);
309 }
310 
311 static __inline unsigned int
312 get_Opcode_Y2(tilepro_bundle_bits n)
313 {
314  return (((unsigned int)(n >> 56)) & 0x7);
315 }
316 
317 static __inline unsigned int
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
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
332 get_RRROpcodeExtension_X1(tilepro_bundle_bits n)
333 {
334  return (((unsigned int)(n >> 49)) & 0x1ff);
335 }
336 
337 static __inline unsigned int
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
345 get_RRROpcodeExtension_Y1(tilepro_bundle_bits n)
346 {
347  return (((unsigned int)(n >> 49)) & 0x3);
348 }
349 
350 static __inline unsigned int
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
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
365 get_S_X1(tilepro_bundle_bits n)
366 {
367  return (((unsigned int)(n >> 58)) & 0x1);
368 }
369 
370 static __inline unsigned int
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
378 get_ShAmt_X1(tilepro_bundle_bits n)
379 {
380  return (((unsigned int)(n >> 43)) & 0x1f);
381 }
382 
383 static __inline unsigned int
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
391 get_ShAmt_Y1(tilepro_bundle_bits n)
392 {
393  return (((unsigned int)(n >> 43)) & 0x1f);
394 }
395 
396 static __inline unsigned int
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
404 get_SrcA_X1(tilepro_bundle_bits n)
405 {
406  return (((unsigned int)(n >> 37)) & 0x3f);
407 }
408 
409 static __inline unsigned int
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
417 get_SrcA_Y1(tilepro_bundle_bits n)
418 {
419  return (((unsigned int)(n >> 37)) & 0x3f);
420 }
421 
422 static __inline unsigned int
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
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
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
444 get_SrcB_X1(tilepro_bundle_bits n)
445 {
446  return (((unsigned int)(n >> 43)) & 0x3f);
447 }
448 
449 static __inline unsigned int
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
457 get_SrcB_Y1(tilepro_bundle_bits n)
458 {
459  return (((unsigned int)(n >> 43)) & 0x3f);
460 }
461 
462 static __inline unsigned int
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
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
477 get_UnOpcodeExtension_X1(tilepro_bundle_bits n)
478 {
479  return (((unsigned int)(n >> 43)) & 0x1f);
480 }
481 
482 static __inline unsigned int
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
490 get_UnOpcodeExtension_Y1(tilepro_bundle_bits n)
491 {
492  return (((unsigned int)(n >> 43)) & 0x1f);
493 }
494 
495 static __inline unsigned int
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
503 get_UnShOpcodeExtension_X1(tilepro_bundle_bits n)
504 {
505  return (((unsigned int)(n >> 48)) & 0x3ff);
506 }
507 
508 static __inline unsigned int
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
516 get_UnShOpcodeExtension_Y1(tilepro_bundle_bits n)
517 {
518  return (((unsigned int)(n >> 48)) & 0x7);
519 }
520 
521 
522 static __inline int
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 
532 create_BrOff_SN(int num)
533 {
534  const unsigned int n = (unsigned int)num;
535  return ((n & 0x3ff) << 0);
536 }
537 
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 
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 
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 
562 create_Dest_SN(int num)
563 {
564  const unsigned int n = (unsigned int)num;
565  return ((n & 0x3) << 2);
566 }
567 
569 create_Dest_X0(int num)
570 {
571  const unsigned int n = (unsigned int)num;
572  return ((n & 0x3f) << 0);
573 }
574 
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 
583 create_Dest_Y0(int num)
584 {
585  const unsigned int n = (unsigned int)num;
586  return ((n & 0x3f) << 0);
587 }
588 
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 
597 create_Imm16_X0(int num)
598 {
599  const unsigned int n = (unsigned int)num;
600  return ((n & 0xffff) << 12);
601 }
602 
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 
611 create_Imm8_SN(int num)
612 {
613  const unsigned int n = (unsigned int)num;
614  return ((n & 0xff) << 0);
615 }
616 
618 create_Imm8_X0(int num)
619 {
620  const unsigned int n = (unsigned int)num;
621  return ((n & 0xff) << 12);
622 }
623 
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 
632 create_Imm8_Y0(int num)
633 {
634  const unsigned int n = (unsigned int)num;
635  return ((n & 0xff) << 12);
636 }
637 
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 
646 create_ImmOpcodeExtension_X0(int num)
647 {
648  const unsigned int n = (unsigned int)num;
649  return ((n & 0x7f) << 20);
650 }
651 
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 
660 create_ImmRROpcodeExtension_SN(int num)
661 {
662  const unsigned int n = (unsigned int)num;
663  return ((n & 0x3) << 8);
664 }
665 
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 
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 
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 
697 create_MMEnd_X0(int num)
698 {
699  const unsigned int n = (unsigned int)num;
700  return ((n & 0x1f) << 18);
701 }
702 
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 
711 create_MMStart_X0(int num)
712 {
713  const unsigned int n = (unsigned int)num;
714  return ((n & 0x1f) << 23);
715 }
716 
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 
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 
734 create_Mode(int num)
735 {
736  const unsigned int n = (unsigned int)num;
737  return (((tilepro_bundle_bits)(n & 0x1)) << 63);
738 }
739 
741 create_NoRegOpcodeExtension_SN(int num)
742 {
743  const unsigned int n = (unsigned int)num;
744  return ((n & 0xf) << 0);
745 }
746 
748 create_Opcode_SN(int num)
749 {
750  const unsigned int n = (unsigned int)num;
751  return ((n & 0x3f) << 10);
752 }
753 
755 create_Opcode_X0(int num)
756 {
757  const unsigned int n = (unsigned int)num;
758  return ((n & 0x7) << 28);
759 }
760 
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 
769 create_Opcode_Y0(int num)
770 {
771  const unsigned int n = (unsigned int)num;
772  return ((n & 0xf) << 27);
773 }
774 
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 
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 
790 create_RROpcodeExtension_SN(int num)
791 {
792  const unsigned int n = (unsigned int)num;
793  return ((n & 0xf) << 4);
794 }
795 
797 create_RRROpcodeExtension_X0(int num)
798 {
799  const unsigned int n = (unsigned int)num;
800  return ((n & 0x1ff) << 18);
801 }
802 
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 
811 create_RRROpcodeExtension_Y0(int num)
812 {
813  const unsigned int n = (unsigned int)num;
814  return ((n & 0x3) << 18);
815 }
816 
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 
825 create_RouteOpcodeExtension_SN(int num)
826 {
827  const unsigned int n = (unsigned int)num;
828  return ((n & 0x3ff) << 0);
829 }
830 
832 create_S_X0(int num)
833 {
834  const unsigned int n = (unsigned int)num;
835  return ((n & 0x1) << 27);
836 }
837 
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 
846 create_ShAmt_X0(int num)
847 {
848  const unsigned int n = (unsigned int)num;
849  return ((n & 0x1f) << 12);
850 }
851 
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 
860 create_ShAmt_Y0(int num)
861 {
862  const unsigned int n = (unsigned int)num;
863  return ((n & 0x1f) << 12);
864 }
865 
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 
874 create_SrcA_X0(int num)
875 {
876  const unsigned int n = (unsigned int)num;
877  return ((n & 0x3f) << 6);
878 }
879 
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 
888 create_SrcA_Y0(int num)
889 {
890  const unsigned int n = (unsigned int)num;
891  return ((n & 0x3f) << 6);
892 }
893 
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 
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 
910 create_SrcBDest_Y2(int num)
911 {
912  const unsigned int n = (unsigned int)num;
913  return ((n & 0x3f) << 20);
914 }
915 
917 create_SrcB_X0(int num)
918 {
919  const unsigned int n = (unsigned int)num;
920  return ((n & 0x3f) << 12);
921 }
922 
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 
931 create_SrcB_Y0(int num)
932 {
933  const unsigned int n = (unsigned int)num;
934  return ((n & 0x3f) << 12);
935 }
936 
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 
945 create_Src_SN(int num)
946 {
947  const unsigned int n = (unsigned int)num;
948  return ((n & 0x3) << 0);
949 }
950 
952 create_UnOpcodeExtension_X0(int num)
953 {
954  const unsigned int n = (unsigned int)num;
955  return ((n & 0x1f) << 12);
956 }
957 
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 
966 create_UnOpcodeExtension_Y0(int num)
967 {
968  const unsigned int n = (unsigned int)num;
969  return ((n & 0x1f) << 12);
970 }
971 
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 
980 create_UnShOpcodeExtension_X0(int num)
981 {
982  const unsigned int n = (unsigned int)num;
983  return ((n & 0x3ff) << 17);
984 }
985 
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 
994 create_UnShOpcodeExtension_Y0(int num)
995 {
996  const unsigned int n = (unsigned int)num;
997  return ((n & 0x7) << 17);
998 }
999 
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 {
1466 };
1467 
1468 
1469 #endif /* __ASSEMBLER__ */
1470 
1471 #endif /* __ARCH_OPCODE_H__ */