[llvm] Hexagon: sfmax/sfmin instructions are IEEE754-2019 (PR #139056)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu May 8 10:48:08 PDT 2025
arsenm wrote:
> Can you help me understand the distinction between these?
Mostly signaling nan handling. The 2008 operation nonsensically behaves in a way opposite of how it does with a qnan input. We have this chart now https://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation
>
> Also: is it safe to remove `fm{ax,in}num`? Should this be an addition instead of a replacement? Or does one of these imply/satisfy the other?
All 3 pairs of intrinsics should be independently supported, and you can use one set to implement the others.
The ISA documentation for these operands is universally poor. The document I found for sfmin states:
"Minimum of two floating point values. If one value is a NaN, the other is chosen."
So if taken at face value, this is correct. The title and description should clarify which operation, as 2019 has both minimum and minimumNumber. This does explicitly not state if -0 is ordered as less than 0, but I'm assuming it is as that's the 2019 behavior for both operations, and also I haven't seen an example of an ISA that didn't have the correct behavior
https://github.com/llvm/llvm-project/pull/139056
More information about the llvm-commits
mailing list