-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Clarify semantics for overflowing constrained lrint etc. #148979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify semantics for overflowing constrained lrint etc. #148979
Conversation
This fixes llvm.experimental.constrained.lrint and friends to use the same semantics as llvm.lrint and friends, as defined in in ba5c26d.
@llvm/pr-subscribers-llvm-ir Author: Eli Friedman (efriedma-quic) ChangesThis fixes llvm.experimental.constrained.lrint and friends to use the same semantics as llvm.lrint and friends, as defined in in ba5c26d. Full diff: https://github.com/llvm/llvm-project/pull/148979.diff 1 Files Affected:
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index d2a1821efd698..168045010df7e 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -28302,9 +28302,9 @@ Overview:
The '``llvm.experimental.constrained.lrint``' intrinsic returns the first
argument rounded to the nearest integer. An inexact floating-point exception
-will be raised if the argument is not an integer. An invalid exception is
-raised if the result is too large to fit into a supported integer type,
-and in this case the result is undefined.
+will be raised if the argument is not an integer. If the rounded value is too
+large to fit into the result type, an invalid exception is raised, and the
+return value is a non-deterministic value (equivalent to `freeze poison`).
Arguments:
""""""""""
@@ -28350,9 +28350,9 @@ Overview:
The '``llvm.experimental.constrained.llrint``' intrinsic returns the first
argument rounded to the nearest integer. An inexact floating-point exception
-will be raised if the argument is not an integer. An invalid exception is
-raised if the result is too large to fit into a supported integer type,
-and in this case the result is undefined.
+will be raised if the argument is not an integer. If the rounded value is too
+large to fit into the result type, an invalid exception is raised, and the
+return value is a non-deterministic value (equivalent to `freeze poison`).
Arguments:
""""""""""
@@ -28701,8 +28701,9 @@ Overview:
The '``llvm.experimental.constrained.lround``' intrinsic returns the first
argument rounded to the nearest integer with ties away from zero. It will
raise an inexact floating-point exception if the argument is not an integer.
-An invalid exception is raised if the result is too large to fit into a
-supported integer type, and in this case the result is undefined.
+If the rounded value is too large to fit into the result type, an invalid
+exception is raised, and the return value is a non-deterministic value
+(equivalent to `freeze poison`).
Arguments:
""""""""""
@@ -28739,8 +28740,9 @@ Overview:
The '``llvm.experimental.constrained.llround``' intrinsic returns the first
argument rounded to the nearest integer with ties away from zero. It will
raise an inexact floating-point exception if the argument is not an integer.
-An invalid exception is raised if the result is too large to fit into a
-supported integer type, and in this case the result is undefined.
+If the rounded value is too large to fit into the result type, an invalid
+exception is raised, and the return value is a non-deterministic value
+(equivalent to `freeze poison`).
Arguments:
""""""""""
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/19064 Here is the relevant piece of the build log for the reference
|
This fixes llvm.experimental.constrained.lrint and friends to use the same semantics as llvm.lrint and friends, as defined in ba5c26d.