i965/vec4: implement d2i, d2u, i2d and u2d
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 17 Feb 2016 10:12:19 +0000 (11:12 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:50 +0000 (11:26 +0100)
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index e31c8c2772ed9653a7728b46416bdd617d97f071..778ebb55caaf31e3e5a7bcd18f90bd3c1ea68bcd 100644 (file)
@@ -1161,6 +1161,20 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
                                 BRW_REGISTER_TYPE_F);
       break;
 
+   case nir_op_d2i:
+   case nir_op_d2u:
+      emit_conversion_from_double(dst, op[0], instr->dest.saturate,
+                                  instr->op == nir_op_d2i ? BRW_REGISTER_TYPE_D :
+                                                            BRW_REGISTER_TYPE_UD);
+      break;
+
+   case nir_op_i2d:
+   case nir_op_u2d:
+      emit_conversion_to_double(dst, op[0], instr->dest.saturate,
+                                instr->op == nir_op_i2d ? BRW_REGISTER_TYPE_D :
+                                                          BRW_REGISTER_TYPE_UD);
+      break;
+
    case nir_op_iadd:
       assert(nir_dest_bit_size(instr->dest.dest) < 64);
    case nir_op_fadd: