[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 1/9] Adding C23 constexpr math functions fmin and frexp. -

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,52 @@ +// RUN: %clang_cc1 -DWIN -verify -std=c++23 -fsyntax-only %s +// RUN: %clang_cc1 -verify -std=c++23 -fsyntax-only %s zahiraam wrote: Done. https://github.com/llvm/llvm-project/pull/88978 ___ cfe-com

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -14683,6 +14710,23 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexp: zahiraam wrote: Added the non-`__builtin_ prefixed cases. https://github.com/llvm/llvm-project/pull/88978 _

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -3452,9 +3452,10 @@ def Fmod : FPMathTemplate, LibBuiltin<"math.h"> { def Frexp : FPMathTemplate, LibBuiltin<"math.h"> { let Spellings = ["frexp"]; - let Attributes = [NoThrow]; + let Attributes = [NoThrow, Constexpr]; zahiraam wrote: Done. https://gi

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/10] Adding C23 constexpr math functions fmin and frexp.

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -6,17 +6,21 @@ // RUN: %clang_cc1 -triple powerpc-ibm-aix -mlong-double-64 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK %s // RUN: %clang_cc1 -triple powerpc64-ibm-aix -mlong-double-64 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK %s +long double input = 0.0L;

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-11 Thread Zahira Ammarguellat via cfe-commits
@@ -14674,6 +14676,31 @@ static bool TryEvaluateBuiltinNaN(const ASTContext &Context, return true; } +// Checks that the value x is in the range (-1;-0.5], [0.5; 1) +static bool isInFrexpResultRange(const llvm::APFloat &x) { + llvm::APFloat minusOne(x.getSemantics(), "-1.

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-13 Thread Zahira Ammarguellat via cfe-commits
@@ -14683,6 +14710,23 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexp: + case Builtin::BI__builtin_frexpf: + case Builtin::BI__builtin_frexpl: { zahiraam wrote: You mean adding

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-13 Thread Zahira Ammarguellat via cfe-commits
@@ -3452,9 +3452,10 @@ def Fmod : FPMathTemplate, LibBuiltin<"math.h"> { def Frexp : FPMathTemplate, LibBuiltin<"math.h"> { zahiraam wrote: I have added `UnprefixedOnlyConstexprSince` to the class `LIBBUILTIN` so it will be unknow if I add it to this def. I w

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-06-13 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: All the LIT tests failing are due to the latest changes I made. I will edit them once I know that the latest implementation is correct. https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] Adding C23 constexpr math functions fmin and frexp. (PR #88978)

2024-04-16 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/88978 None >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH] Adding C23 constexpr math functions fmin and frexp.

[clang] [C23] [CALNG] Adding C23 constexpr math functions fmin and frexp. (PR #88978)

2024-04-16 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] [CLANG] Adding C23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-18 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-18 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s + +// RUN %clang_cc1 -x c++ -triple x86_64-linux-gnu -emit-llvm -o - %s \ +// RUN -std=c++23 + +#define INFINITY ((float)(1e+300 * 1e+300)) +#define N

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-18 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 1/2] Adding C23 constexpr math functions fmin and frexp. -

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-22 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix -fno-unsafe-math-optimizations behavior (PR #89473)

2024-04-22 Thread Zahira Ammarguellat via cfe-commits
@@ -318,12 +320,12 @@ // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ // RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-NO-REASSOC-NO-UNSAFE-MATH %s +// RUN: | FileCheck --check-prefix=CHECK-N

[clang] Fix -fno-unsafe-math-optimizations behavior (PR #89473)

2024-04-22 Thread Zahira Ammarguellat via cfe-commits
@@ -271,30 +271,32 @@ // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s // RUN: %clang -### -funsafe-math-optimizations -fno-reciprocal-math -c %s \ -// RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: 2>&1 | FileCheck --check-prefix=CH

[clang] fast math test overhaul (PR #89687)

2024-04-23 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/89687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Clean up fp-contract handling in clang driver (PR #99723)

2024-07-23 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/99723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-23 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/97342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-23 Thread Zahira Ammarguellat via cfe-commits
@@ -816,6 +816,11 @@ class FPOptions { setAllowFPReassociate(LO.AllowFPReassoc); setNoHonorNaNs(LO.NoHonorNaNs); setNoHonorInfs(LO.NoHonorInfs); +// Ensure that if FiniteMathOnly is enabled, NoHonorNaNs and NoHonorInfs are +// also enabled. This is because

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/14] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
@@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s -check-prefix=NORMAL // RUN: %clang_cc1 %s -emit-llvm -cl-fast-relaxed-math -o - | FileCheck %s -check-prefix=FAST -// RUN: %clang_cc1 %s -emit-llvm -cl-finite-math-only -o - | FileCheck %s -check-prefix=FINI

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/15] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/16] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] [CLANG] Emit warning in finite math mode when INF and NAN are used. (PR #99672)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/99672 >From 452bc424b7e6d63c50af1ed8f3623ad84e9b091c Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 19 Jul 2024 10:31:18 -0700 Subject: [PATCH 1/4] Fix issue https://github.com/llvm/llvm-project/issues

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
@@ -102,6 +102,17 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The ``-ffp-model`` option has been updated to enable a more limited set of + optimizations when the ``fast`` argument is used and to accept a new argument, + ``aggressive``. Th

[clang] [CLANG] Emit warning in finite math mode when INF and NAN are used. (PR #99672)

2024-07-25 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-25 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: @hubert-reinterpretcast Would really appreciate a review of this please. Thanks. https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/97342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/11] Adding C23 constexpr math functions fmin and frexp.

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/11] Adding C23 constexpr math functions fmin and frexp.

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/12] Adding C23 constexpr math functions fmin and frexp.

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/13] Adding C23 constexpr math functions fmin and frexp.

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-29 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/88978 >From 3acc848f4fcc68445dfc849f9c6f8d384d3692af Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 16 Apr 2024 13:09:58 -0700 Subject: [PATCH 01/14] Adding C23 constexpr math functions fmin and frexp.

[clang] [TBAA] Emit int TBAA metadata on FP math libcall expf (PR #96025)

2024-07-16 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,43 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// The test may fail as time out on windows +// REQUIRES: system-linux + +// RUN: %clang -S -O3 -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefixes=CHECK,

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-16 Thread Zahira Ammarguellat via cfe-commits
@@ -344,10 +352,17 @@ class ComplexExprEmitter return QualType(); } + template + FPOptionsOverride getStoredFPFeaturesOrDefault(const T *E, + const CodeGenFunction &CGF) { zahiraam wrote: `Expr` doesn't

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-16 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-16 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/98520 >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH 1/7] The pragma STDC CX_LIMITED_RANGE ON should have prece

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-16 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/98520 >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH 1/8] The pragma STDC CX_LIMITED_RANGE ON should have prece

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-17 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: Thanks @AaronBallman. I got thumbs up from @andykaylor offline. Merging this PR. https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/12] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-17 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/13] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-19 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/99672 None >From 452bc424b7e6d63c50af1ed8f3623ad84e9b091c Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 19 Jul 2024 10:31:18 -0700 Subject: [PATCH] Fix issue https://github.com/llvm/llvm-project/issue

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-19 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Clean up fp-contract handling in clang driver (PR #99723)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > This is a refreshed version of #91271. Given how long it's been since I > updated that PR, it seemed better to just start fresh. May be #91271 should be closed then, In `Driver/fp-contract.c`, all the `//RUN` lines where you removed the `-Werror` should now have `//WARN` chec

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/14] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 01/13] [NFC] Add assertion to ensure that FiniteMathOnly to

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/99672 >From 452bc424b7e6d63c50af1ed8f3623ad84e9b091c Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 19 Jul 2024 10:31:18 -0700 Subject: [PATCH 1/2] Fix issue https://github.com/llvm/llvm-project/issues

