<div dir="ltr">On 22 August 2013 16:08, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 src/mesa/drivers/dri/i965/brw_fs.cpp                     | 1 +<br>
 src/mesa/drivers/dri/i965/brw_fs.h                       | 1 +<br>
 src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1 +<br>
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp             | 7 +++++++<br>
 4 files changed, 10 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
index 52fa6f4..b770c0e 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
@@ -179,6 +179,7 @@ ALU3(BFI2)<br>
 ALU1(FBH)<br>
 ALU1(FBL)<br>
 ALU1(CBIT)<br>
+ALU3(MAD)<br>
<br>
 /** Gen4 predicated IF. */<br>
 fs_inst *<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h<br>
index 9d240b5..cb4ac3b 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.h<br>
@@ -285,6 +285,7 @@ public:<br>
    fs_inst *FBH(fs_reg dst, fs_reg value);<br>
    fs_inst *FBL(fs_reg dst, fs_reg value);<br>
    fs_inst *CBIT(fs_reg dst, fs_reg value);<br>
+   fs_inst *MAD(fs_reg dst, fs_reg c, fs_reg b, fs_reg a);<br>
<br>
    int type_size(const struct glsl_type *type);<br>
    fs_inst *get_instruction_generating_reg(fs_inst *start,<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
index 4afae24..fa02d9b 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp<br>
@@ -360,6 +360,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)<br>
       assert(!"not yet supported");<br>
       break;<br>
<br>
+   case ir_triop_fma:<br>
    case ir_triop_lrp:<br>
    case ir_triop_bitfield_extract:<br>
       for (i = 0; i < vector_elements; i++) {<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 964ad40..ac85d25 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
@@ -717,6 +717,13 @@ fs_visitor::visit(ir_expression *ir)<br>
       break;<br>
    }<br>
<br>
+   case ir_triop_fma:<br>
+      /* Note that the instruction's argument order is reversed from GLSL<br>
+       * and the IR.<br>
+       */<br>
+      emit(MAD(this->result, op[2], op[1], op[0]));<br>
+      break;<br>
+<br></blockquote><div><br></div><div>What happens if one of the ops is in a form that we can't encode in a 3-op instruction (e.g. a constant)?  That's handled in patch 4/15 for the vs, and it's handled inside emit_lrp, but I don't see it handled here.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    case ir_triop_lrp:<br>
       emit_lrp(this->result, op[0], op[1], op[2]);<br>
       break;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.2<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><br></div></div>