2 * Copyright © 2008 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
30 #include "main/mtypes.h"
32 #include "brw_context.h"
33 #include "brw_defines.h"
40 [BRW_OPCODE_MOV
] = { .name
= "mov", .nsrc
= 1, .ndst
= 1 },
41 [BRW_OPCODE_FRC
] = { .name
= "frc", .nsrc
= 1, .ndst
= 1 },
42 [BRW_OPCODE_RNDU
] = { .name
= "rndu", .nsrc
= 1, .ndst
= 1 },
43 [BRW_OPCODE_RNDD
] = { .name
= "rndd", .nsrc
= 1, .ndst
= 1 },
44 [BRW_OPCODE_RNDE
] = { .name
= "rnde", .nsrc
= 1, .ndst
= 1 },
45 [BRW_OPCODE_RNDZ
] = { .name
= "rndz", .nsrc
= 1, .ndst
= 1 },
46 [BRW_OPCODE_NOT
] = { .name
= "not", .nsrc
= 1, .ndst
= 1 },
47 [BRW_OPCODE_LZD
] = { .name
= "lzd", .nsrc
= 1, .ndst
= 1 },
49 [BRW_OPCODE_MUL
] = { .name
= "mul", .nsrc
= 2, .ndst
= 1 },
50 [BRW_OPCODE_MAC
] = { .name
= "mac", .nsrc
= 2, .ndst
= 1 },
51 [BRW_OPCODE_MACH
] = { .name
= "mach", .nsrc
= 2, .ndst
= 1 },
52 [BRW_OPCODE_LINE
] = { .name
= "line", .nsrc
= 2, .ndst
= 1 },
53 [BRW_OPCODE_SAD2
] = { .name
= "sad2", .nsrc
= 2, .ndst
= 1 },
54 [BRW_OPCODE_SADA2
] = { .name
= "sada2", .nsrc
= 2, .ndst
= 1 },
55 [BRW_OPCODE_DP4
] = { .name
= "dp4", .nsrc
= 2, .ndst
= 1 },
56 [BRW_OPCODE_DPH
] = { .name
= "dph", .nsrc
= 2, .ndst
= 1 },
57 [BRW_OPCODE_DP3
] = { .name
= "dp3", .nsrc
= 2, .ndst
= 1 },
58 [BRW_OPCODE_DP2
] = { .name
= "dp2", .nsrc
= 2, .ndst
= 1 },
60 [BRW_OPCODE_AVG
] = { .name
= "avg", .nsrc
= 2, .ndst
= 1 },
61 [BRW_OPCODE_ADD
] = { .name
= "add", .nsrc
= 2, .ndst
= 1 },
62 [BRW_OPCODE_SEL
] = { .name
= "sel", .nsrc
= 2, .ndst
= 1 },
63 [BRW_OPCODE_AND
] = { .name
= "and", .nsrc
= 2, .ndst
= 1 },
64 [BRW_OPCODE_OR
] = { .name
= "or", .nsrc
= 2, .ndst
= 1 },
65 [BRW_OPCODE_XOR
] = { .name
= "xor", .nsrc
= 2, .ndst
= 1 },
66 [BRW_OPCODE_SHR
] = { .name
= "shr", .nsrc
= 2, .ndst
= 1 },
67 [BRW_OPCODE_SHL
] = { .name
= "shl", .nsrc
= 2, .ndst
= 1 },
68 [BRW_OPCODE_ASR
] = { .name
= "asr", .nsrc
= 2, .ndst
= 1 },
69 [BRW_OPCODE_CMP
] = { .name
= "cmp", .nsrc
= 2, .ndst
= 1 },
70 [BRW_OPCODE_CMPN
] = { .name
= "cmpn", .nsrc
= 2, .ndst
= 1 },
72 [BRW_OPCODE_SEND
] = { .name
= "send", .nsrc
= 1, .ndst
= 1 },
73 [BRW_OPCODE_NOP
] = { .name
= "nop", .nsrc
= 0, .ndst
= 0 },
74 [BRW_OPCODE_JMPI
] = { .name
= "jmpi", .nsrc
= 1, .ndst
= 0 },
75 [BRW_OPCODE_IF
] = { .name
= "if", .nsrc
= 2, .ndst
= 0 },
76 [BRW_OPCODE_IFF
] = { .name
= "iff", .nsrc
= 1, .ndst
= 01 },
77 [BRW_OPCODE_WHILE
] = { .name
= "while", .nsrc
= 1, .ndst
= 0 },
78 [BRW_OPCODE_ELSE
] = { .name
= "else", .nsrc
= 2, .ndst
= 0 },
79 [BRW_OPCODE_BREAK
] = { .name
= "break", .nsrc
= 1, .ndst
= 0 },
80 [BRW_OPCODE_CONTINUE
] = { .name
= "cont", .nsrc
= 1, .ndst
= 0 },
81 [BRW_OPCODE_HALT
] = { .name
= "halt", .nsrc
= 1, .ndst
= 0 },
82 [BRW_OPCODE_MSAVE
] = { .name
= "msave", .nsrc
= 1, .ndst
= 1 },
83 [BRW_OPCODE_PUSH
] = { .name
= "push", .nsrc
= 1, .ndst
= 1 },
84 [BRW_OPCODE_MRESTORE
] = { .name
= "mrest", .nsrc
= 1, .ndst
= 1 },
85 [BRW_OPCODE_POP
] = { .name
= "pop", .nsrc
= 2, .ndst
= 0 },
86 [BRW_OPCODE_WAIT
] = { .name
= "wait", .nsrc
= 1, .ndst
= 0 },
87 [BRW_OPCODE_DO
] = { .name
= "do", .nsrc
= 0, .ndst
= 0 },
88 [BRW_OPCODE_ENDIF
] = { .name
= "endif", .nsrc
= 2, .ndst
= 0 },
91 char *conditional_modifier
[16] = {
92 [BRW_CONDITIONAL_NONE
] = "",
93 [BRW_CONDITIONAL_Z
] = ".e",
94 [BRW_CONDITIONAL_NZ
] = ".ne",
95 [BRW_CONDITIONAL_G
] = ".g",
96 [BRW_CONDITIONAL_GE
] = ".ge",
97 [BRW_CONDITIONAL_L
] = ".l",
98 [BRW_CONDITIONAL_LE
] = ".le",
99 [BRW_CONDITIONAL_R
] = ".r",
100 [BRW_CONDITIONAL_O
] = ".o",
101 [BRW_CONDITIONAL_U
] = ".u",
114 char *vert_stride
[16] = {
133 char *horiz_stride
[4] = {
140 char *chan_sel
[4] = {
147 char *dest_condmod
[16] = {
150 char *debug_ctrl
[2] = {
155 char *saturate
[2] = {
160 char *exec_size
[8] = {
169 char *pred_inv
[2] = {
174 char *pred_ctrl_align16
[16] = {
184 char *pred_ctrl_align1
[16] = {
198 char *thread_ctrl
[4] = {
203 char *compr_ctrl
[4] = {
209 char *dep_ctrl
[4] = {
213 [3] = "NoDDClr,NoDDChk",
216 char *mask_ctrl
[4] = {
221 char *access_mode
[2] = {
226 char *reg_encoding
[8] = {
236 char *imm_encoding
[8] = {
246 char *reg_file
[4] = {
253 char *writemask
[16] = {
272 char *end_of_thread
[2] = {
277 char *target_function
[16] = {
278 [BRW_MESSAGE_TARGET_NULL
] = "null",
279 [BRW_MESSAGE_TARGET_MATH
] = "math",
280 [BRW_MESSAGE_TARGET_SAMPLER
] = "sampler",
281 [BRW_MESSAGE_TARGET_GATEWAY
] = "gateway",
282 [BRW_MESSAGE_TARGET_DATAPORT_READ
] = "read",
283 [BRW_MESSAGE_TARGET_DATAPORT_WRITE
] = "write",
284 [BRW_MESSAGE_TARGET_URB
] = "urb",
285 [BRW_MESSAGE_TARGET_THREAD_SPAWNER
] = "thread_spawner"
288 char *math_function
[16] = {
289 [BRW_MATH_FUNCTION_INV
] = "inv",
290 [BRW_MATH_FUNCTION_LOG
] = "log",
291 [BRW_MATH_FUNCTION_EXP
] = "exp",
292 [BRW_MATH_FUNCTION_SQRT
] = "sqrt",
293 [BRW_MATH_FUNCTION_RSQ
] = "rsq",
294 [BRW_MATH_FUNCTION_SIN
] = "sin",
295 [BRW_MATH_FUNCTION_COS
] = "cos",
296 [BRW_MATH_FUNCTION_SINCOS
] = "sincos",
297 [BRW_MATH_FUNCTION_TAN
] = "tan",
298 [BRW_MATH_FUNCTION_POW
] = "pow",
299 [BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER
] = "intdivmod",
300 [BRW_MATH_FUNCTION_INT_DIV_QUOTIENT
] = "intmod",
301 [BRW_MATH_FUNCTION_INT_DIV_REMAINDER
] = "intdiv",
304 char *math_saturate
[2] = {
309 char *math_signed
[2] = {
314 char *math_scalar
[2] = {
319 char *math_precision
[2] = {
321 [1] = "partial_precision"
324 char *urb_swizzle
[4] = {
325 [BRW_URB_SWIZZLE_NONE
] = "",
326 [BRW_URB_SWIZZLE_INTERLEAVE
] = "interleave",
327 [BRW_URB_SWIZZLE_TRANSPOSE
] = "transpose",
330 char *urb_allocate
[2] = {
335 char *urb_used
[2] = {
340 char *urb_complete
[2] = {
345 char *sampler_target_format
[4] = {
354 static int string (FILE *file
, char *string
)
356 fputs (string
, file
);
357 column
+= strlen (string
);
361 static int format (FILE *f
, char *format
, ...)
365 va_start (args
, format
);
367 vsnprintf (buf
, sizeof (buf
) - 1, format
, args
);
373 static int newline (FILE *f
)
380 static int pad (FILE *f
, int c
)
388 static int control (FILE *file
, char *name
, char *ctrl
[], GLuint id
, int *space
)
391 fprintf (file
, "*** invalid %s value %d ",
399 string (file
, ctrl
[id
]);
406 static int print_opcode (FILE *file
, int id
)
408 if (!opcode
[id
].name
) {
409 format (file
, "*** invalid opcode value %d ", id
);
412 string (file
, opcode
[id
].name
);
416 static int reg (FILE *file
, GLuint _reg_file
, GLuint _reg_nr
)
419 if (_reg_file
== BRW_ARCHITECTURE_REGISTER_FILE
) {
420 switch (_reg_nr
& 0xf0) {
422 string (file
, "null");
424 case BRW_ARF_ADDRESS
:
425 format (file
, "a%d", _reg_nr
& 0x0f);
427 case BRW_ARF_ACCUMULATOR
:
428 format (file
, "acc%d", _reg_nr
& 0x0f);
431 format (file
, "mask%d", _reg_nr
& 0x0f);
433 case BRW_ARF_MASK_STACK
:
434 format (file
, "msd%d", _reg_nr
& 0x0f);
437 format (file
, "sr%d", _reg_nr
& 0x0f);
439 case BRW_ARF_CONTROL
:
440 format (file
, "cr%d", _reg_nr
& 0x0f);
442 case BRW_ARF_NOTIFICATION_COUNT
:
443 format (file
, "n%d", _reg_nr
& 0x0f);
450 format (file
, "ARF%d", _reg_nr
);
454 err
|= control (file
, "src reg file", reg_file
, _reg_file
, NULL
);
455 format (file
, "%d", _reg_nr
);
460 static int dest (FILE *file
, struct brw_instruction
*inst
)
464 if (inst
->header
.access_mode
== BRW_ALIGN_1
)
466 if (inst
->bits1
.da1
.dest_address_mode
== BRW_ADDRESS_DIRECT
)
468 err
|= reg (file
, inst
->bits1
.da1
.dest_reg_file
, inst
->bits1
.da1
.dest_reg_nr
);
471 if (inst
->bits1
.da1
.dest_subreg_nr
)
472 format (file
, ".%d", inst
->bits1
.da1
.dest_subreg_nr
);
473 format (file
, "<%d>", inst
->bits1
.da1
.dest_horiz_stride
);
474 err
|= control (file
, "dest reg encoding", reg_encoding
, inst
->bits1
.da1
.dest_reg_type
, NULL
);
478 string (file
, "g[a0");
479 if (inst
->bits1
.ia1
.dest_subreg_nr
)
480 format (file
, ".%d", inst
->bits1
.ia1
.dest_subreg_nr
);
481 if (inst
->bits1
.ia1
.dest_indirect_offset
)
482 format (file
, " %d", inst
->bits1
.ia1
.dest_indirect_offset
);
484 format (file
, "<%d>", inst
->bits1
.ia1
.dest_horiz_stride
);
485 err
|= control (file
, "dest reg encoding", reg_encoding
, inst
->bits1
.ia1
.dest_reg_type
, NULL
);
490 if (inst
->bits1
.da16
.dest_address_mode
== BRW_ADDRESS_DIRECT
)
492 err
|= reg (file
, inst
->bits1
.da16
.dest_reg_file
, inst
->bits1
.da16
.dest_reg_nr
);
495 if (inst
->bits1
.da16
.dest_subreg_nr
)
496 format (file
, ".%d", inst
->bits1
.da16
.dest_subreg_nr
);
497 string (file
, "<1>");
498 err
|= control (file
, "writemask", writemask
, inst
->bits1
.da16
.dest_writemask
, NULL
);
499 err
|= control (file
, "dest reg encoding", reg_encoding
, inst
->bits1
.da16
.dest_reg_type
, NULL
);
504 string (file
, "Indirect align16 address mode not supported");
511 static int src_align1_region (FILE *file
,
512 GLuint _vert_stride
, GLuint _width
, GLuint _horiz_stride
)
516 err
|= control (file
, "vert stride", vert_stride
, _vert_stride
, NULL
);
518 err
|= control (file
, "width", width
, _width
, NULL
);
520 err
|= control (file
, "horiz_stride", horiz_stride
, _horiz_stride
, NULL
);
525 static int src_da1 (FILE *file
, GLuint type
, GLuint _reg_file
,
526 GLuint _vert_stride
, GLuint _width
, GLuint _horiz_stride
,
527 GLuint reg_num
, GLuint sub_reg_num
, GLuint __abs
, GLuint _negate
)
530 err
|= control (file
, "negate", negate
, _negate
, NULL
);
531 err
|= control (file
, "abs", _abs
, __abs
, NULL
);
533 err
|= reg (file
, _reg_file
, reg_num
);
537 format (file
, ".%d", sub_reg_num
);
538 src_align1_region (file
, _vert_stride
, _width
, _horiz_stride
);
539 err
|= control (file
, "src reg encoding", reg_encoding
, type
, NULL
);
543 static int src_ia1 (FILE *file
,
547 GLuint _addr_subreg_nr
,
551 GLuint _horiz_stride
,
556 err
|= control (file
, "negate", negate
, _negate
, NULL
);
557 err
|= control (file
, "abs", _abs
, __abs
, NULL
);
559 string (file
, "g[a0");
561 format (file
, ".%d", _addr_subreg_nr
);
563 format (file
, " %d", _addr_imm
);
565 src_align1_region (file
, _vert_stride
, _width
, _horiz_stride
);
566 err
|= control (file
, "src reg encoding", reg_encoding
, type
, NULL
);
570 static int src_da16 (FILE *file
,
584 err
|= control (file
, "negate", negate
, _negate
, NULL
);
585 err
|= control (file
, "abs", _abs
, __abs
, NULL
);
587 err
|= reg (file
, _reg_file
, _reg_nr
);
591 format (file
, ".%d", _subreg_nr
);
593 err
|= control (file
, "vert stride", vert_stride
, _vert_stride
, NULL
);
594 string (file
, ",1,1>");
595 err
|= control (file
, "src da16 reg type", reg_encoding
, _reg_type
, NULL
);
597 * Three kinds of swizzle display:
598 * identity - nothing printed
599 * 1->all - print the single channel
600 * 1->1 - print the mapping
602 if (swz_x
== BRW_CHANNEL_X
&&
603 swz_y
== BRW_CHANNEL_Y
&&
604 swz_z
== BRW_CHANNEL_Z
&&
605 swz_w
== BRW_CHANNEL_W
)
609 else if (swz_x
== swz_y
&& swz_x
== swz_z
&& swz_x
== swz_w
)
612 err
|= control (file
, "channel select", chan_sel
, swz_x
, NULL
);
617 err
|= control (file
, "channel select", chan_sel
, swz_x
, NULL
);
618 err
|= control (file
, "channel select", chan_sel
, swz_y
, NULL
);
619 err
|= control (file
, "channel select", chan_sel
, swz_z
, NULL
);
620 err
|= control (file
, "channel select", chan_sel
, swz_w
, NULL
);
626 static int imm (FILE *file
, GLuint type
, struct brw_instruction
*inst
) {
628 case BRW_REGISTER_TYPE_UD
:
629 format (file
, "0x%08xUD", inst
->bits3
.ud
);
631 case BRW_REGISTER_TYPE_D
:
632 format (file
, "%dD", inst
->bits3
.d
);
634 case BRW_REGISTER_TYPE_UW
:
635 format (file
, "0x%04xUW", (uint16_t) inst
->bits3
.ud
);
637 case BRW_REGISTER_TYPE_W
:
638 format (file
, "%dW", (int16_t) inst
->bits3
.d
);
640 case BRW_REGISTER_TYPE_UB
:
641 format (file
, "0x%02xUB", (int8_t) inst
->bits3
.ud
);
643 case BRW_REGISTER_TYPE_VF
:
644 format (file
, "Vector Float");
646 case BRW_REGISTER_TYPE_V
:
647 format (file
, "0x%08xV", inst
->bits3
.ud
);
649 case BRW_REGISTER_TYPE_F
:
650 format (file
, "%-gF", inst
->bits3
.f
);
655 static int src0 (FILE *file
, struct brw_instruction
*inst
)
657 if (inst
->bits1
.da1
.src0_reg_file
== BRW_IMMEDIATE_VALUE
)
658 return imm (file
, inst
->bits1
.da1
.src0_reg_type
,
660 else if (inst
->header
.access_mode
== BRW_ALIGN_1
)
662 if (inst
->bits2
.da1
.src0_address_mode
== BRW_ADDRESS_DIRECT
)
664 return src_da1 (file
,
665 inst
->bits1
.da1
.src0_reg_type
,
666 inst
->bits1
.da1
.src0_reg_file
,
667 inst
->bits2
.da1
.src0_vert_stride
,
668 inst
->bits2
.da1
.src0_width
,
669 inst
->bits2
.da1
.src0_horiz_stride
,
670 inst
->bits2
.da1
.src0_reg_nr
,
671 inst
->bits2
.da1
.src0_subreg_nr
,
672 inst
->bits2
.da1
.src0_abs
,
673 inst
->bits2
.da1
.src0_negate
);
677 return src_ia1 (file
,
678 inst
->bits1
.ia1
.src0_reg_type
,
679 inst
->bits1
.ia1
.src0_reg_file
,
680 inst
->bits2
.ia1
.src0_indirect_offset
,
681 inst
->bits2
.ia1
.src0_subreg_nr
,
682 inst
->bits2
.ia1
.src0_negate
,
683 inst
->bits2
.ia1
.src0_abs
,
684 inst
->bits2
.ia1
.src0_address_mode
,
685 inst
->bits2
.ia1
.src0_horiz_stride
,
686 inst
->bits2
.ia1
.src0_width
,
687 inst
->bits2
.ia1
.src0_vert_stride
);
692 if (inst
->bits2
.da16
.src0_address_mode
== BRW_ADDRESS_DIRECT
)
694 return src_da16 (file
,
695 inst
->bits1
.da16
.src0_reg_type
,
696 inst
->bits1
.da16
.src0_reg_file
,
697 inst
->bits2
.da16
.src0_vert_stride
,
698 inst
->bits2
.da16
.src0_reg_nr
,
699 inst
->bits2
.da16
.src0_subreg_nr
,
700 inst
->bits2
.da16
.src0_abs
,
701 inst
->bits2
.da16
.src0_negate
,
702 inst
->bits2
.da16
.src0_swz_x
,
703 inst
->bits2
.da16
.src0_swz_y
,
704 inst
->bits2
.da16
.src0_swz_z
,
705 inst
->bits2
.da16
.src0_swz_w
);
709 string (file
, "Indirect align16 address mode not supported");
715 static int src1 (FILE *file
, struct brw_instruction
*inst
)
717 if (inst
->bits1
.da1
.src1_reg_file
== BRW_IMMEDIATE_VALUE
)
718 return imm (file
, inst
->bits1
.da1
.src1_reg_type
,
720 else if (inst
->header
.access_mode
== BRW_ALIGN_1
)
722 if (inst
->bits3
.da1
.src1_address_mode
== BRW_ADDRESS_DIRECT
)
724 return src_da1 (file
,
725 inst
->bits1
.da1
.src1_reg_type
,
726 inst
->bits1
.da1
.src1_reg_file
,
727 inst
->bits3
.da1
.src1_vert_stride
,
728 inst
->bits3
.da1
.src1_width
,
729 inst
->bits3
.da1
.src1_horiz_stride
,
730 inst
->bits3
.da1
.src1_reg_nr
,
731 inst
->bits3
.da1
.src1_subreg_nr
,
732 inst
->bits3
.da1
.src1_abs
,
733 inst
->bits3
.da1
.src1_negate
);
737 return src_ia1 (file
,
738 inst
->bits1
.ia1
.src1_reg_type
,
739 inst
->bits1
.ia1
.src1_reg_file
,
740 inst
->bits3
.ia1
.src1_indirect_offset
,
741 inst
->bits3
.ia1
.src1_subreg_nr
,
742 inst
->bits3
.ia1
.src1_negate
,
743 inst
->bits3
.ia1
.src1_abs
,
744 inst
->bits3
.ia1
.src1_address_mode
,
745 inst
->bits3
.ia1
.src1_horiz_stride
,
746 inst
->bits3
.ia1
.src1_width
,
747 inst
->bits3
.ia1
.src1_vert_stride
);
752 if (inst
->bits3
.da16
.src1_address_mode
== BRW_ADDRESS_DIRECT
)
754 return src_da16 (file
,
755 inst
->bits1
.da16
.src1_reg_type
,
756 inst
->bits1
.da16
.src1_reg_file
,
757 inst
->bits3
.da16
.src1_vert_stride
,
758 inst
->bits3
.da16
.src1_reg_nr
,
759 inst
->bits3
.da16
.src1_subreg_nr
,
760 inst
->bits3
.da16
.src1_abs
,
761 inst
->bits3
.da16
.src1_negate
,
762 inst
->bits3
.da16
.src1_swz_x
,
763 inst
->bits3
.da16
.src1_swz_y
,
764 inst
->bits3
.da16
.src1_swz_z
,
765 inst
->bits3
.da16
.src1_swz_w
);
769 string (file
, "Indirect align16 address mode not supported");
775 int brw_disasm (FILE *file
, struct brw_instruction
*inst
)
780 if (inst
->header
.predicate_control
) {
782 err
|= control (file
, "predicate inverse", pred_inv
, inst
->header
.predicate_inverse
, NULL
);
784 if (inst
->bits2
.da1
.flag_reg_nr
)
785 format (file
, ".%d", inst
->bits2
.da1
.flag_reg_nr
);
786 if (inst
->header
.access_mode
== BRW_ALIGN_1
)
787 err
|= control (file
, "predicate control align1", pred_ctrl_align1
,
788 inst
->header
.predicate_control
, NULL
);
790 err
|= control (file
, "predicate control align16", pred_ctrl_align16
,
791 inst
->header
.predicate_control
, NULL
);
795 err
|= print_opcode (file
, inst
->header
.opcode
);
796 err
|= control (file
, "saturate", saturate
, inst
->header
.saturate
, NULL
);
797 err
|= control (file
, "debug control", debug_ctrl
, inst
->header
.debug_control
, NULL
);
799 if (inst
->header
.opcode
!= BRW_OPCODE_SEND
)
800 err
|= control (file
, "conditional modifier", conditional_modifier
,
801 inst
->header
.destreg__conditionalmod
, NULL
);
803 if (inst
->header
.opcode
!= BRW_OPCODE_NOP
) {
805 err
|= control (file
, "execution size", exec_size
, inst
->header
.execution_size
, NULL
);
809 if (inst
->header
.opcode
== BRW_OPCODE_SEND
)
810 format (file
, " %d", inst
->header
.destreg__conditionalmod
);
812 if (opcode
[inst
->header
.opcode
].ndst
> 0) {
814 err
|= dest (file
, inst
);
816 if (opcode
[inst
->header
.opcode
].nsrc
> 0) {
818 err
|= src0 (file
, inst
);
820 if (opcode
[inst
->header
.opcode
].nsrc
> 1) {
822 err
|= src1 (file
, inst
);
825 if (inst
->header
.opcode
== BRW_OPCODE_SEND
) {
829 err
|= control (file
, "target function", target_function
,
830 inst
->bits3
.generic
.msg_target
, &space
);
831 switch (inst
->bits3
.generic
.msg_target
) {
832 case BRW_MESSAGE_TARGET_MATH
:
833 err
|= control (file
, "math function", math_function
,
834 inst
->bits3
.math
.function
, &space
);
835 err
|= control (file
, "math saturate", math_saturate
,
836 inst
->bits3
.math
.saturate
, &space
);
837 err
|= control (file
, "math signed", math_signed
,
838 inst
->bits3
.math
.int_type
, &space
);
839 err
|= control (file
, "math scalar", math_scalar
,
840 inst
->bits3
.math
.data_type
, &space
);
841 err
|= control (file
, "math precision", math_precision
,
842 inst
->bits3
.math
.precision
, &space
);
844 case BRW_MESSAGE_TARGET_SAMPLER
:
845 format (file
, " (%d, %d, ",
846 inst
->bits3
.sampler
.binding_table_index
,
847 inst
->bits3
.sampler
.sampler
);
848 err
|= control (file
, "sampler target format", sampler_target_format
,
849 inst
->bits3
.sampler
.return_format
, NULL
);
852 case BRW_MESSAGE_TARGET_DATAPORT_WRITE
:
853 format (file
, " (%d, %d, %d, %d)",
854 inst
->bits3
.dp_write
.binding_table_index
,
855 (inst
->bits3
.dp_write
.pixel_scoreboard_clear
<< 3) |
856 inst
->bits3
.dp_write
.msg_control
,
857 inst
->bits3
.dp_write
.msg_type
,
858 inst
->bits3
.dp_write
.send_commit_msg
);
860 case BRW_MESSAGE_TARGET_URB
:
861 format (file
, " %d", inst
->bits3
.urb
.offset
);
863 err
|= control (file
, "urb swizzle", urb_swizzle
,
864 inst
->bits3
.urb
.swizzle_control
, &space
);
865 err
|= control (file
, "urb allocate", urb_allocate
,
866 inst
->bits3
.urb
.allocate
, &space
);
867 err
|= control (file
, "urb used", urb_used
,
868 inst
->bits3
.urb
.used
, &space
);
869 err
|= control (file
, "urb complete", urb_complete
,
870 inst
->bits3
.urb
.complete
, &space
);
872 case BRW_MESSAGE_TARGET_THREAD_SPAWNER
:
875 format (file
, "unsupported target %d", inst
->bits3
.generic
.msg_target
);
880 format (file
, "mlen %d",
881 inst
->bits3
.generic
.msg_length
);
882 format (file
, " rlen %d",
883 inst
->bits3
.generic
.response_length
);
886 if (inst
->header
.opcode
!= BRW_OPCODE_NOP
) {
889 err
|= control(file
, "access mode", access_mode
, inst
->header
.access_mode
, &space
);
890 err
|= control (file
, "mask control", mask_ctrl
, inst
->header
.mask_control
, &space
);
891 err
|= control (file
, "dependency control", dep_ctrl
, inst
->header
.dependency_control
, &space
);
892 err
|= control (file
, "compression control", compr_ctrl
, inst
->header
.compression_control
, &space
);
893 err
|= control (file
, "thread control", thread_ctrl
, inst
->header
.thread_control
, &space
);
894 if (inst
->header
.opcode
== BRW_OPCODE_SEND
)
895 err
|= control (file
, "end of thread", end_of_thread
,
896 inst
->bits3
.generic
.end_of_thread
, &space
);