Skip to content
Snippets Groups Projects
Commit a05af1f7 authored by Matt Turner's avatar Matt Turner
Browse files

i965/fs: Handle negating immediates on MADs when propagating saturates

MADs don't take immediate sources, but we allow them in the IR since it
simplifies a lot of things. I neglected to consider that case.

Fixes: 4009a9ea ("i965/fs: Allow saturate propagation to propagate
                      negations into MADs.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103616


Reported-and-Tested-by: default avatarRuslan Kabatsayev <b7.10110111@gmail.com>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
parent ce221cbb
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,14 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
scan_inst->src[0].negate = !scan_inst->src[0].negate;
inst->src[0].negate = false;
} else if (scan_inst->opcode == BRW_OPCODE_MAD) {
scan_inst->src[0].negate = !scan_inst->src[0].negate;
scan_inst->src[1].negate = !scan_inst->src[1].negate;
for (int i = 0; i < 2; i++) {
if (scan_inst->src[i].file == IMM) {
brw_negate_immediate(scan_inst->src[i].type,
&scan_inst->src[i].as_brw_reg());
} else {
scan_inst->src[i].negate = !scan_inst->src[i].negate;
}
}
inst->src[0].negate = false;
} else if (scan_inst->opcode == BRW_OPCODE_ADD) {
if (scan_inst->src[1].file == IMM) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment