summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_ir_vec4.h
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <[email protected]>2016-08-29 10:10:30 +0200
committerFrancisco Jerez <[email protected]>2017-04-14 14:56:08 -0700
commita21dc2b500cff6e0aaf31867c5b42651306ddaf1 (patch)
tree38ba3688df51336582c62cf7ad9470de7ec7eaf0 /src/intel/compiler/brw_ir_vec4.h
parenta5399e8b1cc3e2e12b8aa067e8380d1b088c35ca (diff)
i965/vec4: split DF instructions and later double its execsize in IVB/BYT
We need to split DF instructions in two on IVB/BYT as it needs an execsize 8 to process 4 DF values (one GRF in total). v2: - Rename helper and make it static inline function (Matt). - Fix indention and add braces (Matt). v3: - Don't edit IR instruction when doubling exec_size (Curro) - Add comment into the code (Curro). - Manage ARF registers like the others (Curro) v4: - Add get_exec_type() function and use it to calculate the execution size. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> [ Francisco Jerez: Fix bogus 'type != BAD_FILE' check. Take destination type as execution type where there is no valid source. Assert-fail if the deduced execution type is byte. Clarify comment in get_lowered_simd_width(). Move SIMD width workaround outside of 'if (...inst->size_written > REG_SIZE)' conditional block, since the problem should be independent of whether the amount of data written by the instruction is greater or lower than a GRF. Drop redundant is_ivb_df definition. Drop bogus inst->exec_size < 8 check. Simplify channel group assertion. ] Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_ir_vec4.h')
-rw-r--r--src/intel/compiler/brw_ir_vec4.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_ir_vec4.h b/src/intel/compiler/brw_ir_vec4.h
index bd026eb2aeb..56548c38830 100644
--- a/src/intel/compiler/brw_ir_vec4.h
+++ b/src/intel/compiler/brw_ir_vec4.h
@@ -404,6 +404,39 @@ regs_read(const vec4_instruction *inst, unsigned i)
reg_size);
}
+static inline enum brw_reg_type
+get_exec_type(const vec4_instruction *inst)
+{
+ enum brw_reg_type exec_type = BRW_REGISTER_TYPE_B;
+
+ for (int i = 0; i < 3; i++) {
+ if (inst->src[i].file != BAD_FILE) {
+ const brw_reg_type t = get_exec_type(brw_reg_type(inst->src[i].type));
+ if (type_sz(t) > type_sz(exec_type))
+ exec_type = t;
+ else if (type_sz(t) == type_sz(exec_type) &&
+ brw_reg_type_is_floating_point(t))
+ exec_type = t;
+ }
+ }
+
+ if (exec_type == BRW_REGISTER_TYPE_B)
+ exec_type = inst->dst.type;
+
+ /* TODO: We need to handle half-float conversions. */
+ assert(exec_type != BRW_REGISTER_TYPE_HF ||
+ inst->dst.type == BRW_REGISTER_TYPE_HF);
+ assert(exec_type != BRW_REGISTER_TYPE_B);
+
+ return exec_type;
+}
+
+static inline unsigned
+get_exec_type_size(const vec4_instruction *inst)
+{
+ return type_sz(get_exec_type(inst));
+}
+
} /* namespace brw */
#endif