[Mesa-dev] [PATCH 3/6] i965/fs: Implement nir_opcode_fsub/isub support.
Kenneth Graunke
kenneth at whitecape.org
Mon Mar 23 17:37:57 PDT 2015
prog_to_nir uses this for OPCODE_SUB.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 69f296c..094303f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -905,6 +905,12 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
inst->saturate = instr->dest.saturate;
break;
+ case nir_op_fsub:
+ case nir_op_isub:
+ inst = emit(ADD(result, op[0], negate(op[1])));
+ inst->saturate = instr->dest.saturate;
+ break;
+
case nir_op_fmul:
inst = emit(MUL(result, op[0], op[1]));
inst->saturate = instr->dest.saturate;
--
2.3.3
More information about the mesa-dev
mailing list