summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2015-06-16 22:52:29 +0200
committerJason Ekstrand <[email protected]>2015-08-03 09:40:48 -0700
commit79154d99d6e760b1daf327b4594dded18f1d4191 (patch)
tree70cdb24e4ecb5c03164cb80c3b909ea5baee0cb3 /src
parent9e5d827f455f3c72af6cb8d60b97890bab8d5ad0 (diff)
i965/nir/vec4: Implement single-element "mov" operations
Adds NIR ALU operations: * nir_op_imov * nir_op_fmov Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_nir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 46bfd3b81d9..74efc576c56 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -655,6 +655,8 @@ brw_swizzle_for_nir_swizzle(uint8_t swizzle[4])
void
vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
{
+ vec4_instruction *inst;
+
dst_reg dst = get_nir_dest(instr->dest.dest,
nir_op_infos[instr->op].output_type);
dst.writemask = instr->dest.write_mask;
@@ -667,6 +669,17 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
op[i].abs = instr->src[i].abs;
op[i].negate = instr->src[i].negate;
}
+
+ switch (instr->op) {
+ case nir_op_imov:
+ case nir_op_fmov:
+ inst = emit(MOV(dst, op[0]));
+ inst->saturate = instr->dest.saturate;
+ break;
+
+ default:
+ unreachable("Unimplemented ALU operation");
+ }
}
void