在 2023/12/30 下午8:25, Xi Ruoyao 写道:
On Sat, 2023-12-30 at 12:15 +0000, Richard Sandiford wrote:
This shouldn't be necessary. The test does:
for (int i = 0; i < n; i += 2)
{
x0 = __builtin_fmin (x0, ptr[i + 0]);
x1 = __builtin_fmin (x1, ptr[i + 1]);
}
res[0] = x0;
res[1] = x1;
__builtin_fmin is an FP minimum operation that corresponds directly to
the fmin*3 optab (or reduc_fmin_scal_* for reductions). It is naturally
associative, so doesn't need -ffast-math for that.
Does LoongArch provide reduc_min_scal_* but not reduc_fmin_scal_*?
If so, we probably need a new target selector for fmin/fmax reduction.
Let me try if the [x]vf{min,max} instructions are IEEE-conform. They've
still not released the volume 2 of the instruction manual so I can only
try...
These two instructions are in compliance with the ieee-754 standard.