mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
vtn/opencl: flush denorms for cbrt()
libclc doesn't so we have to. fixes math_brutefore cbrt on Iris.
Co-authored-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
(cherry picked from commit af954427bf)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39828>
This commit is contained in:
parent
890ff49038
commit
dc8a39037b
2 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue