Home | History | Annotate | Download | only in brw

Lines Matching refs:file

411 static int string(FILE *file, const char *str)
413 fputs(str, file);
421 static int format(FILE *f, const char *fmt, ...)
434 static void newline(FILE *f)
440 static void pad(FILE *f, int c)
447 static void control(FILE *file, const char *name, const char *ctrl[], unsigned id, int *space)
450 fprintf(file, "*** invalid %s value %d ",
456 string(file, " ");
457 string(file, ctrl[id]);
463 static void print_opcode(FILE *file, int id)
466 format(file, "*** invalid opcode value %d ", id);
469 string(file, opcode[id].name);
472 static int reg(FILE *file, unsigned _reg_file, unsigned _reg_nr)
481 string(file, "null");
484 format(file, "a%d", _reg_nr & 0x0f);
487 format(file, "acc%d", _reg_nr & 0x0f);
490 format(file, "f%d", _reg_nr & 0x0f);
493 format(file, "mask%d", _reg_nr & 0x0f);
496 format(file, "msd%d", _reg_nr & 0x0f);
499 format(file, "sr%d", _reg_nr & 0x0f);
502 format(file, "cr%d", _reg_nr & 0x0f);
505 format(file, "n%d", _reg_nr & 0x0f);
508 string(file, "ip");
511 format(file, "ARF%d", _reg_nr);
515 control(file, "src reg file", reg_file, _reg_file, NULL);
516 format(file, "%d", _reg_nr);
521 static void dest(FILE *file, const struct brw_instruction *inst)
525 if (reg(file, inst->bits1.da1.dest_reg_file, inst->bits1.da1.dest_reg_nr))
529 format(file, ".%d", inst->bits1.da1.dest_subreg_nr /
531 format(file, "<%d>", inst->bits1.da1.dest_horiz_stride);
532 control(file, "dest reg encoding", reg_encoding, inst->bits1.da1.dest_reg_type, NULL);
534 string(file, "g[a0");
536 format(file, ".%d", inst->bits1.ia1.dest_subreg_nr /
539 format(file, " %d", inst->bits1.ia1.dest_indirect_offset);
540 string(file, "]");
541 format(file, "<%d>", inst->bits1.ia1.dest_horiz_stride);
542 control(file, "dest reg encoding", reg_encoding, inst->bits1.ia1.dest_reg_type, NULL);
546 if (reg(file, inst->bits1.da16.dest_reg_file, inst->bits1.da16.dest_reg_nr))
550 format(file, ".%d", inst->bits1.da16.dest_subreg_nr /
552 string(file, "<1>");
553 control(file, "writemask", writemask, inst->bits1.da16.dest_writemask, NULL);
554 control(file, "dest reg encoding", reg_encoding, inst->bits1.da16.dest_reg_type, NULL);
556 string(file, "Indirect align16 address mode not supported");
561 static void src_align1_region(FILE *file,
564 string(file, "<");
565 control(file, "vert stride", vert_stride, _vert_stride, NULL);
566 string(file, ",");
567 control(file, "width", width, _width, NULL);
568 string(file, ",");
569 control(file, "horiz_stride", horiz_stride, _horiz_stride, NULL);
570 string(file, ">");
573 static void src_da1(FILE *file, unsigned type, unsigned _reg_file,
577 control(file, "negate", negate, _negate, NULL);
578 control(file, "abs", _abs, __abs, NULL);
580 if (reg(file, _reg_file, reg_num))
584 format(file, ".%d", sub_reg_num / reg_type_size[type]); /* use formal style like spec */
585 src_align1_region(file, _vert_stride, _width, _horiz_stride);
586 control(file, "src reg encoding", reg_encoding, type, NULL);
589 static void src_ia1(FILE *file,
601 control(file, "negate", negate, _negate, NULL);
602 control(file, "abs", _abs, __abs, NULL);
604 string(file, "g[a0");
606 format(file, ".%d", _addr_subreg_nr);
608 format(file, " %d", _addr_imm);
609 string(file, "]");
610 src_align1_region(file, _vert_stride, _width, _horiz_stride);
611 control(file, "src reg encoding", reg_encoding, type, NULL);
614 static void src_da16(FILE *file,
627 control(file, "negate", negate, _negate, NULL);
628 control(file, "abs", _abs, __abs, NULL);
630 if (reg(file, _reg_file, _reg_nr))
636 format(file, ".%d", 16 / reg_type_size[_reg_type]);
637 string(file, "<");
638 control(file, "vert stride", vert_stride, _vert_stride, NULL);
639 string(file, ",4,1>");
655 string(file, ".");
656 control(file, "channel select", chan_sel, swz_x, NULL);
660 string(file, ".");
661 control(file, "channel select", chan_sel, swz_x, NULL);
662 control(file, "channel select", chan_sel, swz_y, NULL);
663 control(file, "channel select", chan_sel, swz_z, NULL);
664 control(file, "channel select", chan_sel, swz_w, NULL);
666 control(file, "src da16 reg type", reg_encoding, _reg_type, NULL);
669 static void imm(FILE *file, unsigned type, const struct brw_instruction *inst)
673 format(file, "0x%08xUD", inst->bits3.ud);
676 format(file, "%dD", inst->bits3.d);
679 format(file, "0x%04xUW", (uint16_t) inst->bits3.ud);
682 format(file, "%dW", (int16_t) inst->bits3.d);
685 format(file, "0x%02xUB", (int8_t) inst->bits3.ud);
688 format(file, "Vector Float");
691 format(file, "0x%08xV", inst->bits3.ud);
694 format(file, "%-gF", inst->bits3.f);
698 static void src0(FILE *file, const struct brw_instruction *inst)
701 imm(file, inst->bits1.da1.src0_reg_type, inst);
704 src_da1(file,
715 src_ia1(file,
729 src_da16(file,
742 string(file, "Indirect align16 address mode not supported");
747 static void src1(FILE *file, const struct brw_instruction *inst)
750 imm(file, inst->bits1.da1.src1_reg_type, inst);
753 src_da1(file,
764 src_ia1(file,
778 src_da16(file,
791 string(file, "Indirect align16 address mode not supported");
805 static int qtr_ctrl(FILE *file, const struct brw_instruction *inst)
813 string(file, " 1Q");
816 string(file, " 2Q");
819 string(file, " 3Q");
822 string(file, " 4Q");
827 string(file, " 1H");
829 string(file, " 2H");
834 void brw_disasm(FILE *file, const struct brw_instruction *inst, int gen)
838 format(file, "%08x %08x %08x %08x\n",
845 string(file, "(");
846 control(file, "predicate inverse", pred_inv, inst->header.predicate_inverse, NULL);
847 string(file, "f0");
849 format(file, ".%d", inst->bits2.da1.flag_subreg_nr);
851 control(file, "predicate control align1", pred_ctrl_align1,
854 control(file, "predicate control align16", pred_ctrl_align16,
856 string(file, ") ");
859 print_opcode(file, inst->header.opcode);
860 control(file, "saturate", saturate, inst->header.saturate, NULL);
861 control(file, "debug control", debug_ctrl, inst->header.debug_control, NULL);
864 string(file, " ");
865 control(file, "function", math_function,
869 control(file, "conditional modifier", conditional_modifier,
873 string(file, "(");
874 control(file, "execution size", exec_size, inst->header.execution_size, NULL);
875 string(file, ")");
879 format(file, " %d", inst->header.destreg__conditionalmod);
882 pad(file, 16);
883 dest(file, inst);
889 format(file, " %d", inst->bits1.branch_gen6.jump_count);
893 pad(file, 32);
894 src0(file, inst);
897 pad(file, 48);
898 src1(file, inst);
912 newline (file);
913 pad (file, 16);
917 control (file, "target function", target_function_gen6,
920 control (file, "target function", target_function,
926 control (file, "math function", math_function,
928 control (file, "math saturate", math_saturate,
930 control (file, "math signed", math_signed,
932 control (file, "math scalar", math_scalar,
934 control (file, "math precision", math_precision,
939 format (file, " (%d, %d, %d, %d)",
945 format (file, " (%d, %d, %d, %d)",
951 format (file, " (%d, %d)",
955 format (file, " (%d, %d, ",
958 control (file, "sampler target format",
961 string (file, ")");
966 format (file, " (%d, %d, %d, %d)",
972 format (file, " (%d, %d, %d)",
977 format (file, " (%d, %d, %d)",
986 format (file, " (");
988 control (file, "DP rc message type",
992 format (file, ", %d, %d, %d)",
997 format (file, " (");
999 control (file, "DP rc message type",
1003 format (file, ", %d, %d, %d, %d)",
1009 format (file, " (%d, %d, %d, %d)",
1020 format (file, " %d", inst->bits3.urb_gen5.offset);
1022 format (file, " %d", inst->bits3.urb.offset);
1027 control (file, "urb opcode", urb_opcode,
1030 control (file, "urb swizzle", urb_swizzle,
1032 control (file, "urb allocate", urb_allocate,
1034 control (file, "urb used", urb_used,
1036 control (file, "urb complete", urb_complete,
1042 format (file, " (%d, %d, %d)",
1050 format (file, "unsupported target %d", target);
1054 string (file, " ");
1056 format (file, "mlen %d",
1058 format (file, " rlen %d",
1061 format (file, "mlen %d",
1063 format (file, " rlen %d",
1067 pad(file, 64);
1069 string(file, "{");
1071 control(file, "access mode", access_mode, inst->header.access_mode, &space);
1073 control(file, "write enable control", wectrl, inst->header.mask_control, &space);
1075 control(file, "mask control", mask_ctrl, inst->header.mask_control, &space);
1076 control(file, "dependency control", dep_ctrl, inst->header.dependency_control, &space);
1079 qtr_ctrl(file, inst);
1085 format(file, " compr4");
1087 control(file, "compression control", compr_ctrl,
1092 control(file, "thread control", thread_ctrl, inst->header.thread_control, &space);
1094 control(file, "acc write control", accwr, inst->header.acc_wr_control, &space);
1097 control(file, "end of thread", end_of_thread,
1100 string(file, " ");
1101 string(file, "}");
1103 string(file, ";");
1104 newline(file);