<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 17, 2014 at 1:24 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Commit 0ae9ca12a8 put source modifiers out of the bitcast operations<br>
by adding a MOV operation that would handle them separately. It missed<br>
the case of ceil though, which negates both its source and destination<br>
operands.<br>
<br>
Fixes the following 42 dEQP tests:<br>
dEQP-GLES3.functional.shaders.builtin_functions.common.ceil.*_vertex<br>
dEQP-GLES3.functional.shaders.builtin_functions.common.ceil.*_fragment<br>
dEQP-GLES3.functional.shaders.builtin_functions.precision.ceil._*vertex.*<br>
dEQP-GLES3.functional.shaders.builtin_functions.precision.ceil._*fragment.*<br>
---<br>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 12 ++++++++----<br>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 12 ++++++++----<br>
2 files changed, 16 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
index b4f8f37..4526b75 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
@@ -889,10 +889,14 @@ fs_visitor::visit(ir_expression *ir)<br>
case ir_unop_trunc:<br>
emit(RNDZ(this->result, op[0]));<br>
break;<br>
- case ir_unop_ceil:<br>
- op[0].negate = !op[0].negate;<br>
- emit(RNDD(this->result, op[0]));<br>
- this->result.negate = true;<br>
+ case ir_unop_ceil: {<br>
+ fs_reg tmp = fs_reg(this, ir->type);<br>
+ op[0].negate = !op[0].negate;<br>
+ emit(MOV(tmp, op[0]));<br></blockquote><div><br></div><div>Do we really need this first mov? I don't think we do as we can just use a source modifier on RNDD. It won't affect the quality of the final code because copy propagation should clean it up, but more direct codegen is nicer.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ emit(RNDD(tmp, tmp));<br>
+ tmp.negate = true;<br>
+ emit(MOV(this->result, tmp));<br>
+ }<br>
break;<br>
case ir_unop_floor:<br>
emit(RNDD(this->result, op[0]));<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp<br>
index 73fff75..7c4a3e1 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp<br>
@@ -1649,10 +1649,14 @@ vec4_visitor::visit(ir_expression *ir)<br>
case ir_unop_trunc:<br>
emit(RNDZ(result_dst, op[0]));<br>
break;<br>
- case ir_unop_ceil:<br>
- op[0].negate = !op[0].negate;<br>
- inst = emit(RNDD(result_dst, op[0]));<br>
- this->result.negate = true;<br>
+ case ir_unop_ceil: {<br>
+ src_reg tmp = src_reg(this, ir->type);<br>
+ op[0].negate = !op[0].negate;<br>
+ emit(MOV(dst_reg(tmp), op[0]));<br>
+ emit(RNDD(dst_reg(tmp), tmp));<br>
+ tmp.negate = true;<br>
+ emit(MOV(result_dst, tmp));<br>
+ }<br>
break;<br>
case ir_unop_floor:<br>
inst = emit(RNDD(result_dst, op[0]));<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div></div></div>