i965/fs/nir: translate double pack/unpack
authorConnor Abbott <connor.w.abbott@intel.com>
Fri, 14 Aug 2015 19:29:31 +0000 (12:29 -0700)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:06 +0000 (11:25 +0200)
v2 (Sam):
- Fix line overflow (Topi).

v3: Use subscript() instead of stride() (Curro)

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

index 60335c377efccdb484d2e45ecf4f1844e6e770a9..5b5a7667bbb2f74cb9b3b180496951fb885f2251 100644 (file)
@@ -1098,6 +1098,18 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
       inst->saturate = instr->dest.saturate;
       break;
 
+   case nir_op_pack_double_2x32_split:
+      bld.emit(FS_OPCODE_PACK, result, op[0], op[1]);
+      break;
+
+   case nir_op_unpack_double_2x32_split_x:
+      bld.MOV(result, subscript(op[0], BRW_REGISTER_TYPE_UD, 0));
+      break;
+
+   case nir_op_unpack_double_2x32_split_y:
+      bld.MOV(result, subscript(op[0], BRW_REGISTER_TYPE_UD, 1));
+      break;
+
    case nir_op_fpow:
       inst = bld.emit(SHADER_OPCODE_POW, result, op[0], op[1]);
       inst->saturate = instr->dest.saturate;