[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-16 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-16 Thread Serge Pavlov via cfe-commits
spavloff wrote: > The changes should come with a release note so that users know about the > behavioral change, but otherwise LGTM. Pragma FENV_ROUND is still officially unsupported, compiler issues a warning about this. It is https://github.com/llvm/llvm-project/pull/89617 that makes

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. The changes should come with a release note so that users know about the behavioral change, but otherwise LGTM. https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-15 Thread Serge Pavlov via cfe-commits
spavloff wrote: Are there any other comments? Can this PR be considered as approved? https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-10 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel commented: I'm generally happy with the testing and semantics at this point. https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-06 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: Explicit

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-06 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 01/10] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/8] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 Thread via cfe-commits
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 1aeb64c8ec7b96b2301929d8a325a6e1d9ddaa2f cf6ff55ad4a45875a821b3ac82c22bb7917b4d67 --

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 Thread via cfe-commits
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 1aeb64c8ec7b96b2301929d8a325a6e1d9ddaa2f aeb607513587924106081213335f73ba6eb0 --

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Joshua Cranmer via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD jcranmer-intel wrote: The

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Joshua Cranmer via cfe-commits
jcranmer-intel wrote: I've been doing some testing, and I do want to confirm my understanding of the C standard here. >From what I can tell, macro expansion (phase 4) happens before constants are >parsed (phase 7). As a result, if you have code like this: ```c #define CONSTANT 0.1f ``` the

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/7] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: >Does this test

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: > Does the

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: > In this snippet

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: In this snippet

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: Ah, I see that

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/5] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: I meant something

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/4] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/2] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: Also, test failures are related to this patch! https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
@@ -3858,7 +3858,8 @@ static Expr *BuildFloatingLiteral(Sema , NumericLiteralParser , using llvm::APFloat; APFloat Val(Format); - APFloat::opStatus result = Literal.GetFloatValue(Val); + APFloat::opStatus result = erichkeane wrote: Does this work

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: probably needs a release note https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Serge Pavlov (spavloff) Changes Conversion of floating-point literal to binary representation must be made using constant rounding mode, which can be changed using pragma FENV_ROUND. For example, the literal "0.1F" should be representes

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/90877 Conversion of floating-point literal to binary representation must be made using constant rounding mode, which can be changed using pragma FENV_ROUND. For example, the literal "0.1F" should be representes by