[llvm] Correct documentation for `roundeven` (PR #125452)
Trevor Gross via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 2 19:11:08 PST 2025
https://github.com/tgross35 created https://github.com/llvm/llvm-project/pull/125452
Langref for `roundeven` implies that the C standard function `roundeven` may raise floating point exceptions. However, this is not correct; C23 does not mention exceptions for `roundeven`, and per [1] `FE_INEXACT` is never raised.
Clarify that LLVM's `roundeven` behaves the same.
[1]: https://en.cppreference.com/w/c/numeric/math/roundeven
>From 58e9712566ce454d016ac633719c076350997caa Mon Sep 17 00:00:00 2001
From: Trevor Gross <tmgross at umich.edu>
Date: Mon, 3 Feb 2025 03:07:33 +0000
Subject: [PATCH] Correct documentation for `roundeven`
Langref for `roundeven` implies that the C standard function `roundeven`
may raise floating point exceptions. However, this is not correct; C23
does not mention exceptions for `roundeven`, and per [1] `FE_INEXACT` is
never raised.
Clarify that LLVM's `roundeven` behaves the same.
[1]: https://en.cppreference.com/w/c/numeric/math/roundeven
---
llvm/docs/LangRef.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 8891aedcb58e55..bd9c522987834f 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -17255,8 +17255,8 @@ Semantics:
""""""""""
This function implements IEEE-754 operation ``roundToIntegralTiesToEven``. It
-also behaves in the same way as C standard function ``roundeven``, except that
-it does not raise floating point exceptions.
+also behaves in the same way as C standard function ``roundeven``, including
+that it disregards rounding mode and does not raise floating point exceptions.
'``llvm.lround.*``' Intrinsic
More information about the llvm-commits
mailing list