case nir_op_fneg:
return agx_fmov_to(b, dst, agx_neg(s0));
- case nir_op_fmin:
- return agx_fcmpsel_to(b, dst, s0, s1, s0, s1, AGX_FCOND_LTN);
- case nir_op_fmax:
- return agx_fcmpsel_to(b, dst, s0, s1, s0, s1, AGX_FCOND_GTN);
+ case nir_op_fmin: {
+ agx_index tmp = agx_fcmpsel(b, s0, s1, s0, s1, AGX_FCOND_LTN);
+ /* flush denorms */
+ return agx_fadd_to(b, dst, tmp, agx_negzero());
+ }
+ case nir_op_fmax: {
+ agx_index tmp = agx_fcmpsel(b, s0, s1, s0, s1, AGX_FCOND_GTN);
+ /* flush denorms */
+ return agx_fadd_to(b, dst, tmp, agx_negzero());
+ }
case nir_op_imin:
return agx_icmpsel_to(b, dst, s0, s1, s0, s1, AGX_ICOND_SLT);
case nir_op_imax: