i965/nir/vec4: Implement "shift" operations
authorAntia Puentes <apuentes@igalia.com>
Wed, 17 Jun 2015 07:49:31 +0000 (09:49 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:49 +0000 (09:40 -0700)
Adds NIR ALU operations:
   * nir_op_ishl
   * nir_op_ishr
   * nir_op_ushr

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

index 560797068fbb1172cf92d135e8bef1dcf03c5f4e..b332fd315fb9b9ba5684690d5ef24319c85d384b 100644 (file)
@@ -1181,6 +1181,18 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       inst->predicate = BRW_PREDICATE_NORMAL;
       break;
 
+   case nir_op_ishl:
+      emit(SHL(dst, op[0], op[1]));
+      break;
+
+   case nir_op_ishr:
+      emit(ASR(dst, op[0], op[1]));
+      break;
+
+   case nir_op_ushr:
+      emit(SHR(dst, op[0], op[1]));
+      break;
+
    default:
       unreachable("Unimplemented ALU operation");
    }