mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 21:10:12 +01:00
r600/sb: Avoid causing an exception when getting the reciprocal of 0u.
I'm not sure what the hardware would return in this circumstance, so just don't fold it. Avoids regressions on transition to NIR. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14319>
This commit is contained in:
parent
25836895f3
commit
0879c15666
1 changed files with 7 additions and 2 deletions
|
|
@ -459,8 +459,13 @@ bool expr_handler::fold_alu_op1(alu_node& n) {
|
|||
case ALU_OP1_RECIP_FF:
|
||||
case ALU_OP1_RECIP_IEEE: dv = 1.0f / cv.f; break;
|
||||
// case ALU_OP1_RECIP_INT:
|
||||
case ALU_OP1_RECIP_UINT: dv.u = (1ull << 32) / cv.u; break;
|
||||
// case ALU_OP1_RNDNE: dv = floor(cv.f + 0.5f); break;
|
||||
case ALU_OP1_RECIP_UINT: {
|
||||
if (!cv.u)
|
||||
return false;
|
||||
dv.u = (1ull << 32) / cv.u;
|
||||
break;
|
||||
}
|
||||
// case ALU_OP1_RNDNE: dv = floor(cv.f + 0.5f); break;
|
||||
case ALU_OP1_SIN: dv = sin(cv.f * 2.0f * M_PI); break;
|
||||
case ALU_OP1_SQRT_IEEE: dv = sqrtf(cv.f); break;
|
||||
case ALU_OP1_TRUNC: dv = truncf(cv.f); break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue