[llvm] [LangRef] Clarify specification for float min/max operations (PR #172012)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 21 17:44:46 PST 2025


phoebewang wrote:

> > I can revert that commit if the discussion reaches a different conclusion...
> 
> Okay, I did end up reverting this based on https://discourse.llvm.org/t/rfc-a-consistent-set-of-semantics-for-the-floating-point-minimum-and-maximum-operations/89006/69?u=nikic.

@nikic Can we revert it to the last commit? It looks to me the only motivation is to use signed zero minnum/maxnum for some optimizations. However, there are several problems/concerns need to be addressed regarding it:

- The choice between maxnum and maximumnum. Considering some language like Rust have deterministic sNaN requirement, a general optimizaiton should not break the sNaN determinism;
- The correctness. Considering the status of signed zero is widely not respected among backend and library implementations, we should raise red flags for such optimizaitons through the definition instead of a warning;
- The performance. @arsenm explain the reason of choosing maxnum is cost of quieting sNaN, which concerns me because signed zero also has cost on x86, which seems not take into account equally;

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


More information about the llvm-commits mailing list