i965/fs: do SEL optimization only when src type for MOV matches

Fixes a bug where then branch operates with ivec4 while else uses vec4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72379

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Tapani Pälli 2014-01-07 10:25:40 +02:00
parent 847bc36a38
commit 0978a6966a
1 changed files with 6 additions and 0 deletions

View File

@ -169,6 +169,12 @@ fs_visitor::opt_peephole_sel()
break;
}
/* Check that source types for mov operations match. */
if (then_mov[i]->src[0].type != else_mov[i]->src[0].type) {
movs = i;
break;
}
if (!then_mov[i]->src[0].equals(else_mov[i]->src[0])) {
/* Only the last source register can be a constant, so if the MOV
* in the "then" clause uses a constant, we need to put it in a