[Mesa-dev] [PATCH 41/78] i965/nir/vec4: Implement non-equality ops on vectors

Eduardo Lima Mitev elima at igalia.com
Fri Jun 26 01:06:57 PDT 2015


From: Antia Puentes <apuentes at igalia.com>

Adds NIR ALU operations:
   * nir_op_bany_fnequal2
   * nir_op_bany_inequal2
   * nir_op_bany_fnequal3
   * nir_op_bany_inequal3
   * nir_op_bany_fnequal4
   * nir_op_bany_inequal4

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index f8f989f..def6175 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1008,6 +1008,22 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       inst->predicate = BRW_PREDICATE_ALIGN16_ALL4H;
       break;
 
+   case nir_op_bany_fnequal2:
+   case nir_op_bany_inequal2:
+   case nir_op_bany_fnequal3:
+   case nir_op_bany_inequal3:
+   case nir_op_bany_fnequal4:
+   case nir_op_bany_inequal4:
+      emit(CMP(dst_null_d(),
+               fix_swizzle_for_input_fixed_size(instr->op, op[0]),
+               fix_swizzle_for_input_fixed_size(instr->op, op[1]),
+               brw_conditional_for_nir_comparison(instr->op)));
+
+      emit(MOV(dst, src_reg(0)));
+      inst = emit(MOV(dst, src_reg(~0)));
+      inst->predicate = BRW_PREDICATE_ALIGN16_ANY4H;
+      break;
+
    default:
       unreachable("Unimplemented ALU operation");
    }
-- 
2.1.4



More information about the mesa-dev mailing list