aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_structs.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-01-31 16:55:20 -0800
committerEric Anholt <[email protected]>2012-09-17 12:32:52 -0700
commit077d01b673ec255005a1a847faf3be897517f4e7 (patch)
tree25d3b6bd37420374b4fccb8ce661026850cd7ed4 /src/mesa/drivers/dri/i965/brw_structs.h
parentf5e2706395904eb515a04c71966d7b96972f221a (diff)
i965: Add support for instruction compaction.
This reduces program size by using some smaller encodings for common bit patterns in the Gen ISA, with the hope of making programs fit in the instruction cache better. v2: Use larger bitshifts for the uncompressed field setups, in line with the way it's described in the spec. Consistently name a brw_compile "p" like all other code. Add a couple more tests. Consistently call things "compacted" not "compressed" (which is a different feature). Drop the explicit check for not compacting SENDs, which is unjustified and already implied by our lack of support for immediate values. Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_structs.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_structs.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h
index 465d2a28a8e..26def6e9054 100644
--- a/src/mesa/drivers/dri/i965/brw_structs.h
+++ b/src/mesa/drivers/dri/i965/brw_structs.h
@@ -1048,6 +1048,8 @@ struct brw_instruction
GLuint dest_subreg_nr:3;
GLuint dest_reg_nr:8;
} da3src;
+
+ uint32_t ud;
} bits1;
@@ -1137,6 +1139,8 @@ struct brw_instruction
GLuint src1_swizzle:8;
GLuint src1_subreg_nr_low:2;
} da3src;
+
+ uint32_t ud;
} bits2;
union
@@ -1534,5 +1538,27 @@ struct brw_instruction
} bits3;
};
+struct brw_compact_instruction {
+ struct {
+ unsigned opcode:7; /* 0- 6 */
+ unsigned debug_control:1; /* 7- 7 */
+ unsigned control_index:5; /* 8-12 */
+ unsigned data_type_index:5; /* 13-17 */
+ unsigned sub_reg_index:5; /* 18-22 */
+ unsigned acc_wr_control:1; /* 23-23 */
+ unsigned conditionalmod:4; /* 24-27 */
+ unsigned flag_reg_nr:1; /* 28-28 */
+ unsigned cmpt_ctrl:1; /* 29-29 */
+ unsigned src0_index:2; /* 30-31 */
+ } dw0;
+
+ struct {
+ unsigned src0_index:3; /* 32-24 */
+ unsigned src1_index:5; /* 35-39 */
+ unsigned dst_reg_nr:8; /* 40-47 */
+ unsigned src0_reg_nr:8; /* 48-55 */
+ unsigned src1_reg_nr:8; /* 56-63 */
+ } dw1;
+};
#endif