Skip to content

Commit 8ec03f4

Browse files
Clarify semantics for overflowing constrained lrint etc. (#148979)
This fixes llvm.experimental.constrained.lrint and friends to use the same semantics as llvm.lrint and friends, as defined in ba5c26d.
1 parent fa88c18 commit 8ec03f4

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

llvm/docs/LangRef.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28302,9 +28302,9 @@ Overview:
2830228302

2830328303
The '``llvm.experimental.constrained.lrint``' intrinsic returns the first
2830428304
argument rounded to the nearest integer. An inexact floating-point exception
28305-
will be raised if the argument is not an integer. An invalid exception is
28306-
raised if the result is too large to fit into a supported integer type,
28307-
and in this case the result is undefined.
28305+
will be raised if the argument is not an integer. If the rounded value is too
28306+
large to fit into the result type, an invalid exception is raised, and the
28307+
return value is a non-deterministic value (equivalent to `freeze poison`).
2830828308

2830928309
Arguments:
2831028310
""""""""""
@@ -28350,9 +28350,9 @@ Overview:
2835028350

2835128351
The '``llvm.experimental.constrained.llrint``' intrinsic returns the first
2835228352
argument rounded to the nearest integer. An inexact floating-point exception
28353-
will be raised if the argument is not an integer. An invalid exception is
28354-
raised if the result is too large to fit into a supported integer type,
28355-
and in this case the result is undefined.
28353+
will be raised if the argument is not an integer. If the rounded value is too
28354+
large to fit into the result type, an invalid exception is raised, and the
28355+
return value is a non-deterministic value (equivalent to `freeze poison`).
2835628356

2835728357
Arguments:
2835828358
""""""""""
@@ -28701,8 +28701,9 @@ Overview:
2870128701
The '``llvm.experimental.constrained.lround``' intrinsic returns the first
2870228702
argument rounded to the nearest integer with ties away from zero. It will
2870328703
raise an inexact floating-point exception if the argument is not an integer.
28704-
An invalid exception is raised if the result is too large to fit into a
28705-
supported integer type, and in this case the result is undefined.
28704+
If the rounded value is too large to fit into the result type, an invalid
28705+
exception is raised, and the return value is a non-deterministic value
28706+
(equivalent to `freeze poison`).
2870628707

2870728708
Arguments:
2870828709
""""""""""
@@ -28739,8 +28740,9 @@ Overview:
2873928740
The '``llvm.experimental.constrained.llround``' intrinsic returns the first
2874028741
argument rounded to the nearest integer with ties away from zero. It will
2874128742
raise an inexact floating-point exception if the argument is not an integer.
28742-
An invalid exception is raised if the result is too large to fit into a
28743-
supported integer type, and in this case the result is undefined.
28743+
If the rounded value is too large to fit into the result type, an invalid
28744+
exception is raised, and the return value is a non-deterministic value
28745+
(equivalent to `freeze poison`).
2874428746

2874528747
Arguments:
2874628748
""""""""""

0 commit comments

Comments
 (0)