aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2018-11-19 13:08:07 +0100
committerJuan A. Suarez Romero <[email protected]>2019-04-18 11:05:18 +0200
commitddd1706ab3710f25f51bbd6b14bb3af72ca046f6 (patch)
treebced0dd29f099e679e77296c863abc6caa872390 /src/intel/compiler
parent66002eeebe838ce491467e13d2b545dd3eff2e09 (diff)
intel/compiler: fix cmod propagation for non 32-bit types
v2: - Do not propagate if the bit-size changes Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_fs_cmod_propagation.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp
index a821d4e5481..a2c11e0959c 100644
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp
@@ -244,8 +244,7 @@ opt_cmod_propagation_local(const gen_device_info *devinfo,
/* CMP's result is the same regardless of dest type. */
if (inst->conditional_mod == BRW_CONDITIONAL_NZ &&
scan_inst->opcode == BRW_OPCODE_CMP &&
- (inst->dst.type == BRW_REGISTER_TYPE_D ||
- inst->dst.type == BRW_REGISTER_TYPE_UD)) {
+ brw_reg_type_is_integer(inst->dst.type)) {
inst->remove(block);
progress = true;
break;
@@ -266,6 +265,12 @@ opt_cmod_propagation_local(const gen_device_info *devinfo,
/* Comparisons operate differently for ints and floats */
if (scan_inst->dst.type != inst->dst.type) {
+ /* Comparison result may be altered if the bit-size changes
+ * since that affects range, denorms, etc
+ */
+ if (type_sz(scan_inst->dst.type) != type_sz(inst->dst.type))
+ break;
+
/* We should propagate from a MOV to another instruction in a
* sequence like:
*
@@ -279,8 +284,8 @@ opt_cmod_propagation_local(const gen_device_info *devinfo,
scan_inst->dst.type != BRW_REGISTER_TYPE_UD)) {
break;
}
- } else if (scan_inst->dst.type == BRW_REGISTER_TYPE_F ||
- inst->dst.type == BRW_REGISTER_TYPE_F) {
+ } else if (brw_reg_type_is_floating_point(scan_inst->dst.type) !=
+ brw_reg_type_is_floating_point(inst->dst.type)) {
break;
}
}