[clang] [CLANG] Emit warning in finite math mode when INF and NAN are used. (PR #99672)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] Emit warning in finite math mode when INF and NAN are used. (PR #99672)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] Emit warning in finite math mode when INF and NAN are used. (PR #99672)

2024-07-22 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/99672 >From 452bc424b7e6d63c50af1ed8f3623ad84e9b091c Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 19 Jul 2024 10:31:18 -0700 Subject: [PATCH 1/3] Fix issue https://github.com/llvm/llvm-project/issues

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-23 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-23 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-24 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-24 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: How about adding `pragma STDC FENV_ROUND` at file scope and some C++ tests (with default argument in functions). https://github.com/llvm/llvm-project/pull/89617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-24 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,160 @@ +// RUN: %clang_cc1 -S -triple x86_64-linux-gnu -emit-llvm %s -o - | \ +// RUN: FileCheck %s --implicit-check-not "call void @llvm.set.rounding" --implicit-check-not "call i32 @llvm.get.rounding" + +float func_rz_ru(float w, float x, float y, float z) { + #pr

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-24 Thread Zahira Ammarguellat via cfe-commits
@@ -1257,9 +1257,6 @@ def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, // The C standard 7.6.1p2 says "The [FENV_ACCESS] pragma shall occur either zahiraam wrote: This comment can be removed I think. https://github.com/llvm/llvm-proje

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-24 Thread Zahira Ammarguellat via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] Clean up denormal handling with -ffp-model, -ffast-math, etc. (PR #89477)

2024-04-26 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: LGTM. May be no need for the "etc" in the title of the patch? Thanks. https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -DWIN -verify -std=c++23 -fsyntax-only %s +// RUN: %clang_cc1 -verify -std=c++23 -fsyntax-only %s + +// expected-no-diagnostics + + +#ifdef WIN +#define INFINITY ((float)(1e+300 * 1e+300)) +#define NAN (-(float)(INFINITY * 0.0F)) +#else

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/88978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ zahiraam wrote: There is no need to use -O3 here to prove what you want, I

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ +// RUN: | FileCheck -check-prefix=CHECK %s + zahiraam wrote: How about ad

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-29 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ +// RUN: | FileCheck -check-prefix=CHECK %s + +// Reproducer for issue #87758 +// The testca

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-30 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ +// RUN: | FileCheck -check-prefix=CHECK %s + +// Reproducer for issue #87758 +// The testca

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-30 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ zahiraam wrote: You don't need to put every // CHECK line. Since we are in

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-30 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam deleted https://github.com/llvm/llvm-project/pull/90377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-04-30 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,28 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O3 -emit-llvm -o - %s \ +// RUN: | FileCheck -check-prefix=CHECK %s + +// Reproducer for issue #87758 +// The testca

[clang] Add __builtin_fma16. (PR #97424)

2024-07-09 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/97424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Add assertion to ensure FiniteMathOnly is in sync with HonorINFs and HonorNANs. (PR #97342)

2024-07-09 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 1/3] [NFC] Add assertion to ensure that FiniteMathOnly toggl

[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-07-10 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > > All the LIT tests failing are due to the latest changes I made. I will edit > > them once I know that the latest implementation is correct. > > Thanks. I may be delayed in reviewing this as the C++ committee meeting is > the week after next. Ping @hubert-reinterpretcast

[clang] [NFC] Add assertion to ensure FiniteMathOnly is in sync with HonorINFs and HonorNANs. (PR #97342)

2024-07-10 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/97342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Add assertion to ensure FiniteMathOnly is in sync with HonorINFs and HonorNANs. (PR #97342)

2024-07-10 Thread Zahira Ammarguellat via cfe-commits
@@ -816,6 +816,11 @@ class FPOptions { setAllowFPReassociate(LO.AllowFPReassoc); setNoHonorNaNs(LO.NoHonorNaNs); setNoHonorInfs(LO.NoHonorInfs); +// Ensure that if FiniteMathOnly is enabled, NoHonorNaNs and NoHonorInfs are +// also enabled. This is because

[clang] Add __builtin_fma16. (PR #97424)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: @AaronBallman ping? https://github.com/llvm/llvm-project/pull/97424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/97342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence over (PR #98520)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/98520 command line -fcomplex-arithmetic. >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH] The pragma STDC CX_LIM

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence over (PR #98520)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence over (PR #98520)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/98520 >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH 1/2] The pragma STDC CX_LIMITED_RANGE ON should have prece

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add __builtin_fma16. (PR #97424)

2024-07-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97424 >From 417d72fdd88fddbd843ff3c19681a07e680852c7 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 2 Jul 2024 07:41:42 -0700 Subject: [PATCH 1/2] Add __builtin_fma16. --- clang/include/clang/Basic/Bu

[clang] Add __builtin_fmaf16. (PR #97424)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/97424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add __builtin_fmaf16. (PR #97424)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97424 >From 417d72fdd88fddbd843ff3c19681a07e680852c7 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 2 Jul 2024 07:41:42 -0700 Subject: [PATCH 1/3] Add __builtin_fma16. --- clang/include/clang/Basic/Bu

[clang] Add __builtin_fmaf16. (PR #97424)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > Changes LGTM but please be sure to add a release note when landing so users > know about the improvement. Thanks for the review. https://github.com/llvm/llvm-project/pull/97424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/97342 >From aea6519809340024226d587303e26c800c1a3756 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Mon, 1 Jul 2024 12:56:07 -0700 Subject: [PATCH 1/5] [NFC] Add assertion to ensure that FiniteMathOnly toggl

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
@@ -218,28 +214,31 @@ _Complex float pragma_default_div(_Complex float a, _Complex float b) { // IMPRVD-NEXT: fsub float // IMPRVD-NEXT: fdiv float - // PRMTD: load float, ptr {{.*}} - // PRMTD: fpext float {{.*}} to double - // PRMTD-NEXT: fpext float {{.*}} to double

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/98520 >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH 1/3] The pragma STDC CX_LIMITED_RANGE ON should have prece

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/98520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] The pragma STDC CX_LIMITED_RANGE ON should have precedence. (PR #98520)

2024-07-12 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/98520 >From da863999000a6b12f2930247de9df3daf0e5a608 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 11 Jul 2024 11:54:13 -0700 Subject: [PATCH 1/4] The pragma STDC CX_LIMITED_RANGE ON should have prece

[clang] Add __builtin_fmaf16. (PR #97424)

2024-07-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/97424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   >