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 <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
This commit is contained in:
M Henning
2023-07-20 22:54:52 -04:00
committed by Marge Bot
parent 6023943b81
commit d4086be6bc
+8
View File
@@ -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);