Skip to content

Commit eb21803

Browse files
committed
Updates and cleanup.
1 parent 5a17166 commit eb21803

19 files changed

+164
-159
lines changed

clang/include/clang/Basic/AArch64ACLETypes.def

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file defines various SVE builtin types. The macros are:
9+
// This file defines various Neon and SVE builtin types. The macros are:
10+
//
11+
// NEON_VECTOR_TYPE:
12+
// - (Name, BaseType, ElBits, NumEls, VectorKind)
13+
// Unlike the SVE types, the Neon vector types are not builtin types and
14+
// mapped to the equivalent __attribute__(neon_vector_type(...)) vector type.
15+
// They are not builtin types.
1016
//
1117
// SVE_TYPE:
1218
// - (Name, MangledName, Id, SingletonId)
@@ -57,6 +63,10 @@
5763
// - IsBF true for vector of brain float elements.
5864
//===----------------------------------------------------------------------===//
5965

66+
#ifndef NEON_VECTOR_TYPE
67+
#define NEON_VECTOR_TYPE(Name, BaseType, ElBits, NumEls, VectorKind)
68+
#endif
69+
6070
#ifndef SVE_TYPE
6171
#define SVE_TYPE(Name, Id, SingletonId)
6272
#endif
@@ -111,7 +121,38 @@
111121
SVE_TYPE(Name, Id, SingletonId)
112122
#endif
113123

114-
//===- Vector point types -----------------------------------------------===//
124+
//===- Neon Vector point types --------------------------------------------===//
125+
126+
NEON_VECTOR_TYPE(__Int8x8_t, CharTy, 8, 8, VectorKind::Neon)
127+
NEON_VECTOR_TYPE(__Int16x4_t, ShortTy, 16, 4, VectorKind::Neon)
128+
NEON_VECTOR_TYPE(__Int32x2_t, IntTy, 32, 2, VectorKind::Neon)
129+
NEON_VECTOR_TYPE(__Uint8x8_t, CharTy, 8, 8, VectorKind::Neon)
130+
NEON_VECTOR_TYPE(__Uint16x4_t, UnsignedShortTy, 16, 4, VectorKind::Neon)
131+
NEON_VECTOR_TYPE(__Uint32x2_t, UnsignedIntTy, 32, 2, VectorKind::Neon)
132+
NEON_VECTOR_TYPE(__Float16x4_t, Float16Ty, 16, 4, VectorKind::Neon)
133+
NEON_VECTOR_TYPE(__Float32x2_t, FloatTy, 32, 2, VectorKind::Neon)
134+
NEON_VECTOR_TYPE(__Poly8x8_t, CharTy, 8, 8, VectorKind::NeonPoly)
135+
NEON_VECTOR_TYPE(__Poly16x4_t, UnsignedShortTy, 16, 4, VectorKind::NeonPoly)
136+
NEON_VECTOR_TYPE(__Bfloat16x4_t, BFloat16Ty, 16, 4, VectorKind::Neon)
137+
NEON_VECTOR_TYPE(__Int8x16_t, CharTy, 8, 16, VectorKind::Neon)
138+
NEON_VECTOR_TYPE(__Int16x8_t, ShortTy, 16, 8, VectorKind::Neon)
139+
NEON_VECTOR_TYPE(__Int32x4_t, IntTy, 32, 4, VectorKind::Neon)
140+
NEON_VECTOR_TYPE(__Int64x2_t, LongLongTy, 64, 2, VectorKind::Neon)
141+
NEON_VECTOR_TYPE(__Uint8x16_t, CharTy, 8, 16, VectorKind::Neon)
142+
NEON_VECTOR_TYPE(__Uint16x8_t, UnsignedShortTy, 16, 8, VectorKind::Neon)
143+
NEON_VECTOR_TYPE(__Uint32x4_t, UnsignedIntTy, 32, 4, VectorKind::Neon)
144+
NEON_VECTOR_TYPE(__Uint64x2_t, UnsignedLongLongTy, 64, 2, VectorKind::Neon)
145+
NEON_VECTOR_TYPE(__Float16x8_t, Float16Ty, 16, 8, VectorKind::Neon)
146+
NEON_VECTOR_TYPE(__Float32x4_t, FloatTy, 32, 4, VectorKind::Neon)
147+
NEON_VECTOR_TYPE(__Float64x2_t, DoubleTy, 64, 2, VectorKind::Neon)
148+
NEON_VECTOR_TYPE(__Poly8x16_t, CharTy, 8, 16, VectorKind::NeonPoly)
149+
NEON_VECTOR_TYPE(__Poly16x8_t, UnsignedShortTy, 16, 8, VectorKind::NeonPoly)
150+
NEON_VECTOR_TYPE(__Poly64x2_t, UnsignedLongLongTy, 64, 2, VectorKind::NeonPoly)
151+
NEON_VECTOR_TYPE(__Bfloat16x8_t, BFloat16Ty, 16, 8, VectorKind::Neon)
152+
NEON_VECTOR_TYPE(__Mfloat8x8_t, MFloat8Ty, 8, 8, VectorKind::Neon)
153+
NEON_VECTOR_TYPE(__Mfloat8x16_t, MFloat8Ty, 8, 16, VectorKind::Neon)
154+
155+
//===- SVE Vector point types ---------------------------------------------===//
115156

