mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
vtn/opencl: flush denorms for cbrt()
libclc doesn't so we have to. fixes math_brutefore cbrt on Iris.
This uses an exact fmul 1.0 instead of fcanonlize, because the latter got
added with 26.0.
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/39969>
This commit is contained in:
parent
6d1c919fc4
commit
6971c8e2eb
1 changed files with 10 additions and 0 deletions
|
|
@ -725,6 +725,16 @@ 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) {
|
||||
const bool save_exact = nb->exact;
|
||||
nb->exact = true;
|
||||
ret = nir_fmul_imm(nb, ret, 1.0);
|
||||
nb->exact = save_exact;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue