[llvm] RISC-V: Support vectorizing FMINIMUMNUM and FMAXIMUMNUM (PR #135727)

YunQiang Su via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 15 20:12:20 PDT 2025


wzssyqa wrote:

> > > Tangent to your patch, this does prompt me to wonder if we should address the semantic difference between `ISD::FMIN/MAXNUM` and RISCV's FMIN/MAX in the presence of F extension 2.2
> > 
> > 
> > Sure. I am working on it. It needs some steps to do so.
> 
> I'm not sure what needs to be done. Can you clarify?

In the common SelectionDAG code, such as in `SelectionDAGCombine.cpp`,  FMAXNUM/FMINNUM is used to do some combination. We can replace them with FMAXIMUMNUM/FMINIMUMNUM first.

In expandFMINNUMFMAXNUM, we haven't support optimization with FMAXIMUMNUM/FMINIMUMNUM yet.
We need to determine SNaN first, while I have a try with IS_FPCLASS, while I get worse performance than libc calls.
Any idea about how to determine a SNaN?

https://github.com/llvm/llvm-project/pull/135727


More information about the llvm-commits mailing list