116157
SVE_VECTOR_TYPE_INT(__SVInt8_t, __SVInt8_t, SveInt8, SveInt8Ty, 16, 8, 1, true)
117158
SVE_VECTOR_TYPE_INT(__SVInt16_t, __SVInt16_t, SveInt16, SveInt16Ty, 8, 16, 1, true)
@@ -205,41 +246,6 @@ SVE_OPAQUE_TYPE(__SVCount_t, __SVCount_t, SveCount, SveCountTy)
205246

206247
SVE_SCALAR_TYPE(__mfp8, __mfp8, MFloat8, MFloat8Ty, 8)
207248

208-
// Unlike the SVE types above, the Neon vector types are parsed as keywords and
209-
// mapped to the equivalent __attribute__(neon_vector_type(...)) vector type.
210-
// They are not builtin types.
211-
#ifndef NEON_VECTOR_TYPE
212-
#define NEON_VECTOR_TYPE(Name, BaseType, ElBits, NumEls, VectorKind)
213-
#endif
214-
NEON_VECTOR_TYPE(__Int8x8_t, CharTy, 8, 8, VectorKind::Neon)
215-
NEON_VECTOR_TYPE(__Int16x4_t, ShortTy, 16, 4, VectorKind::Neon)
216-
NEON_VECTOR_TYPE(__Int32x2_t, IntTy, 32, 2, VectorKind::Neon)
217-
NEON_VECTOR_TYPE(__Uint8x8_t, CharTy, 8, 8, VectorKind::Neon)
218-
NEON_VECTOR_TYPE(__Uint16x4_t, UnsignedShortTy, 16, 4, VectorKind::Neon)
219-
NEON_VECTOR_TYPE(__Uint32x2_t, UnsignedIntTy, 32, 2, VectorKind::Neon)
220-
NEON_VECTOR_TYPE(__Float16x4_t, Float16Ty, 16, 4, VectorKind::Neon)
221-
NEON_VECTOR_TYPE(__Float32x2_t, FloatTy, 32, 2, VectorKind::Neon)
222-
NEON_VECTOR_TYPE(__Poly8x8_t, CharTy, 8, 8, VectorKind::NeonPoly)
223-
NEON_VECTOR_TYPE(__Poly16x4_t, UnsignedShortTy, 16, 4, VectorKind::NeonPoly)
224-
NEON_VECTOR_TYPE(__Bfloat16x4_t, BFloat16Ty, 16, 4, VectorKind::Neon)
225-
NEON_VECTOR_TYPE(__Int8x16_t, CharTy, 8, 16, VectorKind::Neon)
226-
NEON_VECTOR_TYPE(__Int16x8_t, ShortTy, 16, 8, VectorKind::Neon)
227-
NEON_VECTOR_TYPE(__Int32x4_t, IntTy, 32, 4, VectorKind::Neon)
228-
NEON_VECTOR_TYPE(__Int64x2_t, LongLongTy, 64, 2, VectorKind::Neon)
229-
NEON_VECTOR_TYPE(__Uint8x16_t, CharTy, 8, 16, VectorKind::Neon)
230-
NEON_VECTOR_TYPE(__Uint16x8_t, UnsignedShortTy, 16, 8, VectorKind::Neon)
231-
NEON_VECTOR_TYPE(__Uint32x4_t, UnsignedIntTy, 32, 4, VectorKind::Neon)
232-
NEON_VECTOR_TYPE(__Uint64x2_t, UnsignedLongLongTy, 64, 2, VectorKind::Neon)
233-
NEON_VECTOR_TYPE(__Float16x8_t, Float16Ty, 16, 8, VectorKind::Neon)
234-
NEON_VECTOR_TYPE(__Float32x4_t, FloatTy, 32, 4, VectorKind::Neon)
235-
NEON_VECTOR_TYPE(__Float64x2_t, DoubleTy, 64, 2, VectorKind::Neon)
236-
NEON_VECTOR_TYPE(__Poly8x16_t, CharTy, 8, 16, VectorKind::NeonPoly)
237-
NEON_VECTOR_TYPE(__Poly16x8_t, UnsignedShortTy, 16, 8, VectorKind::NeonPoly)
238-
NEON_VECTOR_TYPE(__Poly64x2_t, UnsignedLongLongTy, 64, 2, VectorKind::NeonPoly)
239-
NEON_VECTOR_TYPE(__Bfloat16x8_t, BFloat16Ty, 16, 8, VectorKind::Neon)
240-
NEON_VECTOR_TYPE(__Mfloat8x8_t, MFloat8Ty, 8, 8, VectorKind::Neon)
241-
NEON_VECTOR_TYPE(__Mfloat8x16_t, MFloat8Ty, 16, 8, VectorKind::Neon)
242-
243249
#undef NEON_VECTOR_TYPE
244250
#undef SVE_VECTOR_TYPE
245251
#undef SVE_VECTOR_TYPE_MFLOAT

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ COMPATIBLE_VALUE_LANGOPT(FunctionAlignment, 5, 0, "Default alignment for functio
463463
COMPATIBLE_VALUE_LANGOPT(LoopAlignment, 32, 0, "Default alignment for loops")
464464

465465
LANGOPT(FixedPoint, 1, 0, "fixed point types")
466-
LANGOPT(ACLE, 1, 0, "Arm C Language Extensions")
467466
LANGOPT(PaddingOnUnsignedFixedPoint, 1, 0,
468467
"unsigned fixed point types having one extra padding bit")
469468

clang/include/clang/Basic/Specifiers.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ namespace clang {
9898
#define GENERIC_IMAGE_TYPE(ImgType, Id) \
9999
TST_##ImgType##_t, // OpenCL image types
100100
#include "clang/Basic/OpenCLImageTypes.def"
101-
102-
#define NEON_VECTOR_TYPE(Name, BaseType, ElBits, NumEls, VectorKind) \
103-
TST_##Name,
104-
#define SVE_TYPE(Name, Id, SingletonId)
105-
#include "clang/Basic/AArch64SVEACLETypes.def"
106-
107101
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \
108102
TST_##Name, // HLSL Intangible Types
109103
#include "clang/Basic/HLSLIntangibleTypes.def"

clang/include/clang/Basic/TargetInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class TargetInfo : public TransferrableTargetInfo,
270270
unsigned HasBuiltinMSVaList : 1;
271271

272272
LLVM_PREFERRED_TYPE(bool)
273-
unsigned HasAArch64SVETypes : 1;
273+
unsigned HasAArch64ACLETypes : 1;
274274

275275
LLVM_PREFERRED_TYPE(bool)
276276
unsigned HasRISCVVTypes : 1;
@@ -1055,9 +1055,9 @@ class TargetInfo : public TransferrableTargetInfo,
10551055
/// available on this target.
10561056
bool hasBuiltinMSVaList() const { return HasBuiltinMSVaList; }
10571057

1058-
/// Returns whether or not the AArch64 SVE built-in types are
1058+
/// Returns whether or not the AArch64 ACLE built-in types are
10591059
/// available on this target.
1060-
bool hasAArch64SVETypes() const { return HasAArch64SVETypes; }
1060+
bool hasAArch64ACLETypes() const { return HasAArch64ACLETypes; }
10611061

10621062
/// Returns whether or not the RISC-V V built-in types are
10631063
/// available on this target.

clang/include/clang/Basic/TokenKinds.def

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,6 @@ KEYWORD(__bool , KEYALTIVEC|KEYZVECTOR)
687687
ALIAS("__fp16", half , KEYALL)
688688
KEYWORD(__bf16 , KEYALL)
689689

690-
// ARM NEON types
691-
#define NEON_VECTOR_TYPE(Name, BaseType, ElBits, NumEls, VectorKind) \
692-
KEYWORD(Name, KEYACLE)
693-
#define SVE_TYPE(Name, Id, SingletonId)
694-
#include "clang/Basic/AArch64SVEACLETypes.def"
695-
696690
// OpenCL Extension.
697691
KEYWORD(half , HALFSUPPORT)
698692

clang/include/clang/Sema/DeclSpec.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,6 @@ class DeclSpec {
321321
#define GENERIC_IMAGE_TYPE(ImgType, Id) \
322322
static const TST TST_##ImgType##_t = clang::TST_##ImgType##_t;
323323
#include "clang/Basic/OpenCLImageTypes.def"
324-
325-
#define NEON_VECTOR_TYPE(Name, BaseType, ElBits, NumEls, VectorKind) \
326-
static const TST TST_##Name = clang::TST_##Name;
327-
#define SVE_TYPE(Name, Id, SingletonId)
328-
#include "clang/Basic/AArch64SVEACLETypes.def"
329-
330324
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \
331325
static const TST TST_##Name = clang::TST_##Name;
332326
#include "clang/Basic/HLSLIntangibleTypes.def"

clang/lib/AST/ASTContext.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,21 +1448,13 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
14481448
#include "clang/Basic/HLSLIntangibleTypes.def"
14491449
}
14501450

1451-
if (Target.hasAArch64SVETypes() ||
1452-
(AuxTarget && AuxTarget->hasAArch64SVETypes())) {
1453-
#define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
1454-
InitBuiltinType(SingletonId, BuiltinType::Id);
1455-
#define SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId) \
1456-
InitBuiltinType(SingletonId, BuiltinType::Id);
1457-
#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) \
1451+
if (Target.hasAArch64ACLETypes() ||
1452+
(AuxTarget && AuxTarget->hasAArch64ACLETypes())) {
1453+
#define SVE_TYPE(Name, Id, SingletonId) \
14581454
InitBuiltinType(SingletonId, BuiltinType::Id);
1459-
#define SVE_TYPE(Name, MangledName, SingletonId)
1460-
#include "clang/Basic/AArch64SVEACLETypes.def"
1455+
#include "clang/Basic/AArch64ACLETypes.def"
14611456
}
14621457

1463-
if (LangOpts.ACLE)
1464-
InitBuiltinType(MFloat8Ty, BuiltinType::MFloat8);
1465-
14661458
if (Target.getTriple().isPPC64()) {
14671459
#define PPC_VECTOR_MMA_TYPE(Name, Id, Size) \
14681460
InitBuiltinType(Id##Ty, BuiltinType::Id);
@@ -4538,7 +4530,7 @@ QualType ASTContext::getWebAssemblyExternrefType() const {
45384530
/// type.
45394531
QualType ASTContext::getScalableVectorType(QualType EltTy, unsigned NumElts,
45404532
unsigned NumFields) const {
4541-
if (Target->hasAArch64SVETypes()) {
4533+
if (Target->hasAArch64ACLETypes()) {
45424534
uint64_t EltTySize = getTypeSize(EltTy);
45434535

45444536
#define SVE_VECTOR_TYPE_INT(Name, MangledName, Id, SingletonId, NumEls, \

clang/lib/Basic/IdentifierTable.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ enum TokenKey : unsigned {
111111
KEYNOZOS = 0x4000000,
112112
KEYHLSL = 0x8000000,
113113
KEYFIXEDPOINT = 0x10000000,
114-
KEYACLE = 0x20000000, // Enable Arm Neon vector type keywords
115-
KEYMAX = KEYACLE, // The maximum key
114+
KEYMAX = KEYFIXEDPOINT, // The maximum key
116115
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
117116
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
118117
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
@@ -217,8 +216,6 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
217216
return KS_Unknown;
218217
case KEYFIXEDPOINT:
219218
return LangOpts.FixedPoint ? KS_Enabled : KS_Disabled;
220-
case KEYACLE:
221-
return LangOpts.ACLE ? KS_Enabled : KS_Disabled;
222219
default:
223220
llvm_unreachable("Unknown KeywordStatus flag");
224221
}

clang/lib/Basic/LangOptions.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang,
203203
Opts.setDefaultFPContractMode(LangOptions::FPM_Fast);
204204
}
205205

206-
if (T.isARM() || T.isAArch64())
207-
Opts.ACLE = true;
208-
209206
// OpenCL, C++ and C23 have bool, true, false keywords.
210207
Opts.Bool = Opts.OpenCL || Opts.CPlusPlus || Opts.C23;
211208

clang/lib/Basic/TargetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : Triple(T) {
157157
SSERegParmMax = 0;
158158
HasAlignMac68kSupport = false;
159159
HasBuiltinMSVaList = false;
160-
HasAArch64SVETypes = false;
160+
HasAArch64ACLETypes = false;
161161
HasRISCVVTypes = false;
162162
AllowAMDGPUUnsafeFPAtomics = false;
163163
HasUnalignedAccess = false;

0 commit comments

Comments
 (0)