mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
i965/fs: Fix Sandybridge regressions from SEL optimization.
Sandybridge is the only platform that supports an IF instruction with an embedded comparison. In this case, we need to emit a CMP to go along with the SEL. Fixes regressions in Piglit's glsl-fs-atan-3, fs-unpackHalf2x16, fs-faceforward-float-float-float, isinf-and-isnan fs_basic, and isinf-and-isnan fs_fbo. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68086 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Tested-by: lu hua <huax.lu@intel.com>
This commit is contained in:
parent
c189840b21
commit
90129da82c
1 changed files with 13 additions and 4 deletions
|
|
@ -1911,10 +1911,19 @@ fs_visitor::try_replace_with_sel()
|
|||
emit(MOV(src0, then_mov->src[0]));
|
||||
}
|
||||
|
||||
fs_inst *sel = emit(BRW_OPCODE_SEL, then_mov->dst, src0, else_mov->src[0]);
|
||||
sel->predicate = if_inst->predicate;
|
||||
sel->predicate_inverse = if_inst->predicate_inverse;
|
||||
sel->conditional_mod = if_inst->conditional_mod;
|
||||
fs_inst *sel;
|
||||
if (if_inst->conditional_mod) {
|
||||
/* Sandybridge-specific IF with embedded comparison */
|
||||
emit(CMP(reg_null_d, if_inst->src[0], if_inst->src[1],
|
||||
if_inst->conditional_mod));
|
||||
sel = emit(BRW_OPCODE_SEL, then_mov->dst, src0, else_mov->src[0]);
|
||||
sel->predicate = BRW_PREDICATE_NORMAL;
|
||||
} else {
|
||||
/* Separate CMP and IF instructions */
|
||||
sel = emit(BRW_OPCODE_SEL, then_mov->dst, src0, else_mov->src[0]);
|
||||
sel->predicate = if_inst->predicate;
|
||||
sel->predicate_inverse = if_inst->predicate_inverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue