On Mon, 11 May 2020, Richard Sandiford wrote: > Like you say, the idea is that since the operation is commutative and > is the same in both vector and scalar form, there's no reason to require > any -ffast-math flags.
Note that PR88540 that Richard is referencing uses open-coded x < y ? x : y (non-commutative) and we want to use SSE minpd even without -ffast-math, as SSE min/max insns match semantics of open-coded ternary operators. (unlike Arm SIMD, SSE does not have a way to compute fmin/fmax with a single instruction in presence of NaNs) Alexander