[llvm] [GlobalISel][AArch64][AMDGPU] Don't narrow saturating fp-to-int conversions (PR #215567)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 17 06:29:08 PDT 2026
================
@@ -575,7 +575,12 @@ Convert between integer and floating point.
G_FPTOSI_SAT, G_FPTOUI_SAT
^^^^^^^^^^^^^^^^^^^^^^^^^^
-Saturating convert between integer and floating point.
+Saturating convert between integer and floating point. Values outside the range
+of the result type saturate to its bounds, and NaN converts to zero.
+
+The saturation bounds are those of the result type, so these cannot be narrowed:
+converting at a narrower width saturates to the wrong bounds even when every
+finite value of the source fits in it.
----------------
jayfoad wrote:
Suggest removing this paragraph. We don't need ad hoc commentary here on what kind of transforms are or are not valid.
https://github.com/llvm/llvm-project/pull/215567
More information about the llvm-commits
mailing list