i965/nir/vec4: Implement the addition operation
authorAntia Puentes <apuentes@igalia.com>
Tue, 16 Jun 2015 21:48:46 +0000 (23:48 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:48 +0000 (09:40 -0700)
Adds NIR ALU operations:
   * nir_op_fadd
   * nir_op_iadd

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index e1ada3bc8555a161adbe50d595056881c185ab01..db136c3e7abe9256749c6455a2e487fc662ca3c6 100644 (file)
@@ -693,6 +693,13 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       inst = emit(MOV(dst, op[0]));
       break;
 
+   case nir_op_fadd:
+      /* fall through */
+   case nir_op_iadd:
+      inst = emit(ADD(dst, op[0], op[1]));
+      inst->saturate = instr->dest.saturate;
+      break;
+
    default:
       unreachable("Unimplemented ALU operation");
    }