i965/fs: implement d2i and d2u
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 18 Jan 2016 10:23:49 +0000 (11:23 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:08 +0000 (11:25 +0200)
These need the same treatment as d2f, so generalize our d2f lowering to cover
these too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 60bd943bfdb779c772290aa5862be57c4489e354..ed6df4a81031df14590f396c898da5dc7715437c 100644 (file)
@@ -36,7 +36,9 @@ fs_visitor::lower_d2f()
       if (inst->opcode != BRW_OPCODE_MOV)
          continue;
 
-      if (inst->dst.type != BRW_REGISTER_TYPE_F)
+      if (inst->dst.type != BRW_REGISTER_TYPE_F &&
+          inst->dst.type != BRW_REGISTER_TYPE_D &&
+          inst->dst.type != BRW_REGISTER_TYPE_UD)
          continue;
 
       if (inst->src[0].type != BRW_REGISTER_TYPE_DF)
index c456339f44e0ff9778448799916141c074452744..1d5909afce11c18e51f5ea0148f2d18d611c7974 100644 (file)
@@ -725,6 +725,8 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
 
    case nir_op_f2d:
    case nir_op_d2f:
+   case nir_op_d2i:
+   case nir_op_d2u:
       inst = bld.MOV(result, op[0]);
       inst->saturate = instr->dest.saturate;
       break;