diff options
author | Matt Turner <mattst88@gmail.com> | 2019-04-18 14:29:03 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2019-04-18 15:41:01 -0700 |
commit | f28a187c7cd0e3f99f3e7ac6c0dce1b3ef5d172c (patch) | |
tree | f934e1ebf941d02fa47d3dac9b86f7a51e206e66 | |
parent | b72306d9c0ebc49ae073e08fc60ff5a4befc9775 (diff) |
intel/compiler: Improve fix_3src_operand()for-rafael
Allow ATTR and IMM sources unconditionally (ATTR are just GRFs, IMM will
be handled by opt_combine_constants(). Both are already allowed by
opt_copy_propagation().
Also allow FIXED_GRF if the regioning is 8,8,1. Could also allow other
stride=1 regions (e.g., 4,4,1) and scalar regions but I don't think
those occur. This is sufficient to allow a pass added in a future commit
(fs_visitor::lower_linterp) to avoid emitting extra MOV instructions.
I removed the 'src.stride > 1' case because it seems wrong: 3-src
instructions on Gen6-9 are align16-only and can only do stride=1 or
stride=0. A run through Jenkins with an assert(src.stride <= 1) never
triggers, so it seems that it was dead code.
-rw-r--r-- | src/intel/compiler/brw_fs_builder.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index 3fc6e5f2c25..a69e3c6ae80 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -733,13 +733,26 @@ namespace brw { src_reg fix_3src_operand(const src_reg &src) const { - if (src.file == VGRF || src.file == UNIFORM || src.stride > 1) { + switch (src.file) { + case FIXED_GRF: + /* FINISHME: Could handle scalar region, other stride=1 regions */ + if (src.vstride != BRW_VERTICAL_STRIDE_8 || + src.width != BRW_WIDTH_8 || + src.hstride != BRW_HORIZONTAL_STRIDE_1) + break; + /* fallthrough */ + case ATTR: + case VGRF: + case UNIFORM: + case IMM: return src; - } else { - dst_reg expanded = vgrf(src.type); - MOV(expanded, src); - return expanded; + default: + break; } + + dst_reg expanded = vgrf(src.type); + MOV(expanded, src); + return expanded; } /** |