[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/68069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/68069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/68069 >From ae2201c2bb82ae26030800c62b3a0f93e2ec49a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Oct 2023 08:35:57 +0200 Subject: [PATCH

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Erich Keane via cfe-commits
@@ -3,6 +3,14 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -verify=ref %s // RUN: %clang_cc1 -std=c++20 -fms-extensions -verify=ref %s + +constexpr _BitInt(2) A = 0; +constexpr _BitInt(2) B = A + 1; +constexpr _BitInt(2) C = B + 1; // expected-warning {{from 2 to -2}} \ --

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/68069 >From ae2201c2bb82ae26030800c62b3a0f93e2ec49a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Oct 2023 08:35:57 +0200 Subject: [PATCH] [clang][Interp] Add basic support for _BitInt Ma

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/68069 >From c93895b7e1b0727327178d73adc93cb988ad3966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Oct 2023 08:35:57 +0200 Subject: [PATCH] [clang][Interp] Add basic support for _BitInt Ma

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-02 Thread Timm Baeder via cfe-commits
@@ -582,11 +598,21 @@ def CastIntegralFloating : Opcode { // Cast a floating to an integer type def CastFloatingIntegral : Opcode { - let Types = [AluTypeClass]; + let Types = [FixedSizeIntegralTypes]; tbaederr wrote: The type classes for these get kinda co

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-02 Thread Timm Baeder via cfe-commits
@@ -1601,6 +1617,46 @@ bool CastFloatingIntegral(InterpState &S, CodePtr OpPC) { } } +static inline bool CastFloatingIntegralAP(InterpState &S, CodePtr OpPC, + uint32_t BitWidth) { + const Floating &F = S.Stk.pop(); + + APSInt Resul

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Make sure we pass the expected bitwidth around when casting to IntAP/IntAPS and move the tests to their own file. This makes it easier to test the `IntegralAP` code for different bit widths than 128. --- Full diff: https://github.com/llv

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/68069 Make sure we pass the expected bitwidth around when casting to IntAP/IntAPS and move the tests to their own file. This makes it easier to test the `IntegralAP` code for different bit widths than 128. >From d7