bgra8 wrote:
> > > @AaronBallman
> > > [N2848](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf)
> > > explicitly mentions that `NAN` and `INFINITY` macros should expand to a
> > > constant expression of type `float` not `double` like was implemented in
> > > this patch.
> > > `__bu
AaronBallman wrote:
> > @AaronBallman
> > [N2848](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf)
> > explicitly mentions that `NAN` and `INFINITY` macros should expand to a
> > constant expression of type `float` not `double` like was implemented in
> > this patch.
> > `__builtin
AaronBallman wrote:
> @AaronBallman
> [N2848](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf)
> explicitly mentions that `NAN` and `INFINITY` macros should expand to a
> constant expression of type `float` not `double` like was implemented in this
> patch.
>
> `__builtin_nanf` an
bgra8 wrote:
@AaronBallman
[N2848](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf) explicitly
mentions that `NAN` and `INFINITY` macros should expand to a constant
expression of type `float` not `double` like was implemented in this patch.
`__builtin_nanf` and `__builtin_inff` sh
https://github.com/AaronBallman closed
https://github.com/llvm/llvm-project/pull/96659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/96659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -47,6 +47,8 @@
(defined(__cplusplus) && __cplusplus >= 201103L) ||
\
(__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
#undef DECIMAL_DIG
+#undef INFINITY
AaronBallman wrote:
Good catch, I've corrected this.
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff de68294b4dd31370773cb7a976b2d59e0e8b9bcc
1ba1735702376bfb46b96d819ab141f1c841263a --
AaronBallman wrote:
> We already have `-Wnan-infinity-disabled`, which I think is sufficient on the
> warning side? Haven't checked carefully to see what cases it covers.
Not this one. :-D https://godbolt.org/z/hq8jvse9o But yeah, that may be a good
diagnostic to consider putting this under, b
https://github.com/efriedma-quic commented:
We already have `-Wnan-infinity-disabled`, which I think is sufficient on the
warning side? Haven't checked carefully to see what cases it covers.
https://github.com/llvm/llvm-project/pull/96659
___
cfe-com
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/96659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -47,6 +47,8 @@
(defined(__cplusplus) && __cplusplus >= 201103L) ||
\
(__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
#undef DECIMAL_DIG
+#undef INFINITY
efriedma-quic wrote:
The define guarding the undefs n
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/96659
>From b59c7f8c91d7c128975554d90bef3657ce3b2728 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Tue, 25 Jun 2024 10:52:56 -0400
Subject: [PATCH 1/3] [C23] Add INFINITY and NAN macros to
This is in suppor
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/96659
>From b59c7f8c91d7c128975554d90bef3657ce3b2728 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Tue, 25 Jun 2024 10:52:56 -0400
Subject: [PATCH 1/3] [C23] Add INFINITY and NAN macros to
This is in suppor
AaronBallman wrote:
> In short: IMHO, `INFINITY` should expand to something that bops the user
> (i.e., warn/error by default) and says "you're doing something wrong" in
> finite-math-only mode.
@jcranmer-intel and I had a really nice offline discussion on this topic and
I've come around to h
jcranmer-intel wrote:
Some thoughts of my own:
The decision being discussed here has two main repercussions:
* An attempt to use `INFINITY` gets a symbol-not-found error message, or it
gets whatever warning/error message we attach to `__builtin_inf()` in
`-ffinite-math-only` mode.
* Code that
AaronBallman wrote:
I was thinking about this more last night. The standard says:
> The macro
>`INFINITY`
> is defined if and only if the implementation supports an infinity for the
> type float. It expands to a
> constant expression of type float representing positive or unsigned infinity.
AaronBallman wrote:
> > I looked at my meeting notes for discussion of this paper and I think we do
> > need to worry about what the C standard says. From my notes: `The big
> > intent from this change seems to be about making INFINITY to be a feature
> > test macro.`, so if users are going to
jcranmer-intel wrote:
> I looked at my meeting notes for discussion of this paper and I think we do
> need to worry about what the C standard says. From my notes: `The big intent
> from this change seems to be about making INFINITY to be a feature test
> macro.`, so if users are going to porta
AaronBallman wrote:
> > and that implies (at least to me) that an expression cannot form an
> > infinity to begin with, so the act of trying to expand INFINITY is
> > nonsensical in that case, right?
>
> It's undefined behavior at runtime.
>
> I don't think we need to worry too much about wha
efriedma-quic wrote:
> and that implies (at least to me) that an expression cannot form an infinity
> to begin with, so the act of trying to expand INFINITY is nonsensical in that
> case, right?
It's undefined behavior at runtime.
I don't think we need to worry too much about what the C stand
AaronBallman wrote:
> I'm not sure about tying this to `__FINITE_MATH_ONLY__`; -ffinite-math-only
> doesn't mean infinity doesn't exist, it just means you're promising that you
> won't use floating-point arithmetic/comparison ops on infinity. Which is
> weird, but that's fast-math. Also, other
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/96659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic commented:
I'm not sure about tying this to __FINITE_MATH_ONLY__; -ffinite-math-only
doesn't mean infinity doesn't exist, it just means you're promising that you
won't use floating-point arithmetic/comparison ops on infinity. Which is
weird, but that's fast-ma
AaronBallman wrote:
Link to WG14 N2848: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf
https://github.com/llvm/llvm-project/pull/96659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Aaron Ballman (AaronBallman)
Changes
This is in support of WG14 N2848 which only define the macros if
infinity and nan are supported, so use of -ffinite-math will cause the
macros to not be defined.
---
Full diff: https://github.com/llvm/l
https://github.com/AaronBallman created
https://github.com/llvm/llvm-project/pull/96659
This is in support of WG14 N2848 which only define the macros if
infinity and nan are supported, so use of -ffinite-math will cause the
macros to not be defined.
>From b59c7f8c91d7c128975554d90bef3657ce3b272
27 matches
Mail list logo