On Sat, 2023-12-30 at 20:25 +0800, Xi Ruoyao wrote: > 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...
They are conforming (at least on LA464). I'll make a patch to add f{min/max} and reduc_f{min/max}_scal_* for LoongArch SIMD. -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University