From 0978a6966abb886539158934d11ae7f170786be2 Mon Sep 17 00:00:00 2001 From: Tapani Pälli Date: Tue, 7 Jan 2014 10:25:40 +0200 Subject: i965/fs: do SEL optimization only when src type for MOV matches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp index d3147998028..db0be1911cc 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp @@ -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 -- cgit v1.2.3