nir: drop NaN fixup for atan
this existed due to the min/max, per the comment. now that we don't do min/max, the whole routine is NaN correct so the fixup is pointless. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Suggested-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30934>
This commit is contained in:
committed by
Marge Bot
parent
ab8547a002
commit
7546ae96a7
@@ -208,28 +208,7 @@ nir_atan(nir_builder *b, nir_def *y_over_x)
|
||||
nir_def *tmp = nir_ffma(b, nir_fabs(b, u), res, bias);
|
||||
|
||||
/* sign fixup */
|
||||
nir_def *result = nir_copysign(b, tmp, y_over_x);
|
||||
|
||||
/* The fmin and fmax above will filter out NaN values. This leads to
|
||||
* non-NaN results for NaN inputs. Work around this by doing
|
||||
*
|
||||
* !isnan(y_over_x) ? ... : y_over_x;
|
||||
*/
|
||||
if (b->exact ||
|
||||
nir_is_float_control_signed_zero_inf_nan_preserve(b->fp_fast_math, bit_size)) {
|
||||
const bool exact = b->exact;
|
||||
|
||||
b->exact = true;
|
||||
nir_def *is_not_nan = nir_feq(b, y_over_x, y_over_x);
|
||||
b->exact = exact;
|
||||
|
||||
/* The extra 1.0*y_over_x ensures that subnormal results are flushed to
|
||||
* zero.
|
||||
*/
|
||||
result = nir_bcsel(b, is_not_nan, result, nir_fmul_imm(b, y_over_x, 1.0));
|
||||
}
|
||||
|
||||
return result;
|
||||
return nir_copysign(b, tmp, y_over_x);
|
||||
}
|
||||
|
||||
nir_def *
|
||||
|
||||
Reference in New Issue
Block a user