21 #ifndef __ARCH_OPCODE_H__
22 #define __ARCH_OPCODE_H__
29 #define TILEGX_BUNDLE_MODE_MASK ((tilegx_bundle_bits)3 << 62)
60 #define TILE_BUNDLE_SIZE_IN_BYTES TILEGX_BUNDLE_SIZE_IN_BYTES
61 #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES
62 #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
63 TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
66 #define TILEGX_BPT_BUNDLE 0x286a44ae51485000ULL
71 const unsigned int n = (
unsigned int)num;
72 return (((n >> 12)) & 0x3f);
78 const unsigned int n = (
unsigned int)num;
79 return (((n >> 24)) & 0xf);
85 const unsigned int n = (
unsigned int)num;
86 return (((n >> 18)) & 0x3f);
92 return (((
unsigned int)(n >> 31)) & 0x0000003f) |
93 (((
unsigned int)(n >> 37)) & 0x0001ffc0);
99 return (((
unsigned int)(n >> 54)) & 0x1f);
105 return (((
unsigned int)(n >> 31)) & 0x0000003f) |
106 (((
unsigned int)(n >> 43)) & 0x000000c0);
112 const unsigned int n = (
unsigned int)num;
113 return (((n >> 0)) & 0x3f);
119 return (((
unsigned int)(n >> 31)) & 0x3f);
125 const unsigned int n = (
unsigned int)num;
126 return (((n >> 0)) & 0x3f);
132 return (((
unsigned int)(n >> 31)) & 0x3f);
138 const unsigned int n = (
unsigned int)num;
139 return (((n >> 12)) & 0xffff);
145 return (((
unsigned int)(n >> 43)) & 0xffff);
151 const unsigned int n = (
unsigned int)num;
152 return (((n >> 20)) & 0xff);
158 return (((
unsigned int)(n >> 51)) & 0xff);
164 const unsigned int n = (
unsigned int)num;
165 return (((n >> 12)) & 0xff);
171 return (((
unsigned int)(n >> 43)) & 0xff);
177 const unsigned int n = (
unsigned int)num;
178 return (((n >> 12)) & 0xff);
184 return (((
unsigned int)(n >> 43)) & 0xff);
190 return (((
unsigned int)(n >> 31)) & 0x7ffffff);
196 return (((
unsigned int)(n >> 58)) & 0x1);
202 return (((
unsigned int)(n >> 37)) & 0x3fff);
208 return (((
unsigned int)(n >> 31)) & 0x0000003f) |
209 (((
unsigned int)(n >> 37)) & 0x00003fc0);
215 return (((
unsigned int)(n >> 62)) & 0x3);
221 const unsigned int n = (
unsigned int)num;
222 return (((n >> 28)) & 0x7);
228 return (((
unsigned int)(n >> 59)) & 0x7);
234 const unsigned int n = (
unsigned int)num;
235 return (((n >> 27)) & 0xf);
241 return (((
unsigned int)(n >> 58)) & 0xf);
247 return (((n >> 26)) & 0x00000001) |
248 (((
unsigned int)(n >> 56)) & 0x00000002);
254 const unsigned int n = (
unsigned int)num;
255 return (((n >> 18)) & 0x3ff);
261 return (((
unsigned int)(n >> 49)) & 0x3ff);
267 const unsigned int n = (
unsigned int)num;
268 return (((n >> 18)) & 0x3);
274 return (((
unsigned int)(n >> 49)) & 0x3);
280 const unsigned int n = (
unsigned int)num;
281 return (((n >> 12)) & 0x3f);
287 return (((
unsigned int)(n >> 43)) & 0x3f);
293 const unsigned int n = (
unsigned int)num;
294 return (((n >> 12)) & 0x3f);
300 return (((
unsigned int)(n >> 43)) & 0x3f);
306 const unsigned int n = (
unsigned int)num;
307 return (((n >> 18)) & 0x3ff);
313 return (((
unsigned int)(n >> 49)) & 0x3ff);
319 const unsigned int n = (
unsigned int)num;
320 return (((n >> 18)) & 0x3);
326 return (((
unsigned int)(n >> 49)) & 0x3);
332 const unsigned int n = (
unsigned int)num;
333 return (((n >> 6)) & 0x3f);
339 return (((
unsigned int)(n >> 37)) & 0x3f);
345 const unsigned int n = (
unsigned int)num;
346 return (((n >> 6)) & 0x3f);
352 return (((
unsigned int)(n >> 37)) & 0x3f);
358 const unsigned int n = (
unsigned int)num;
359 return (((n >> 20)) & 0x3f);
365 return (((
unsigned int)(n >> 51)) & 0x3f);
371 const unsigned int n = (
unsigned int)num;
372 return (((n >> 12)) & 0x3f);
378 return (((
unsigned int)(n >> 43)) & 0x3f);
384 const unsigned int n = (
unsigned int)num;
385 return (((n >> 12)) & 0x3f);
391 return (((
unsigned int)(n >> 43)) & 0x3f);
397 const unsigned int n = (
unsigned int)num;
398 return (((n >> 12)) & 0x3f);
404 return (((
unsigned int)(n >> 43)) & 0x3f);
410 const unsigned int n = (
unsigned int)num;
411 return (((n >> 12)) & 0x3f);
417 return (((
unsigned int)(n >> 43)) & 0x3f);
424 int shift = (
int)(
sizeof(
int) * 8 - num_bits);
425 return (n << shift) >> shift;
431 create_BFEnd_X0(
int num)
433 const unsigned int n = (
unsigned int)num;
434 return ((n & 0x3f) << 12);
438 create_BFOpcodeExtension_X0(
int num)
440 const unsigned int n = (
unsigned int)num;
441 return ((n & 0xf) << 24);
445 create_BFStart_X0(
int num)
447 const unsigned int n = (
unsigned int)num;
448 return ((n & 0x3f) << 18);
452 create_BrOff_X1(
int num)
454 const unsigned int n = (
unsigned int)num;
460 create_BrType_X1(
int num)
462 const unsigned int n = (
unsigned int)num;
467 create_Dest_Imm8_X1(
int num)
469 const unsigned int n = (
unsigned int)num;
475 create_Dest_X0(
int num)
477 const unsigned int n = (
unsigned int)num;
478 return ((n & 0x3f) << 0);
482 create_Dest_X1(
int num)
484 const unsigned int n = (
unsigned int)num;
489 create_Dest_Y0(
int num)
491 const unsigned int n = (
unsigned int)num;
492 return ((n & 0x3f) << 0);
496 create_Dest_Y1(
int num)
498 const unsigned int n = (
unsigned int)num;
503 create_Imm16_X0(
int num)
505 const unsigned int n = (
unsigned int)num;
506 return ((n & 0xffff) << 12);
510 create_Imm16_X1(
int num)
512 const unsigned int n = (
unsigned int)num;
517 create_Imm8OpcodeExtension_X0(
int num)
519 const unsigned int n = (
unsigned int)num;
520 return ((n & 0xff) << 20);
524 create_Imm8OpcodeExtension_X1(
int num)
526 const unsigned int n = (
unsigned int)num;
531 create_Imm8_X0(
int num)
533 const unsigned int n = (
unsigned int)num;
534 return ((n & 0xff) << 12);
538 create_Imm8_X1(
int num)
540 const unsigned int n = (
unsigned int)num;
545 create_Imm8_Y0(
int num)
547 const unsigned int n = (
unsigned int)num;
548 return ((n & 0xff) << 12);
552 create_Imm8_Y1(
int num)
554 const unsigned int n = (
unsigned int)num;
559 create_JumpOff_X1(
int num)
561 const unsigned int n = (
unsigned int)num;
566 create_JumpOpcodeExtension_X1(
int num)
568 const unsigned int n = (
unsigned int)num;
573 create_MF_Imm14_X1(
int num)
575 const unsigned int n = (
unsigned int)num;
580 create_MT_Imm14_X1(
int num)
582 const unsigned int n = (
unsigned int)num;
590 const unsigned int n = (
unsigned int)num;
595 create_Opcode_X0(
int num)
597 const unsigned int n = (
unsigned int)num;
598 return ((n & 0x7) << 28);
602 create_Opcode_X1(
int num)
604 const unsigned int n = (
unsigned int)num;
609 create_Opcode_Y0(
int num)
611 const unsigned int n = (
unsigned int)num;
612 return ((n & 0xf) << 27);
616 create_Opcode_Y1(
int num)
618 const unsigned int n = (
unsigned int)num;
623 create_Opcode_Y2(
int num)
625 const unsigned int n = (
unsigned int)num;
626 return ((n & 0x00000001) << 26) |
631 create_RRROpcodeExtension_X0(
int num)
633 const unsigned int n = (
unsigned int)num;
634 return ((n & 0x3ff) << 18);
638 create_RRROpcodeExtension_X1(
int num)
640 const unsigned int n = (
unsigned int)num;
645 create_RRROpcodeExtension_Y0(
int num)
647 const unsigned int n = (
unsigned int)num;
648 return ((n & 0x3) << 18);
652 create_RRROpcodeExtension_Y1(
int num)
654 const unsigned int n = (
unsigned int)num;
659 create_ShAmt_X0(
int num)
661 const unsigned int n = (
unsigned int)num;
662 return ((n & 0x3f) << 12);
666 create_ShAmt_X1(
int num)
668 const unsigned int n = (
unsigned int)num;
673 create_ShAmt_Y0(
int num)
675 const unsigned int n = (
unsigned int)num;
676 return ((n & 0x3f) << 12);
680 create_ShAmt_Y1(
int num)
682 const unsigned int n = (
unsigned int)num;
687 create_ShiftOpcodeExtension_X0(
int num)
689 const unsigned int n = (
unsigned int)num;
690 return ((n & 0x3ff) << 18);
694 create_ShiftOpcodeExtension_X1(
int num)
696 const unsigned int n = (
unsigned int)num;
701 create_ShiftOpcodeExtension_Y0(
int num)
703 const unsigned int n = (
unsigned int)num;
704 return ((n & 0x3) << 18);
708 create_ShiftOpcodeExtension_Y1(
int num)
710 const unsigned int n = (
unsigned int)num;
715 create_SrcA_X0(
int num)
717 const unsigned int n = (
unsigned int)num;
718 return ((n & 0x3f) << 6);
722 create_SrcA_X1(
int num)
724 const unsigned int n = (
unsigned int)num;
729 create_SrcA_Y0(
int num)
731 const unsigned int n = (
unsigned int)num;
732 return ((n & 0x3f) << 6);
736 create_SrcA_Y1(
int num)
738 const unsigned int n = (
unsigned int)num;
743 create_SrcA_Y2(
int num)
745 const unsigned int n = (
unsigned int)num;
746 return ((n & 0x3f) << 20);
750 create_SrcBDest_Y2(
int num)
752 const unsigned int n = (
unsigned int)num;
757 create_SrcB_X0(
int num)
759 const unsigned int n = (
unsigned int)num;
760 return ((n & 0x3f) << 12);
764 create_SrcB_X1(
int num)
766 const unsigned int n = (
unsigned int)num;
771 create_SrcB_Y0(
int num)
773 const unsigned int n = (
unsigned int)num;
774 return ((n & 0x3f) << 12);
778 create_SrcB_Y1(
int num)
780 const unsigned int n = (
unsigned int)num;
785 create_UnaryOpcodeExtension_X0(
int num)
787 const unsigned int n = (
unsigned int)num;
788 return ((n & 0x3f) << 12);
792 create_UnaryOpcodeExtension_X1(
int num)
794 const unsigned int n = (
unsigned int)num;
799 create_UnaryOpcodeExtension_Y0(
int num)
801 const unsigned int n = (
unsigned int)num;
802 return ((n & 0x3f) << 12);
806 create_UnaryOpcodeExtension_Y1(
int num)
808 const unsigned int n = (
unsigned int)num;