i965/fs/nir: translate double pack/unpack

v2 (Sam):
- Fix line overflow (Topi).

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Connor Abbott 2015-08-14 12:29:31 -07:00 committed by Samuel Iglesias Gonsálvez
parent fd763177c1
commit 7782f39e75
1 changed files with 12 additions and 0 deletions

View 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;