spavloff wrote:
The discussion for the proposed mechanism is open here:
https://discourse.llvm.org/t/rfc-calling-functions-if-pragma-fenv-round-is-present/79372
> > This change introduces macro ROUNDING_MODE, which is a string dependent on
> > the constant rounding mode
>
> It expands to an id
https://github.com/spavloff updated
https://github.com/llvm/llvm-project/pull/92699
>From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001
From: Serge Pavlov
Date: Sun, 19 May 2024 18:43:08 +0700
Subject: [PATCH 1/4] [clang] Macro for constant rounding mode
MIME-Version: 1.0
Co
efriedma-quic wrote:
Oh, I somehow thought the macro was part of the spec; reading again, I guess it
isn't, it's just an attempt to implement the spec.
We probably want some feedback from libc implementers to check if this is what
they want. I don't really want to end up in a situation where
jcranmer-intel wrote:
Overall, I'm not opposed to this patch.
This new macro should probably be mentioned somewhere in the clang user
documentation.
> The way this requirement is formulated indicates that it could be implemented
> using preprocessor facility. Such implementation would require
spavloff wrote:
Thanks! I will commit it in a couple of day, if no additional feedback is
provided.
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
https://github.com/efriedma-quic approved this pull request.
LGTM, but maybe wait a few days to merge in case someone else has comments.
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
@@ -965,6 +965,16 @@ void Preprocessor::Lex(Token &Result) {
LastTokenWasAt = Result.is(tok::at);
--LexLevel;
+ if (Result.is(tok::l_brace)) {
+CurlyBraceLevel++;
+ } else if (Result.is(tok::r_brace)) {
+if (!RoundingPragmas.empty() &&
spavloff w
https://github.com/spavloff updated
https://github.com/llvm/llvm-project/pull/92699
>From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001
From: Serge Pavlov
Date: Sun, 19 May 2024 18:43:08 +0700
Subject: [PATCH 1/3] [clang] Macro for constant rounding mode
MIME-Version: 1.0
Co
@@ -965,6 +965,16 @@ void Preprocessor::Lex(Token &Result) {
LastTokenWasAt = Result.is(tok::at);
--LexLevel;
+ if (Result.is(tok::l_brace)) {
+CurlyBraceLevel++;
+ } else if (Result.is(tok::r_brace)) {
+if (!RoundingPragmas.empty() &&
efriedma-q
https://github.com/efriedma-quic commented:
This approach seems much better.
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
spavloff wrote:
Parsing pragma FENV_ROUND has been moved to the preprocessor.
https://github.com/llvm/llvm-project/pull/92699
https://github.com/spavloff updated
https://github.com/llvm/llvm-project/pull/92699
>From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001
From: Serge Pavlov
Date: Sun, 19 May 2024 18:43:08 +0700
Subject: [PATCH 1/2] [clang] Macro for constant rounding mode
MIME-Version: 1.0
Co
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
efriedma-quic wrote:
Is there some reason the preprocessor can't parse FENV_ROUND? Breaking code
with -save-temps etc. seems bad.
https://github.com
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Serge Pavlov (spavloff)
Changes
The forthcoming C standard defines pragma FENV_ROUND to support constant
rounding mode. It also requires some functions to be evaluated with such mode,
N3096 7.6.2p4 states:
Within the scope of an FENV
https://github.com/spavloff ready_for_review
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
spavloff wrote:
No, this macro is managed by the code in Sema, because pragma FENV_ROUND is
processed there. If only `-E` is specified, __ROUNDING_MOD
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
efriedma-quic wrote:
Since this is a preprocessor testcase, can you just use -E?
https://github.com/llvm/llvm-project/pull/92699
_
https://github.com/spavloff updated
https://github.com/llvm/llvm-project/pull/92699
>From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001
From: Serge Pavlov
Date: Sun, 19 May 2024 18:43:08 +0700
Subject: [PATCH] [clang] Macro for constant rounding mode
MIME-Version: 1.0
Conten
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 643f36184bd3d9a95cbfd608af6f169e0187
15b6edbcc8fe4559e9a9d8930f88dbbb6ed38b8c --
https://github.com/spavloff created
https://github.com/llvm/llvm-project/pull/92699
The forthcoming C standard defines pragma FENV_ROUND to support constant
rounding mode. It also requires some functions to be evaluated with such mode,
N3096 7.6.2p4 states:
Within the scope of an FENV_ROU
21 matches
Mail list logo