aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/DeclSpec.cpp
AgeCommit message (Collapse)AuthorFilesLines
9 days[Clang][AST][NFC] Introduce `NamespaceBaseDecl` (#149123)Yanzuo Liu1-14/+1
Add `NamespaceBaseDecl` as common base class of `NamespaceDecl` and `NamespaceAliasDecl`. This simplifies `NestedNameSpecifier` a bit. Co-authored-by: Matheus Izvekov <mizvekov@gmail.com>
2025-04-01[clang] improved preservation of template keyword (#133610)Matheus Izvekov1-3/+3
2025-01-20[SystemZ] Add support for new cpu architecture - arch15Ulrich Weigand1-4/+6
This patch adds support for the next-generation arch15 CPU architecture to the SystemZ backend. This includes: - Basic support for the new processor and its features. - Detection of arch15 as host processor. - Assembler/disassembler support for new instructions. - Exploitation of new instructions for code generation. - New vector (signed|unsigned|bool) __int128 data types. - New LLVM intrinsics for certain new instructions. - Support for low-level builtins mapped to new LLVM intrinsics. - New high-level intrinsics in vecintrin.h. - Indicate support by defining __VEC__ == 10305. Note: No currently available Z system supports the arch15 architecture. Once new systems become available, the official system name will be added as supported -march name.
2024-12-12[clang] Reject `_Complex _BitInt` (#119402)Mariya Podchishchaeva1-2/+1
The C standard doesn't require support for these types and Codegen for these types is incorrect ATM. See https://github.com/llvm/llvm-project/issues/119352
2024-11-16[Sema] Remove unused includes (NFC) (#116461)Kazu Hirata1-3/+0
Identified with misc-include-cleaner.
2024-09-13[HLSL] Add HLSL 202y language mode (#108437)Chris B1-1/+5
This change adds a new HLSL 202y language mode. Currently HLSL 202y is planned to add `auto` and `constexpr`. This change updates extension diagnostics to state that lambadas are a "clang HLSL" extension (since we have no planned release yet to include them), and that `auto` is a HLSL 202y extension when used in earlier language modes. Note: This PR does temporarily work around some differences between HLSL 2021 and 202x in Clang by changing test cases to explicitly specify 202x. A subsequent PR will update 2021's language flags to match 202x.
2024-08-05[HLSL] Implement intangible AST type (#97362)Helena Kotas1-0/+6
HLSL has a set of intangible types which are described in in the [draft HLSL Specification (**[Basic.types]**)](https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf): There are special implementation-defined types such as handle types, which fall into a category of standard intangible types. Intangible types are types that have no defined object representation or value representation, as such the size is unknown at compile time. A class type T is an intangible class type if it contains an base classes or members of intangible class type, standard intangible type, or arrays of such types. Standard intangible types and intangible class types are collectively called intangible types([9](https://microsoft.github.io/hlsl-specs/specs/hlsl.html#Intangible)). This PR implements one standard intangible type `__hlsl_resource_t` and sets up the infrastructure that will make it easier to add more in the future, such as samplers or raytracing payload handles. The HLSL intangible types are declared in `clang/include/clang/Basic/HLSLIntangibleTypes.def` and this file is included with related macro definition in most places that require edits when a new type is added. The new types are added as keywords and not typedefs to make sure they cannot be redeclared, and they can only be declared in builtin implicit headers. The `__hlsl_resource_t` type represents a handle to a memory resource and it is going to be used in builtin HLSL buffer types like this: template <typename T> class RWBuffer { [[hlsl::contained_type(T)]] [[hlsl::is_rov(false)]] [[hlsl::resource_class(uav)]] __hlsl_resource_t Handle; }; Part 1/3 of llvm/llvm-project#90631. --------- Co-authored-by: Justin Bogner <mail@justinbogner.com>
2024-07-08[C2y] Remove support for _Imaginary (#97436)Aaron Ballman1-3/+3
WG14 N3274 removed _Imaginary from Annex G. Clang has never fully supported Annex G or _Imaginary, so removal is pretty trivial for us. Note, we are keeping _Imaginary as a keyword so that we get better diagnostic behavior. This is still conforming because _I makes it a reserved identifier, so it's not available for users to use as an identifier anyway.
2024-06-18[Clang][Sema] Diagnose variable template explicit specializations with ↵Krystian Stasiowski1-0/+1
storage-class-specifiers (#93873) According to [temp.expl.spec] p2: > The declaration in an _explicit-specialization_ shall not be an _export-declaration_. An explicit specialization shall not use a _storage-class-specifier_ other than `thread_local`. Clang partially implements this, but a number of issues exist: 1. We don't diagnose class scope explicit specializations of variable templates with _storage-class-specifiers_, e.g. ``` struct A { template<typename T> static constexpr int x = 0; template<> static constexpr int x<void> = 1; // ill-formed, but clang accepts }; ```` 2. We incorrectly reject class scope explicit specializations of variable templates when `static` is not used, e.g. ``` struct A { template<typename T> static constexpr int x = 0; template<> constexpr int x<void> = 1; // error: non-static data member cannot be constexpr; did you intend to make it static? }; ```` 3. We don't diagnose dependent class scope explicit specializations of function templates with storage class specifiers, e.g. ``` template<typename T> struct A { template<typename U> static void f(); template<> static void f<int>(); // ill-formed, but clang accepts }; ```` This patch addresses these issues as follows: - # 1 is fixed by issuing a diagnostic when an explicit specialization of a variable template has storage class specifier - # 2 is fixed by considering any non-function declaration with any template parameter lists at class scope to be a static data member. This also allows for better error recovery (it's more likely the user intended to declare a variable template than a "field template"). - # 3 is fixed by checking whether a function template explicit specialization has a storage class specifier even when the primary template is not yet known. One thing to note is that it would be far simpler to diagnose this when parsing the _decl-specifier-seq_, but such an implementation would necessitate a refactor of `ParsedTemplateInfo` which I believe to be outside the scope of this patch.
2024-04-30[Clang][Sema] Do not accept "vector _Complex" for AltiVec/ZVector (#90467)Ulrich Weigand1-1/+4
The AltiVec (POWER) and ZVector (IBM Z) language extensions do not support using the "vector" keyword when the element type is a complex type, but current code does not verify this. Add a Sema check and diagnostic for this case. Fixes: https://github.com/llvm/llvm-project/issues/88399
2024-04-28[Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (#89906)cor3ntin1-2/+2
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0609r3.pdf We support this feature in all language mode. maybe_unused applied to a binding makes the whole declaration unused.
2024-03-06[C23] Implement N3018: The constexpr specifier for object definitions (#73099)Mariya Podchishchaeva1-0/+14
The implementation mostly reuses C++ code paths where possible, including narrowing check in order to provide diagnostic messages in case initializer for constexpr variable is not exactly representable in target type. The following won't work due to lack of support for other features: - Diagnosing of underspecified declarations involving constexpr - Constexpr attached to compound literals Also due to lack of support for char8_t some of examples with utf-8 strings don't work properly. Fixes https://github.com/llvm/llvm-project/issues/64742
2024-02-13[Clang][Sema] Diagnose friend declarations with enum ↵Krystian Stasiowski1-7/+2
elaborated-type-specifier in all language modes (#80171) According to [dcl.type.elab] p4: > If an _elaborated-type-specifier_ appears with the `friend` specifier as an entire _member-declaration_, the _member-declaration_ shall have one of the following forms: > `friend` _class-key_ _nested-name-specifier_(opt) _identifier_ `;` > `friend` _class-key_ _simple-template-id_ `;` > `friend` _class-key_ _nested-name-specifier_ `template`(opt) _simple-template-id_ `;` Notably absent from this list is the `enum` form of an _elaborated-type-specifier_ "`enum` _nested-name-specifier_(opt) _identifier_", which appears to be intentional per the resolution of CWG2363. Most major implementations accept these declarations, so the diagnostic is a pedantic warning across all C++ versions. In addition to the trivial cases previously diagnosed in C++98, we now diagnose cases where the _elaborated-type-specifier_ has a dependent _nested-name-specifier_: ``` template<typename T> struct A { enum class E; }; struct B { template<typename T> friend enum A<T>::E; // pedantic warning: elaborated enumeration type cannot be a friend }; template<typename T> struct C { friend enum T::E; // pedantic warning: elaborated enumeration type cannot be a friend }; ```
2024-01-27[Clang][C++26] Implement Pack Indexing (P2662R3). (#72644)cor3ntin1-0/+21
Implements https://isocpp.org/files/papers/P2662R3.pdf The feature is exposed as an extension in older language modes. Mangling is not yet supported and that is something we will have to do before release.
2023-10-05[C2X] N3007 Type inference for object definitionsGuillot Tony1-2/+3
Re-landing 5d78b78c8538 which was reverted. This patches implements the auto keyword from the N3007 standard specification. This allows deducing the type of the variable like in C++: ``` auto nb = 1; auto chr = 'A'; auto str = "String"; ``` The list of statements which allows the usage of auto: * Basic variables declarations (int, float, double, char, char*...) * Macros declaring a variable with the auto type The list of statements which will not work with the auto keyword: * auto arrays * sizeof(), alignas() * auto parameters, auto return type * auto as a struct/typedef member * uninitialized auto variables * auto in an union * auto as a enum type specifier * auto casts * auto in an compound literals Differential Revision: https://reviews.llvm.org/D133289
2023-10-05Revert "[C2X] N3007 Type inference for object definitions"Aaron Ballman1-3/+2
This reverts commit 5d78b78c853830516e734cfa64bfba70479e35dc. Reverting due to the failure found by: https://lab.llvm.org/buildbot/#/builders/245/builds/14999
2023-10-05[C2X] N3007 Type inference for object definitionsGuillot Tony1-2/+3
This patches implements the auto keyword from the N3007 standard specification. This allows deducing the type of the variable like in C++: ``` auto nb = 1; auto chr = 'A'; auto str = "String"; ``` The list of statements which allows the usage of auto: * Basic variables declarations (int, float, double, char, char*...) * Macros declaring a variable with the auto type The list of statements which will not work with the auto keyword: * auto arrays * sizeof(), alignas() * auto parameters, auto return type * auto as a struct/typedef member * uninitialized auto variables * auto in an union * auto as a enum type specifier * auto casts * auto in an compound literals Differential Revision: https://reviews.llvm.org/D133289
2023-10-02[C++] Implement "Deducing this" (P0847R7)Corentin Jabot1-0/+12
This patch implements P0847R7 (partially), CWG2561 and CWG2653. Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D140828
2022-11-01Update a stale comment; NFCAaron Ballman1-3/+2
This function doesn't return anything these days.
2022-09-28[C2x] implement typeof and typeof_unqualAaron Ballman1-0/+4
This implements WG14 N2927 and WG14 N2930, which together define the feature for typeof and typeof_unqual, which get the type of their argument as either fully qualified or fully unqualified. The argument to either operator is either a type name or an expression. If given a type name, the type information is pulled directly from the given name. If given an expression, the type information is pulled from the expression. Recursive use of these operators is allowed and has the expected behavior (the innermost operator is resolved to a type, and that's used to resolve the next layer of typeof specifier, until a fully resolved type is determined. Note, we already supported typeof in GNU mode as a non-conforming extension and we are *not* exposing typeof_unqual as a non-conforming extension in that mode, nor are we exposing typeof or typeof_unqual as a nonconforming extension in other language modes. The GNU variant of typeof supports a form where the parentheses are elided from the operator when given an expression (e.g., typeof 0 i = 12;). When in C2x mode, we do not support this extension. Differential Revision: https://reviews.llvm.org/D134286
2022-09-12[Clang] NFC: Make UnqualifiedId::Kind private for consistency.Corentin Jabot1-1/+1
Differential Revision: https://reviews.llvm.org/D133703
2022-09-08[clang] Use std::size instead of llvm::array_lengthofJoe Loser1-3/+2
LLVM contains a helpful function for getting the size of a C-style array: `llvm::array_lengthof`. This is useful prior to C++17, but not as helpful for C++17 or later: `std::size` already has support for C-style arrays. Change call sites to use `std::size` instead. Leave the few call sites that use a locally defined `array_lengthof` that are meant to test previous bugs with NTTPs in clang analyzer and SemaTemplate. Differential Revision: https://reviews.llvm.org/D133520
2022-08-22[clang] adds unary type transformations as compiler built-insChristopher Di Bella1-2/+7
Adds * `__add_lvalue_reference` * `__add_pointer` * `__add_rvalue_reference` * `__decay` * `__make_signed` * `__make_unsigned` * `__remove_all_extents` * `__remove_extent` * `__remove_const` * `__remove_volatile` * `__remove_cv` * `__remove_pointer` * `__remove_reference` * `__remove_cvref` These are all compiler built-in equivalents of the unary type traits found in [[meta.trans]][1]. The compiler already has all of the information it needs to answer these transformations, so we can skip needing to make partial specialisations in standard library implementations (we already do this for a lot of the query traits). This will hopefully improve compile times, as we won't need use as much memory in such a base part of the standard library. [1]: http://wg21.link/meta.trans Co-authored-by: zoecarver Reviewed By: aaron.ballman, rsmith Differential Revision: https://reviews.llvm.org/D116203
2022-08-14Revert "[clang] adds unary type transformations as compiler built-ins"Nico Weber1-7/+2
This reverts commit bc60cf2368de90918719dc7e3d7c63a72cc007ad. Doesn't build on Windows and breaks gcc 9 build, see https://reviews.llvm.org/D116203#3722094 and https://reviews.llvm.org/D116203#3722128 Also revert two follow-ups. One fixed a warning added in bc60cf2368de90918719dc7e3d7c63a72cc007ad, the other makes use of the feature added in bc60cf2368de90918719dc7e3d7c63a72cc007ad in libc++: Revert "[libcxx][NFC] utilises compiler builtins for unary transform type-traits" This reverts commit 06a1d917ef1f507aaa2f6891bb654696c866ea3a. Revert "[Sema] Fix a warning" This reverts commit c85abbe879ef3257de4db862ce249b060cc3d2a4.
2022-08-14[clang] adds unary type transformations as compiler built-insChristopher Di Bella1-2/+7
Adds * `__add_lvalue_reference` * `__add_pointer` * `__add_rvalue_reference` * `__decay` * `__make_signed` * `__make_unsigned` * `__remove_all_extents` * `__remove_extent` * `__remove_const` * `__remove_volatile` * `__remove_cv` * `__remove_pointer` * `__remove_reference` * `__remove_cvref` These are all compiler built-in equivalents of the unary type traits found in [[meta.trans]][1]. The compiler already has all of the information it needs to answer these transformations, so we can skip needing to make partial specialisations in standard library implementations (we already do this for a lot of the query traits). This will hopefully improve compile times, as we won't need use as much memory in such a base part of the standard library. [1]: http://wg21.link/meta.trans Co-authored-by: zoecarver Reviewed By: aaron.ballman, rsmith Differential Revision: https://reviews.llvm.org/D116203
2022-01-26Revert "Rename llvm::array_lengthof into llvm::size to match std::size from ↵Benjamin Kramer1-2/+2
C++17" This reverts commit ef8206320769ad31422a803a0d6de6077fd231d2. - It conflicts with the existing llvm::size in STLExtras, which will now never be called. - Calling it without llvm:: breaks C++17 compat
2022-01-26Rename llvm::array_lengthof into llvm::size to match std::size from C++17serge-sans-paille1-2/+2
As a conquence move llvm::array_lengthof from STLExtras.h to STLForwardCompat.h (which is included by STLExtras.h so no build breakage expected).
2021-12-06Introduce _BitInt, deprecate _ExtIntAaron Ballman1-6/+6
WG14 adopted the _ExtInt feature from Clang for C23, but renamed the type to be _BitInt. This patch does the vast majority of the work to rename _ExtInt to _BitInt, which accounts for most of its size. The new type is exposed in older C modes and all C++ modes as a conforming extension. However, there are functional changes worth calling out: * Deprecates _ExtInt with a fix-it to help users migrate to _BitInt. * Updates the mangling for the type. * Updates the documentation and adds a release note to warn users what is going on. * Adds new diagnostics for use of _BitInt to call out when it's used as a Clang extension or as a pre-C23 compatibility concern. * Adds new tests for the new diagnostic behaviors. I want to call out the ABI break specifically. We do not believe that this break will cause a significant imposition for early adopters of the feature, and so this is being done as a full break. If it turns out there are critical uses where recompilation is not an option for some reason, we can consider using ABI tags to ease the transition.
2021-10-09[Clang] Enable _Complex __ibm128 typeQiu Chaofan1-1/+2
fae0dfa implemented the new __ibm128 type, this patch enables its complex form. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D109948
2021-10-04[PowerPC] Disable vector types when not supported by subtarget featuresLei Huang1-8/+14
Update clang to treat vector unsigned long long and friends as invalid for AltiVec without VSX. Reported in: https://bugs.llvm.org/show_bug.cgi?id=47782 Reviewed By: nemanjai, amyk Differential Revision: https://reviews.llvm.org/D109178
2021-09-06[Clang] Add __ibm128 type to represent ppc_fp128Qiu Chaofan1-0/+2
Currently, we have no front-end type for ppc_fp128 type in IR. PowerPC target generates ppc_fp128 type from long double now, but there's option (-mabi=(ieee|ibm)longdouble) to control it and we're going to do transition from IBM extended double-double ppc_fp128 to IEEE fp128 in the future. This patch adds type __ibm128 which always represents ppc_fp128 in IR, as what GCC did for that type. Without this type in Clang, compilation will fail if compiling against future version of libstdcxx (which uses __ibm128 in headers). Although all operations in backend for __ibm128 is done by software, only PowerPC enables support for it. There's something not implemented in this commit, which can be done in future ones: - Literal suffix for __ibm128 type. w/W is suitable as GCC documented. - __attribute__((mode(IF))) should be for __ibm128. - Complex __ibm128 type. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D93377
2021-08-31[OpenCL] Defines helper function for kernel language compatible OpenCL versionJustas Janickas1-2/+1
This change defines a helper function getOpenCLCompatibleVersion() inside LangOptions class. The function contains mapping between C++ for OpenCL versions and their corresponding compatible OpenCL versions. This mapping function should be updated each time a new C++ for OpenCL language version is introduced. The helper function is expected to simplify conditions on OpenCL C and C++ for OpenCL versions inside compiler code. Code refactoring performed. Differential Revision: https://reviews.llvm.org/D108693
2021-08-18[CFE][X86] Enable complex _Float16 supportWang, Pengfei1-2/+2
Support complex _Float16 on X86 in C/C++ following the latest X86 psABI. (https://gitlab.com/x86-psABIs) Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D105331
2021-05-31Re-commit [clang] Add support for the "abstract" contextual keyword of MSVCAbbas Sabra1-0/+2
https://docs.microsoft.com/en-us/cpp/extensions/abstract-cpp-component-extensions?view=msvc-160 Note: like the already supported "sealed" keyword, the "abstract" keyword is supported by MSVC by default. This re-commits 818338add77411f5e9713247ea66142f332ef350 with added initialization of Parser::Ident_abstract. Differential revision: https://reviews.llvm.org/D102517
2021-05-31Revert "[clang] Add support for the "abstract" contextual keyword of MSVC"Mikhail Goncharov1-2/+0
This reverts commit 818338add77411f5e9713247ea66142f332ef350. Tests fail under sanitizer: https://lab.llvm.org/buildbot/#/builders/5/builds/8150
2021-05-31[clang] Add support for the "abstract" contextual keyword of MSVCAbbas Sabra1-0/+2
https://docs.microsoft.com/en-us/cpp/extensions/abstract-cpp-component-extensions?view=msvc-160 Note: like the already supported "sealed" keyword, the "abstract" keyword is supported by MSVC by default. Differential revision: https://reviews.llvm.org/D102517
2021-03-12[OpenCL] Refactor diagnostic for OpenCL extension/featureAnton Zabaznov1-1/+2
There is no need to check for enabled pragma for core or optional core features, thus this check is removed Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D97058
2021-01-14[clang] Use SourceLocations in unions [NFCI]Mikhail Maltsev1-9/+11
Currently, there are many instances where `SourceLocation` objects are converted to raw representation to be stored in structs that are used as fields of tagged unions. This is done to make the corresponding structs trivial. Triviality allows avoiding undefined behavior when implicitly changing the active member of the union. However, in most cases, we can explicitly construct an active member using placement new. This patch adds the required active member selections and replaces `SourceLocation`-s represented as `unsigned int` with proper `SourceLocation`-s. One notable exception is `DeclarationNameLoc`: the objects of this class are often not properly initialized (so the code currently relies on its default constructor which uses memset). This class will be fixed in a separate patch. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D94237
2020-11-16Convert ConstexprKind from Specifiers.h to a scoped enum; NFCThorsten1-9/+13
2020-11-16Adding some explicit casts to appease build bots; NFCAaron Ballman1-2/+2
2020-11-16Convert TypeSpecifierSign from Specifiers.h to a scoped enum; NFCThorsten1-20/+22
2020-11-16Convert TypeSpecifiersPipe from Specifiers.h to a scoped enum; NFCThorsten1-1/+1
2020-11-15[NFC, Refactor] Modernize the TypeSpecifierWidth enum (Specifiers.h) to a ↵faisalv1-31/+39
scoped enum Reviewed here: https://reviews.llvm.org/D91409 by Aaron. Highlights of the review: - avoid an underlying type for enums - avoid enum bit fields (MSVC packing anomalies) and favor static_casts to unsigned bit-fields Patch by Thorsten Schuett <schuett@gmail.com> w some minor fixes in SemaType.cpp where a couple asserts had to be repaired to deal with lack of implicit coversion to int. Thanks Thorsten!
2020-11-10[NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to ↵Faisal Vali1-1/+1
remove duplication Since these are scoped enumerators, they have to be prefixed by DeclaratorContext, so lets remove Context from the name, and return some characters to the multiverse. Patch was reviewed here: https://reviews.llvm.org/D91011 Thank you to aaron, bruno, wyatt and barry for indulging me.
2020-10-28Better source location for -Wignored-qualifiers on trailing return typesAaron Puchert1-0/+3
We collect the source location of a trailing return type in the parser, improving the location for regular functions and providing a location for lambdas, where previously there was none. Fixes PR47732. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D90129
2020-10-18[PowerPC][AIX] Make `__vector [un]signed long` an errorHubert Tong1-1/+7
The semantics associated with `__vector [un]signed long` are neither consistently specified nor consistently implemented. The IBM XL compilers on AIX traditionally treated these as deprecated aliases for the corresponding `__vector int` type in both 32-bit and 64-bit modes. The newer, Clang-based, IBM XL compilers on AIX make usage of the previously deprecated types an error. This is also consistent with IBM XL C/C++ for Linux on Power (on little endian distributions). In line with the above, this patch upgrades (on AIX) the deprecation of `__vector long` to become removal. Reviewed By: ZarkoCA Differential Revision: https://reviews.llvm.org/D89443
2020-08-20[clang]: Remove assertion which checks explicit declarationGousemoodhin Nadaf1-3/+0
explicit keyword is declared outside of class is invalid, invalid explicit declaration is handled inside DiagnoseFunctionSpecifiers() function. To avoid compiler crash in case of invalid explicit declaration, remove assertion. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D83929
2020-07-22For PR46800, implement the GCC __builtin_complex builtin.Richard Smith1-0/+1
glibc's implementation of the CMPLX macro uses it (with -fgnuc-version set to 4.7 or later).
2020-06-23[PowerPC] Add support for vector bool __int128 for Power10Ahsan Saghir1-4/+10
Summary: This patch adds support for `vector bool __int128` type for Power10. Reviewers: #powerpc, hfinkel, lei, stefanp, amyk Reviewed By: #powerpc, lei, amyk Subscribers: lei, amyk, wuzish, nemanjai, shchenz, cfe-commits Tags: #llvm, #powerpc, #clang Differential Revision: https://reviews.llvm.org/D81816
2020-06-05[ARM] Add __bf16 as new Bfloat16 C TypeTies Stuij1-0/+2
Summary: This patch upstreams support for a new storage only bfloat16 C type. This type is used to implement primitive support for bfloat16 data, in line with the Bfloat16 extension of the Armv8.6-a architecture, as detailed here: https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a The bfloat type, and its properties are specified in the Arm Architecture Reference Manual: https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile In detail this patch: - introduces an opaque, storage-only C-type __bf16, which introduces a new bfloat IR type. This is part of a patch series, starting with command-line and Bfloat16 assembly support. The subsequent patches will upstream intrinsics support for BFloat16, followed by Matrix Multiplication and the remaining Virtualization features of the armv8.6-a architecture. The following people contributed to this patch: - Luke Cheeseman - Momchil Velikov - Alexandros Lamprineas - Luke Geeson - Simon Tatham - Ties Stuij Reviewers: SjoerdMeijer, rjmccall, rsmith, liutianle, RKSimon, craig.topper, jfb, LukeGeeson, fpetrogalli Reviewed By: SjoerdMeijer Subscribers: labrinea, majnemer, asmith, dexonsmith, kristof.beyls, arphaman, danielkiss, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D76077