diff --git a/.pick_status.json b/.pick_status.json index bee808c8ef7..574d91e176e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -584,7 +584,7 @@ "description": "vtn/opencl: flush denorms for cbrt()", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/spirv/vtn_opencl.c b/src/compiler/spirv/vtn_opencl.c index 043d61bb214..3f16685fb2e 100644 --- a/src/compiler/spirv/vtn_opencl.c +++ b/src/compiler/spirv/vtn_opencl.c @@ -725,6 +725,13 @@ handle_special(struct vtn_builder *b, uint32_t opcode, if (!ret) vtn_fail("No NIR equivalent"); + /* libclc's cbrt() implementation fails to flush subnormal numbers to zero + * even when flush-to-zero is required. Manually flush its output. + */ + if (opcode == OpenCLstd_Cbrt) { + ret = nir_fcanonicalize(nb, ret); + } + return ret; }