From: Ben Skeggs Date: Sat, 6 Jun 2020 23:52:10 +0000 (+1000) Subject: nvir/nir: implement nir_op_extract_u16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bfdef484f54361e53c343fb8aee2d61a7f9cf025;p=mesa.git nvir/nir: implement nir_op_extract_u16 v2: - use getSSA() instead of getScratch() v3: - fix whitespace Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Part-of: --- 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 229f5666d29..bbc3fb7fe91 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -2826,6 +2826,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_u16: { + DEFAULT_CHECKS; + LValues &newDefs = convert(&insn->dest); + Value *prmt = getSSA(); + mkOp3(OP_MAD, TYPE_U32, prmt, getSrc(&insn->src[1]), loadImm(NULL, 0x22), loadImm(NULL, 0x4410)); + mkOp3(OP_PERMT, TYPE_U32, newDefs[0], getSrc(&insn->src[0]), prmt, loadImm(NULL, 0)); + break; + } // boolean conversions case nir_op_b2f32: { DEFAULT_CHECKS;