hubert.reinterpretcast added a comment.
In http://reviews.llvm.org/D15120#337384, @rjmccall wrote:
> I think it's not unlikely that float128_t will see future standardization (as
> an optional extension, of course), and it would be strange for an operation
> between two types to not consistentl
hubert.reinterpretcast added a comment.
In http://reviews.llvm.org/D15120#337654, @rjmccall wrote:
> In http://reviews.llvm.org/D15120#337552, @hubert.reinterpretcast wrote:
>
> > It remains that the present standardization effort (as `_Float128`) does
> > not imbue the "interchange" type with i
hubert.reinterpretcast added a comment.
In http://reviews.llvm.org/D15120#337144, @nemanjai wrote:
> Do you suggest that we need to allow operations (or at least assignments)
> between the two types and take away the diagnostics that are part of this
> patch?
It appears that the conclusion is
hubert.reinterpretcast added a comment.
Comment added inline. Otherwise, LGTM.
Comment at: lib/Sema/SemaDecl.cpp:7659
@@ +7658,3 @@
+Diag(D.getDeclSpec().getConceptSpecLoc(),
+ diag::err_concept_specified_specialization) << 1;
+ }
I don'
hubert.reinterpretcast added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:7659
@@ +7658,3 @@
+Diag(D.getDeclSpec().getConceptSpecLoc(),
+ diag::err_concept_specified_specialization) << 1;
+ }
nwilson wrote:
> hubert.reinterpretcast w
hubert.reinterpretcast added a comment.
I would like to see a test:
__float128 qf();
long double ldf();
long double ld{qf()}; // error: narrowing
__float128 q{ldf()}; // passes
Comment at: include/clang/Basic/TargetInfo.h:384
@@ +383,3 @@
+ unsigned getFloat128Width
hubert.reinterpretcast added a comment.
I would also like to see a test case based on the following from ISO/IEC TS
18661-3:2015:
> If both operands have floating types and neither of the sets of values of
> their corresponding real types is a subset of (or equivalent to) the other,
> the beha
hubert.reinterpretcast added a comment.
In http://reviews.llvm.org/D15120#310992, @nemanjai wrote:
> I think the correct course of action would be to allow/disallow promotion
> based on a condition that the two types are the same/different
> (respectively). I think a comparison of the float sem
@@ -5040,6 +5040,10 @@ def mspe : Flag<["-"], "mspe">,
Group;
def mno_spe : Flag<["-"], "mno-spe">, Group;
def mefpu2 : Flag<["-"], "mefpu2">, Group;
} // let Flags = [TargetSpecific]
+def msave_reg_params : Flag<["-"], "msave-reg-params">, Group,
+ Visibility<[ClangOption, C
hubert-reinterpretcast wrote:
I don't see a compelling reason for the extension and I find its behaviour
somewhat arbitrary: why is it okay to allow the overflow in the definition of
an enumerator but not okay to allow for `alignas`?
https://github.com/llvm/llvm-project/pull/102390
___
hubert-reinterpretcast wrote:
> Ping?
The changes to add the "constexpr since" property are missing changes to the
tablegen utility. Figuring out how it would work is more involved than I had
the time for right now.
https://github.com/llvm/llvm-project/pull/88978
_
hubert-reinterpretcast wrote:
> Yes, I have tried limiting it to `LibBuiltin` but the addition of
> `FrexpF16F128` led me to add it `Builtin` too.
I believe that FrexpF16F128 only has the `__builtin_`-prefixed versions. That
would mean that it does not need to be "constexpr since" (just plain
hubert-reinterpretcast 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.
https://github.com/llvm/llv
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
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
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
@@ -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 larg
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
@@ -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 updateForAIXShLibT
@@ -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 updateForAIXShLibT
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
@@ -5813,6 +5813,27 @@ static TypoCorrection TryTypoCorrectionForCall(Sema &S,
Expr *Fn,
return TypoCorrection();
}
+// [C++26][[expr.unary.op]/p4
+// A pointer to member is only formed when an explicit &
+// is used and its operand is a qualified-id not enclosed in parenth
@@ -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_cc
@@ -253,8 +253,10 @@ def FmodF16F128 : F16F128MathTemplate, Builtin {
def FrexpF16F128 : F16F128MathTemplate, Builtin {
let Spellings = ["__builtin_frexp"];
- let Attributes = [FunctionWithBuiltinPrefix, NoThrow];
+ let Attributes = [FunctionWithBuiltinPrefix, NoThrow, Con
@@ -0,0 +1,106 @@
+// 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: -emit-llvm -o - %s | FileCheck %s
+
+#define NAN (__builtin_nanf(""))
+#define
@@ -0,0 +1,108 @@
+// RUN: %clang_cc1 -DWIN -verify=nan-not-constant -std=c++23 -fsyntax-only %s
+// RUN: %clang_cc1 -verify -std=c++23 -fsyntax-only %s
+// RUN: %clang_cc1 -verify=cplusplus20andless -std=c++20 -fsyntax-only %s
+
+// expected-no-diagnostics
+
+
+#ifdef WIN
+#de
@@ -5813,6 +5813,27 @@ static TypoCorrection TryTypoCorrectionForCall(Sema &S,
Expr *Fn,
return TypoCorrection();
}
+// [C++26][[expr.unary.op]/p4
+// A pointer to member is only formed when an explicit &
+// is used and its operand is a qualified-id not enclosed in parenth
https://github.com/hubert-reinterpretcast edited
https://github.com/llvm/llvm-project/pull/93430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5813,6 +5813,27 @@ static TypoCorrection TryTypoCorrectionForCall(Sema &S,
Expr *Fn,
return TypoCorrection();
}
+// [C++26][[expr.unary.op]/p4
+// A pointer to member is only formed when an explicit &
+// is used and its operand is a qualified-id not enclosed in parenth
hubert-reinterpretcast wrote:
@cor3ntin @AaronBallman, the new diagnostic triggers for valid code
(https://gcc.godbolt.org/z/fMvEaGabG):
```cpp
#include
struct S {
int x;
static_assert(std::is_same::value, "");
static_assert(std::is_same::value, "");
};
```
Either the first `stat
hubert-reinterpretcast wrote:
Indeed, the new diagnostic is never valid because the permission to name
non-static data members in unevaluated operands is not restricted by scope:
https://eel.is/c++draft/expr.prim.id.general#4.3
https://gcc.godbolt.org/z/h4eTT984M:
```cpp
namespace std {
temp
hubert-reinterpretcast wrote:
> Or is there a deeper issue here and I'm not seeing it?
The previous Clang behaviour produced the wrong type as the result. So the
choices are to:
1. Do the old wrong thing: silent incorrect behaviour
2. Do the new wrong thing: produce diagnostic that may confuse
hubert-reinterpretcast wrote:
The optics of having something in the release notes about this (if the bug is
not fixed properly) is not good.
Meaning that I am leaning towards options (1) or (3).
https://github.com/llvm/llvm-project/pull/89713
___
cfe-
hubert-reinterpretcast wrote:
I think (at least part of) the fix is to add a condition to
https://github.com/llvm/llvm-project/blob/21e6777957457451196084cd48ebc42bce9619f0/clang/lib/Sema/SemaExpr.cpp#L14117-L14120
that the operand is not parenthesized. For reference, the
address-of-member-fun
hubert-reinterpretcast wrote:
For info, the cases where the _id-expression_ is transformed into a class
member access expression (`q` and `h` below) do not run into this code (see
https://cplusplus.github.io/CWG/issues/2902.html regarding said transformation):
```cpp
#include
struct S {
int
hubert-reinterpretcast wrote:
> PS: Sorry for misunderstanding the original issue.
Totally understandable. Thanks for following up on this.
> These changes pass all tests above:
Can you check this case with your build?
```cpp
struct A { int x; };
char q(int *);
short q(int A::*);
template
c
@@ -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
@@ -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
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
@@ -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) ||
+!E
@@ -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
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
@@ -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`?
https://github.c
@@ -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 (n
@@ -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
@@ -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 --check
@@ -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 AddBuiltinPr
@@ -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 libr
@@ -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 amb
@@ -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 res
@@ -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
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
@@ -113,7 +113,11 @@ static T PickFP(const llvm::fltSemantics *Sem, T
IEEEHalfVal, T IEEESingleVal,
static void DefineFloatMacros(MacroBuilder &Builder, StringRef Prefix,
const llvm::fltSemantics *Sem, StringRef Ext) {
- const char *DenormMin, *
@@ -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
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
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
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
https://lists.llvm.org/cgi-bin/mail
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
incrementProfileCounter(&S);
}
+bool CodeGenFunction::checkIfLoopMustProgress(const Expr
*ControllingExpression,
+ bool HasEmptyBody) {
+ if (CGM.getCode
@@ -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 (!EvaluateFloat(E->ge
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
incrementProfileCounter(&S);
}
+bool CodeGenFunction::checkIfLoopMustProgress(const Expr
*ControllingExpression,
+ bool HasEmptyBody) {
+ if (CGM.getCode
@@ -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 --check
@@ -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
@@ -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
@@ -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
@@ -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 --check
@@ -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 --check
@@ -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 --check
@@ -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
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
incrementProfileCounter(&S);
}
+bool CodeGenFunction::checkIfLoopMustProgress(const Expr
*ControllingExpression,
+ bool HasEmptyBody) {
+ if (CGM.getCode
@@ -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 --c
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
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
@@ -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 &x) {
hube
@@ -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() && !Result.isInfinity(
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
@@ -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 t
@@ -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 t
@@ -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 t
@@ -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 t
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
@@ -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
@@ -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
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 th
@@ -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
@@ -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_cc
@@ -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
@@ -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 onl
@@ -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_cc
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 https://wg21.link/const
@@ -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:
The
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
@@ -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:
> I
@@ -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.
https://github.com/llvm/llvm-pro
@@ -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:
`_
@@ -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 Ad
@@ -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];
hubert-reinterpretcast
@@ -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.
@@ -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;
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
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
201 - 300 of 406 matches
Mail list logo