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

2024-05-20 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-20 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-20 Thread Hubert Tong 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-05-20 Thread Hubert Tong via cfe-commits
@@ -14674,6 +14676,31 @@ static bool TryEvaluateBuiltinNaN(const ASTContext , return true; } +// Checks that the value x is in the range (-1;-0.5], [0.5; 1) +static bool isInFrexpResultRange(const llvm::APFloat ) { + llvm::APFloat minusOne(x.getSemantics(), "-1.0"); +

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

2024-05-19 Thread Hubert Tong via cfe-commits
@@ -3622,15 +3623,15 @@ def Fma : FPMathTemplate, LibBuiltin<"math.h"> { def Fmax : FPMathTemplate, LibBuiltin<"math.h"> { let Spellings = ["fmax"]; - let Attributes = [NoThrow, Const]; + let Attributes = [NoThrow, Const, Constexpr];

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

2024-05-19 Thread Hubert Tong via cfe-commits
@@ -3622,15 +3623,15 @@ def Fma : FPMathTemplate, LibBuiltin<"math.h"> { def Fmax : FPMathTemplate, LibBuiltin<"math.h"> { let Spellings = ["fmax"]; - let Attributes = [NoThrow, Const]; + let Attributes = [NoThrow, Const, Constexpr]; let Prototype = "T(T, T)"; let

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

2024-05-19 Thread Hubert Tong 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: { hubert-reinterpretcast wrote:

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

2024-05-19 Thread Hubert Tong via cfe-commits
@@ -3452,9 +3452,10 @@ def Fmod : FPMathTemplate, LibBuiltin<"math.h"> { def Frexp : FPMathTemplate, LibBuiltin<"math.h"> { hubert-reinterpretcast wrote: There is a separate `FrexpF16F128` that should probably also be updated.

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

2024-05-19 Thread Hubert Tong 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]; hubert-reinterpretcast wrote: >

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

2024-05-19 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-18 Thread Hubert Tong 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]; hubert-reinterpretcast wrote:

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

2024-05-18 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: > Some more thought is needed on how to handle the non-`__builtin_`-prefixed > cases under non-C++23-or-higher language modes. The specific implications of > those functions being non-`constexpr` under said modes (as required, for C++, > by

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

2024-05-17 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,162 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN:

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

2024-05-17 Thread Hubert Tong 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 hubert-reinterpretcast wrote: Duplicate this run line for `-std=c++20`. Modify the test to use the `__builtin_*` functions

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

2024-05-17 Thread Hubert Tong via cfe-commits
@@ -14683,6 +14710,23 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexp: hubert-reinterpretcast wrote: The non-`__builtin_`-prefixed cases need to be added in as per @philnik777's

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

2024-05-17 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,162 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN:

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

2024-05-17 Thread Hubert Tong 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-17 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: Re: https://github.com/llvm/llvm-project/pull/88978#discussion_r1578762448 > It means that INT_MAX and INT_MIN is fine (based on the wording). The committee reflector discussion reached a conclusion that this behaviour is okay. Implementations need not agree on

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

2024-05-17 Thread Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: At the Clang C/C++ Language Workgroup call on 2024-05-15, it was agreed

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

2024-05-17 Thread Hubert Tong via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo , 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 to

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

2024-05-16 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-16 Thread Hubert Tong via cfe-commits
@@ -14574,9 +14574,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpl: +// AIX library function `frexpl` has 'long double' type and not +// PPCDoubleDouble type. To make sure we generate

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

2024-05-16 Thread Hubert Tong via cfe-commits
@@ -14574,9 +14574,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpl: +// AIX library function `frexpl` has 'long double' type and not +// PPCDoubleDouble type. To make sure we generate

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

2024-05-16 Thread Hubert Tong via cfe-commits
@@ -14574,9 +14574,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpl: +// AIX library function `frexpl` has 'long double' type and not +// PPCDoubleDouble type. To make sure we generate

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

2024-05-15 Thread Hubert Tong via cfe-commits
@@ -14574,9 +14574,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpl: +// AIX library function `frexpl` has 'long double' type and not +// PPCDoubleDouble type. To make sure we generate

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

2024-05-09 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-09 Thread Hubert Tong via cfe-commits
@@ -14572,6 +14572,9 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { int FrexpExp; llvm::RoundingMode RM = getActiveRoundingMode(Info, E); Result = llvm::frexp(Result, FrexpExp, RM); +if (!Result.isZero() && !Result.isNaN() &&

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

2024-05-09 Thread Hubert Tong via cfe-commits
@@ -951,6 +951,19 @@ class APFloat : public APFloatBase { bool needsCleanup() const { APFLOAT_DISPATCH_ON_SEMANTICS(needsCleanup()); } + // Checks that the value x is in the range (-1;-0.5], [0.5; 1) + static bool isInRange(const llvm::APFloat ) {

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

2024-05-09 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast commented: Partial review comments. 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] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/91522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Hubert Tong via cfe-commits
@@ -23,5 +23,5 @@ // Plugins are only relevant for the -cc1 phase. No warning should be raised // when only using the assembler. See GH #88173. -// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option -Werror -x assembler %s -### 2>&1 | FileCheck %s

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-05 Thread Hubert Tong via cfe-commits
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool HasEmptyBody) { + if

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,38 @@ +// 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-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,38 @@ +// 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-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,38 @@ +// 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-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,38 @@ +// 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] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool HasEmptyBody) { + if

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

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -14547,6 +14547,20 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexp: + case Builtin::BI__builtin_frexpf: + case Builtin::BI__builtin_frexpl: { +LValue Pointer; +if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-03 Thread Hubert Tong via cfe-commits
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool HasEmptyBody) { + if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-03 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast commented: @cor3ntin, can you take a look at the case I added? Thanks. https://github.com/llvm/llvm-project/pull/90066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-03 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/90066 ___ 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-05-01 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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-05-01 Thread Hubert Tong 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 Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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 Hubert Tong 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 Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: I think we'll be missing at least "pedantic" diagnostics if we don't

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

2024-04-29 Thread Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: > How would that help? I guess it doesn't... The functions would be

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

2024-04-28 Thread Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: Makes me wonder how far C++ stdlibs will get if they included the C

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

2024-04-26 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -DWIN -emit-llvm -o - %s | FileCheck %s --check-prefixes=WIN + +// RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++23 \ +// RUN: -emit-llvm -o - %s | FileCheck %s

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

2024-04-26 Thread Hubert Tong via cfe-commits
@@ -3440,7 +3440,7 @@ def Fmod : FPMathTemplate, LibBuiltin<"math.h"> { def Frexp : FPMathTemplate, LibBuiltin<"math.h"> { let Spellings = ["frexp"]; - let Attributes = [NoThrow]; + let Attributes = [NoThrow, Constexpr]; let Prototype = "T(T, int*)"; let

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

2024-04-26 Thread Hubert Tong 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-26 Thread Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: Don't make these evaluate in `constexpr`. Not only does this extend C

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

2024-04-26 Thread Hubert Tong via cfe-commits
@@ -14547,6 +14547,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpf: + case Builtin::BI__builtin_frexp: { hubert-reinterpretcast wrote: Why no `long double`?

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

2024-04-25 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast requested changes to this pull request. 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-25 Thread Hubert Tong 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-25 Thread Hubert Tong via cfe-commits
@@ -14547,6 +14547,17 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexpf: + case Builtin::BI__builtin_frexp: { +LValue Pointer; +if (!EvaluateFloat(E->getArg(0), Result, Info) || +

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

2024-04-25 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast 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-24 Thread Hubert Tong via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo , 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 to

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

2024-04-23 Thread Hubert Tong via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo , 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 to

[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

2024-04-16 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast commented: See inline comments for rationale re: scoping to LD -> IE only (and not performing IE -> LD). https://github.com/llvm/llvm-project/pull/84132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

2024-04-16 Thread Hubert Tong via cfe-commits
@@ -3362,6 +3362,64 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op, return LowerGlobalTLSAddressLinux(Op, DAG); } +/// updateForAIXShLibTLSModelOpt - Helper to initialize TLS model opt settings, +/// and then apply the update. +static void

[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

2024-04-16 Thread Hubert Tong via cfe-commits
@@ -3362,6 +3362,64 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op, return LowerGlobalTLSAddressLinux(Op, DAG); } +/// updateForAIXShLibTLSModelOpt - Helper to initialize TLS model opt settings, +/// and then apply the update. +static void

[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

2024-04-16 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/84132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

2024-04-16 Thread Hubert Tong via cfe-commits
@@ -5019,6 +5019,10 @@ def maix_small_local_exec_tls : Flag<["-"], "maix-small-local-exec-tls">, "where the offset from the TLS base is encoded as an " "immediate operand (AIX 64-bit only). " "This access sequence is not used for variables

[clang] [Documentation][Blocks ABI] Fix typoed integer (PR #65688)

2024-04-15 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/65688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Documentation][Blocks ABI] Fix typoed integer (PR #65688)

2024-04-15 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/65688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Documentation][Blocks ABI] Fix typoed integer (PR #65688)

2024-04-15 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/65688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-03-18 Thread Hubert Tong via cfe-commits
@@ -6375,12 +6383,16 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + if (V.HasImmediateCalls ||

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-29 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: > The manual change says "the TOC data transformation will be applied to [...] > block-scope static variables". But later, you mention "internal linkage", > which is a bit confusing when you're dealing with C++. Block-scope static > variables don't have "linkage"

[clang] [AIX][clang][driver] fix no-pthread option (PR #69363)

2023-10-18 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: @daltenty, can we also have a check that the driver does not pass `-pthread` to the frontend when `-no-pthread` is used? As a complication, I think the code responsible is common cross-platform code in

[clang] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

2023-10-13 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/66316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

2023-10-13 Thread Hubert Tong via cfe-commits
@@ -660,14 +671,16 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI, "GETtls[ld]ADDR[32] must read GPR3"); if (Subtarget->isAIXABI()) { -// On AIX, the variable offset should already be in R4 and the region handle -// should already be in R3. -

[clang] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

2023-10-13 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/66316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-11 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: The code formatting check failure seems to be a infrastructure problem: https://discourse.llvm.org/t/clang-format-github-action-cannot-find-merge-base/73894 https://github.com/llvm/llvm-project/pull/68476 ___ cfe-commits

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-11 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast approved this pull request. LGTM, but I am not sure if @stefanp-ibm continues to be concerned about enabling this for ABIs that have not been updated to specify a treatment of the VSX registers. https://github.com/llvm/llvm-project/pull/68476

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-10 Thread Hubert Tong via cfe-commits
@@ -807,7 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. hubert-reinterpretcast wrote: > I

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-10 Thread Hubert Tong via cfe-commits
@@ -828,10 +829,7 @@ const TargetInfo::AddlRegName GCCAddlRegNames[] = { }; ArrayRef PPCTargetInfo::getGCCAddlRegNames() const { - if (ABI == "elfv2") -return llvm::ArrayRef(GCCAddlRegNames); - else -return TargetInfo::getGCCAddlRegNames(); + return

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-10 Thread Hubert Tong via cfe-commits
@@ -807,7 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. hubert-reinterpretcast wrote: > To

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-09 Thread Hubert Tong via cfe-commits
@@ -807,7 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. hubert-reinterpretcast wrote: I am

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-07 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/68476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-07 Thread Hubert Tong via cfe-commits
@@ -2,6 +2,10 @@ // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -target-feature +vsx \ // RUN: -target-cpu pwr9 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64-ibm-aix -target-feature +vsx \ +// RUN: -target-cpu pwr9 -emit-llvm %s -o - |

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-07 Thread Hubert Tong via cfe-commits
@@ -807,6 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. +// And this mapping applies to all OSes which runs

[clang] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

2023-10-03 Thread Hubert Tong via cfe-commits
@@ -660,14 +671,16 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI, "GETtls[ld]ADDR[32] must read GPR3"); if (Subtarget->isAIXABI()) { -// On AIX, the variable offset should already be in R4 and the region handle -// should already be in R3. -

[clang] cead149 - Add new option -fkeep-persistent-storage-variables to Clang release notes

2023-07-24 Thread Hubert Tong via cfe-commits
Author: Zheng Qian Date: 2023-07-24T22:56:18-04:00 New Revision: cead1497ae0c1d57ee6883500c7c205f83798440 URL: https://github.com/llvm/llvm-project/commit/cead1497ae0c1d57ee6883500c7c205f83798440 DIFF: https://github.com/llvm/llvm-project/commit/cead1497ae0c1d57ee6883500c7c205f83798440.diff

[clang] bb6ab91 - Add option -fkeep-persistent-storage-variables to emit all variables that have a persistent storage duration

2023-07-15 Thread Hubert Tong via cfe-commits
Author: Zheng Qian Date: 2023-07-15T16:13:48-04:00 New Revision: bb6ab91b1dcd2fadfddffcd020439978af184862 URL: https://github.com/llvm/llvm-project/commit/bb6ab91b1dcd2fadfddffcd020439978af184862 DIFF: https://github.com/llvm/llvm-project/commit/bb6ab91b1dcd2fadfddffcd020439978af184862.diff

[clang] 0f5099c - Opting out of Clang 16 ABI Changes for AIX and z/OS

2023-01-23 Thread Hubert Tong via cfe-commits
Author: Nicole Rabjohn Date: 2023-01-24T01:14:05-05:00 New Revision: 0f5099cd94226479fe30b4fc2d6a9743ebe2b12b URL: https://github.com/llvm/llvm-project/commit/0f5099cd94226479fe30b4fc2d6a9743ebe2b12b DIFF:

[clang] 6ace52e - [Driver][AIX] Change UNSUPPORTED to XFAIL system-aix

2022-11-04 Thread Hubert Tong via cfe-commits
Author: Hubert Tong Date: 2022-11-04T12:26:53-04:00 New Revision: 6ace52e5e49cff6664fc301fa4985fc28c88f26f URL: https://github.com/llvm/llvm-project/commit/6ace52e5e49cff6664fc301fa4985fc28c88f26f DIFF: https://github.com/llvm/llvm-project/commit/6ace52e5e49cff6664fc301fa4985fc28c88f26f.diff

[clang] bd8b55e - [AIX][clang/test] Set/propagate AIXTHREAD_STK for AIX

2022-07-08 Thread Hubert Tong via cfe-commits
Author: Hubert Tong Date: 2022-07-08T18:33:16-04:00 New Revision: bd8b55e609c825f1063a28ef94502a6bfed7a0fd URL: https://github.com/llvm/llvm-project/commit/bd8b55e609c825f1063a28ef94502a6bfed7a0fd DIFF: https://github.com/llvm/llvm-project/commit/bd8b55e609c825f1063a28ef94502a6bfed7a0fd.diff

[clang] 6bd53df - [clang][NFC][tests] dr208.c optional signext handling

2022-06-30 Thread Hubert Tong via cfe-commits
Author: Hubert Tong Date: 2022-07-01T00:03:58-04:00 New Revision: 6bd53df9b6e9fffb440ee2f9020f15b61f8b39e7 URL: https://github.com/llvm/llvm-project/commit/6bd53df9b6e9fffb440ee2f9020f15b61f8b39e7 DIFF: https://github.com/llvm/llvm-project/commit/6bd53df9b6e9fffb440ee2f9020f15b61f8b39e7.diff

[clang] 52ce95a - [NFC] Prevent shadowing a variable declared in `if`

2022-04-28 Thread Hubert Tong via cfe-commits
Author: Ken Matsui Date: 2022-04-28T22:22:27-04:00 New Revision: 52ce95a1a55424256f0d56e32392396896ed7f76 URL: https://github.com/llvm/llvm-project/commit/52ce95a1a55424256f0d56e32392396896ed7f76 DIFF: https://github.com/llvm/llvm-project/commit/52ce95a1a55424256f0d56e32392396896ed7f76.diff

[clang] ce21c92 - [Clang] Work with multiple pragmas weak before definition

2022-03-24 Thread Hubert Tong via cfe-commits
Author: Hubert Tong Date: 2022-03-24T20:17:49-04:00 New Revision: ce21c926f8efe969717e21e3ae6c5a3246b3d455 URL: https://github.com/llvm/llvm-project/commit/ce21c926f8efe969717e21e3ae6c5a3246b3d455 DIFF: https://github.com/llvm/llvm-project/commit/ce21c926f8efe969717e21e3ae6c5a3246b3d455.diff

[clang] da167a5 - [Clang][NFC] Some `const` for `IdentifierInfo *`s feeding `DeclarationName`

2022-03-23 Thread Hubert Tong via cfe-commits
Author: Hubert Tong Date: 2022-03-23T11:07:56-04:00 New Revision: da167a53c87f53ce582de6cc122d5e090f341b42 URL: https://github.com/llvm/llvm-project/commit/da167a53c87f53ce582de6cc122d5e090f341b42 DIFF: https://github.com/llvm/llvm-project/commit/da167a53c87f53ce582de6cc122d5e090f341b42.diff

Re: [llvm-dev] Phabricator Creator Pulling the Plug

2021-09-30 Thread Hubert Tong via cfe-commits
On Thu, Sep 30, 2021 at 6:56 PM Mehdi AMINI via cfe-commits < cfe-commits@lists.llvm.org> wrote: > We talked about this with the IWG (Infrastructure Working Group) just > last week coincidentally. > Two major blocking tracks that were identified at the roundtable > during the LLVM Dev Meeting

Re: [clang] 9ca905b - XFAIL a test on ppc64

2021-07-30 Thread Hubert Tong via cfe-commits
On Fri, Jul 30, 2021 at 12:59 PM wrote: > Do you have a suggestion for how to fix it? This isn’t actually my test, > I tripped over it and it seemed like it would be easy to get it to work. > ☹ > I think removing all of the `-target` options might help. Alternatively, I don't see why the test

Re: [clang] 9ca905b - XFAIL a test on ppc64

2021-07-30 Thread Hubert Tong via cfe-commits
On Fri, Jul 30, 2021 at 12:05 PM Paul Robinson via cfe-commits < cfe-commits@lists.llvm.org> wrote: > > Author: Paul Robinson > Date: 2021-07-30T09:05:14-07:00 > New Revision: 9ca905b52d53c46aceb4d28e44dfbf4a815d0c68 > > URL: >

[clang] 7d669e6 - [AIX] Generate large code model relocations when mcmodel=medium on AIX

2021-07-22 Thread Hubert Tong via cfe-commits
Author: Anjan Kumar Guttahalli Krishna Date: 2021-07-22T15:47:22-04:00 New Revision: 7d669ec1d67c1b4aecd90687013636d8037c URL: https://github.com/llvm/llvm-project/commit/7d669ec1d67c1b4aecd90687013636d8037c DIFF:

  1   2   3   >