Re: [PATCH v2] Skip constant folding for fmin/max when either argument is sNaN [PR105414]

2022-05-10 Thread Richard Biener via Gcc-patches
On Tue, May 10, 2022 at 10:10 AM HAO CHEN GUI wrote: > > Hi, >This patch skips constant folding for fmin/max when either argument > is sNaN. According to C standard, >fmin(sNaN, sNaN)= qNaN, fmin(sNaN, NaN) = qNaN >So signaling NaN should be tested and skipped for fmin/max in

[PATCH v2] Skip constant folding for fmin/max when either argument is sNaN [PR105414]

2022-05-10 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch skips constant folding for fmin/max when either argument is sNaN. According to C standard, fmin(sNaN, sNaN)= qNaN, fmin(sNaN, NaN) = qNaN So signaling NaN should be tested and skipped for fmin/max in match.pd. The V2 patch splits the for loop and keeps MIN/MAX_EXPR