From: M Henning Date: Fri, 21 Jul 2023 02:54:52 +0000 (-0400) Subject: nv/codegen: Implement nir_op_fquantize2f16 X-Git-Tag: upstream/23.3.3~4863 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4086be6bcd7624a4d2bafad065aa94e9c27486a;p=platform%2Fupstream%2Fmesa.git nv/codegen: Implement nir_op_fquantize2f16 Passes most of dEQP-VK.spirv_assembly.instruction.graphics.opquantize.* but not the too_small_* tests for some reason. (Tested on kepler.) Reviewed-by: Faith Ekstrand Reviewed-by: Karol Herbst Part-of: --- diff --git a/src/nouveau/codegen/nv50_ir_from_nir.cpp b/src/nouveau/codegen/nv50_ir_from_nir.cpp index e0eeaeb..b204189 100644 --- a/src/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/nouveau/codegen/nv50_ir_from_nir.cpp @@ -2838,6 +2838,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_fquantize2f16: { + DEFAULT_CHECKS; + LValues &newDefs = convert(&insn->dest); + Value *tmp = getSSA(); + mkCvt(OP_CVT, TYPE_F16, tmp, TYPE_F32, getSrc(&insn->src[0]))->ftz = 1; + mkCvt(OP_CVT, TYPE_F32, newDefs[0], TYPE_F16, tmp); + break; + } case nir_op_urol: { DEFAULT_CHECKS; LValues &newDefs = convert(&insn->dest);