From 4af791c3bd5636f8510b4f77c6d4b8182cf3501a Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 7 Jun 2020 09:52:11 +1000 Subject: [PATCH] nvir/nir: implement nir_op_extract_i16 v2: - use getSSA() instead of getScratch() v3: - fix whitespace Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index bbc3fb7fe91..2272746eeae 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -2834,6 +2834,14 @@ Converter::visit(nir_alu_instr *insn) mkOp3(OP_PERMT, TYPE_U32, newDefs[0], getSrc(&insn->src[0]), prmt, loadImm(NULL, 0)); break; } + case nir_op_extract_i16: { + DEFAULT_CHECKS; + LValues &newDefs = convert(&insn->dest); + Value *prmt = getSSA(); + mkOp3(OP_MAD, TYPE_U32, prmt, getSrc(&insn->src[1]), loadImm(NULL, 0x2222), loadImm(NULL, 0x9910)); + mkOp3(OP_PERMT, TYPE_U32, newDefs[0], getSrc(&insn->src[0]), prmt, loadImm(NULL, 0)); + break; + } // boolean conversions case nir_op_b2f32: { DEFAULT_CHECKS; -- 2.30.2