blob: b51047f89db8635867636fbba92beb3a0a4b998a [file] [log] [blame]
Sander de Smalen5087ace2020-03-15 14:29:45 +00001//===- SveEmitter.cpp - Generate arm_sve.h for use with clang -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This tablegen backend is responsible for emitting arm_sve.h, which includes
10// a declaration and definition of each function specified by the ARM C/C++
11// Language Extensions (ACLE).
12//
13// For details, visit:
14// https://developer.arm.com/architectures/system-architectures/software-standards/acle
15//
16// Each SVE instruction is implemented in terms of 1 or more functions which
17// are suffixed with the element type of the input vectors. Functions may be
18// implemented in terms of generic vector operations such as +, *, -, etc. or
19// by calling a __builtin_-prefixed function which will be handled by clang's
20// CodeGen library.
21//
22// See also the documentation in include/clang/Basic/arm_sve.td.
23//
24//===----------------------------------------------------------------------===//
25
26#include "llvm/ADT/STLExtras.h"
Sander de Smalenc5b81462020-03-18 11:07:20 +000027#include "llvm/ADT/StringMap.h"
Sander de Smalen5087ace2020-03-15 14:29:45 +000028#include "llvm/ADT/ArrayRef.h"
29#include "llvm/ADT/StringExtras.h"
30#include "llvm/TableGen/Record.h"
31#include "llvm/TableGen/Error.h"
32#include <string>
33#include <sstream>
34#include <set>
35#include <cctype>
Eric Fiselieraf2968e2020-04-16 18:35:31 -040036#include <tuple>
Sander de Smalen5087ace2020-03-15 14:29:45 +000037
38using namespace llvm;
39
Sander de Smalenc5b81462020-03-18 11:07:20 +000040enum ClassKind {
41 ClassNone,
42 ClassS, // signed/unsigned, e.g., "_s8", "_u8" suffix
43 ClassG, // Overloaded name without type suffix
44};
45
46using TypeSpec = std::string;
Sander de Smalen5087ace2020-03-15 14:29:45 +000047
48namespace {
49
Sander de Smalenc8a5b302020-04-14 15:56:36 +010050class ImmCheck {
51 unsigned Arg;
52 unsigned Kind;
53 unsigned ElementSizeInBits;
54
55public:
56 ImmCheck(unsigned Arg, unsigned Kind, unsigned ElementSizeInBits = 0)
57 : Arg(Arg), Kind(Kind), ElementSizeInBits(ElementSizeInBits) {}
58 ImmCheck(const ImmCheck &Other) = default;
59 ~ImmCheck() = default;
60
61 unsigned getArg() const { return Arg; }
62 unsigned getKind() const { return Kind; }
63 unsigned getElementSizeInBits() const { return ElementSizeInBits; }
64};
65
Sander de Smalenc5b81462020-03-18 11:07:20 +000066class SVEType {
67 TypeSpec TS;
68 bool Float, Signed, Immediate, Void, Constant, Pointer;
69 bool DefaultType, IsScalable, Predicate, PredicatePattern, PrefetchOp;
70 unsigned Bitwidth, ElementBitwidth, NumVectors;
71
Sander de Smalen8b409ea2020-03-16 10:14:05 +000072public:
Sander de Smalenc5b81462020-03-18 11:07:20 +000073 SVEType() : SVEType(TypeSpec(), 'v') {}
74
75 SVEType(TypeSpec TS, char CharMod)
76 : TS(TS), Float(false), Signed(true), Immediate(false), Void(false),
77 Constant(false), Pointer(false), DefaultType(false), IsScalable(true),
78 Predicate(false), PredicatePattern(false), PrefetchOp(false),
79 Bitwidth(128), ElementBitwidth(~0U), NumVectors(1) {
80 if (!TS.empty())
81 applyTypespec();
82 applyModifier(CharMod);
83 }
84
Sander de Smalenc5b81462020-03-18 11:07:20 +000085 bool isPointer() const { return Pointer; }
86 bool isVoidPointer() const { return Pointer && Void; }
87 bool isSigned() const { return Signed; }
88 bool isImmediate() const { return Immediate; }
89 bool isScalar() const { return NumVectors == 0; }
90 bool isVector() const { return NumVectors > 0; }
91 bool isScalableVector() const { return isVector() && IsScalable; }
92 bool isChar() const { return ElementBitwidth == 8; }
93 bool isVoid() const { return Void & !Pointer; }
94 bool isDefault() const { return DefaultType; }
95 bool isFloat() const { return Float; }
96 bool isInteger() const { return !Float && !Predicate; }
97 bool isScalarPredicate() const { return !Float && ElementBitwidth == 1; }
98 bool isPredicateVector() const { return Predicate; }
99 bool isPredicatePattern() const { return PredicatePattern; }
100 bool isPrefetchOp() const { return PrefetchOp; }
101 bool isConstant() const { return Constant; }
102 unsigned getElementSizeInBits() const { return ElementBitwidth; }
103 unsigned getNumVectors() const { return NumVectors; }
104
105 unsigned getNumElements() const {
106 assert(ElementBitwidth != ~0U);
107 return Bitwidth / ElementBitwidth;
108 }
109 unsigned getSizeInBits() const {
110 return Bitwidth;
111 }
112
113 /// Return the string representation of a type, which is an encoded
114 /// string for passing to the BUILTIN() macro in Builtins.def.
115 std::string builtin_str() const;
116
Sander de Smalen981f0802020-03-18 15:05:08 +0000117 /// Return the C/C++ string representation of a type for use in the
118 /// arm_sve.h header file.
119 std::string str() const;
120
Sander de Smalenc5b81462020-03-18 11:07:20 +0000121private:
122 /// Creates the type based on the typespec string in TS.
123 void applyTypespec();
124
125 /// Applies a prototype modifier to the type.
126 void applyModifier(char Mod);
127};
128
129
130class SVEEmitter;
131
132/// The main grunt class. This represents an instantiation of an intrinsic with
133/// a particular typespec and prototype.
134class Intrinsic {
135 /// The unmangled name.
136 std::string Name;
137
138 /// The name of the corresponding LLVM IR intrinsic.
139 std::string LLVMName;
140
141 /// Intrinsic prototype.
142 std::string Proto;
143
144 /// The base type spec for this intrinsic.
145 TypeSpec BaseTypeSpec;
146
147 /// The base class kind. Most intrinsics use ClassS, which has full type
148 /// info for integers (_s32/_u32), or ClassG which is used for overloaded
149 /// intrinsics.
150 ClassKind Class;
151
152 /// The architectural #ifdef guard.
153 std::string Guard;
154
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100155 // The merge suffix such as _m, _x or _z.
156 std::string MergeSuffix;
157
Sander de Smalenc5b81462020-03-18 11:07:20 +0000158 /// The types of return value [0] and parameters [1..].
159 std::vector<SVEType> Types;
160
161 /// The "base type", which is VarType('d', BaseTypeSpec).
162 SVEType BaseType;
163
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100164 uint64_t Flags;
Sander de Smalenc5b81462020-03-18 11:07:20 +0000165
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100166 SmallVector<ImmCheck, 2> ImmChecks;
167
Sander de Smalenc5b81462020-03-18 11:07:20 +0000168public:
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100169 Intrinsic(StringRef Name, StringRef Proto, uint64_t MergeTy,
170 StringRef MergeSuffix, uint64_t MemoryElementTy, StringRef LLVMName,
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100171 uint64_t Flags, ArrayRef<ImmCheck> ImmChecks, TypeSpec BT,
172 ClassKind Class, SVEEmitter &Emitter, StringRef Guard);
Sander de Smalenc5b81462020-03-18 11:07:20 +0000173
174 ~Intrinsic()=default;
175
176 std::string getName() const { return Name; }
177 std::string getLLVMName() const { return LLVMName; }
178 std::string getProto() const { return Proto; }
179 TypeSpec getBaseTypeSpec() const { return BaseTypeSpec; }
180 SVEType getBaseType() const { return BaseType; }
181
182 StringRef getGuard() const { return Guard; }
183 ClassKind getClassKind() const { return Class; }
Sander de Smalenc5b81462020-03-18 11:07:20 +0000184
185 SVEType getReturnType() const { return Types[0]; }
186 ArrayRef<SVEType> getTypes() const { return Types; }
187 SVEType getParamType(unsigned I) const { return Types[I + 1]; }
188 unsigned getNumParams() const { return Proto.size() - 1; }
189
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100190 uint64_t getFlags() const { return Flags; }
Sander de Smalenc5b81462020-03-18 11:07:20 +0000191 bool isFlagSet(uint64_t Flag) const { return Flags & Flag;}
192
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100193 ArrayRef<ImmCheck> getImmChecks() const { return ImmChecks; }
194
Sander de Smalenc5b81462020-03-18 11:07:20 +0000195 /// Return the type string for a BUILTIN() macro in Builtins.def.
196 std::string getBuiltinTypeStr();
197
198 /// Return the name, mangled with type information. The name is mangled for
199 /// ClassS, so will add type suffixes such as _u32/_s32.
200 std::string getMangledName() const { return mangleName(ClassS); }
201
202 /// Returns true if the intrinsic is overloaded, in that it should also generate
203 /// a short form without the type-specifiers, e.g. 'svld1(..)' instead of
204 /// 'svld1_u32(..)'.
205 static bool isOverloadedIntrinsic(StringRef Name) {
206 auto BrOpen = Name.find("[");
207 auto BrClose = Name.find(']');
208 return BrOpen != std::string::npos && BrClose != std::string::npos;
209 }
210
Sander de Smalen41d52662020-04-22 13:58:35 +0100211 /// Return true if the intrinsic takes a splat operand.
212 bool hasSplat() const {
213 // These prototype modifiers are described in arm_sve.td.
214 return Proto.find_first_of("ajfrKLR") != std::string::npos;
215 }
216
217 /// Return the parameter index of the splat operand.
218 unsigned getSplatIdx() const {
219 // These prototype modifiers are described in arm_sve.td.
220 auto Idx = Proto.find_first_of("ajfrKLR");
221 assert(Idx != std::string::npos && Idx > 0 &&
222 "Prototype has no splat operand");
223 return Idx - 1;
224 }
225
Sander de Smalenc5b81462020-03-18 11:07:20 +0000226 /// Emits the intrinsic declaration to the ostream.
227 void emitIntrinsic(raw_ostream &OS) const;
228
229private:
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100230 std::string getMergeSuffix() const { return MergeSuffix; }
Sander de Smalenc5b81462020-03-18 11:07:20 +0000231 std::string mangleName(ClassKind LocalCK) const;
232 std::string replaceTemplatedArgs(std::string Name, TypeSpec TS,
233 std::string Proto) const;
234};
235
236class SVEEmitter {
237private:
238 RecordKeeper &Records;
239 llvm::StringMap<uint64_t> EltTypes;
240 llvm::StringMap<uint64_t> MemEltTypes;
241 llvm::StringMap<uint64_t> FlagTypes;
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100242 llvm::StringMap<uint64_t> MergeTypes;
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100243 llvm::StringMap<uint64_t> ImmCheckTypes;
Sander de Smalenc5b81462020-03-18 11:07:20 +0000244
Sander de Smalenc5b81462020-03-18 11:07:20 +0000245public:
246 SVEEmitter(RecordKeeper &R) : Records(R) {
247 for (auto *RV : Records.getAllDerivedDefinitions("EltType"))
248 EltTypes[RV->getNameInitAsString()] = RV->getValueAsInt("Value");
249 for (auto *RV : Records.getAllDerivedDefinitions("MemEltType"))
250 MemEltTypes[RV->getNameInitAsString()] = RV->getValueAsInt("Value");
251 for (auto *RV : Records.getAllDerivedDefinitions("FlagType"))
252 FlagTypes[RV->getNameInitAsString()] = RV->getValueAsInt("Value");
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100253 for (auto *RV : Records.getAllDerivedDefinitions("MergeType"))
254 MergeTypes[RV->getNameInitAsString()] = RV->getValueAsInt("Value");
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100255 for (auto *RV : Records.getAllDerivedDefinitions("ImmCheckType"))
256 ImmCheckTypes[RV->getNameInitAsString()] = RV->getValueAsInt("Value");
257 }
258
259 /// Returns the enum value for the immcheck type
260 unsigned getEnumValueForImmCheck(StringRef C) const {
261 auto It = ImmCheckTypes.find(C);
262 if (It != ImmCheckTypes.end())
263 return It->getValue();
264 llvm_unreachable("Unsupported imm check");
Sander de Smalenc5b81462020-03-18 11:07:20 +0000265 }
266
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100267 // Returns the SVETypeFlags for a given value and mask.
268 uint64_t encodeFlag(uint64_t V, StringRef MaskName) const {
269 auto It = FlagTypes.find(MaskName);
270 if (It != FlagTypes.end()) {
271 uint64_t Mask = It->getValue();
272 unsigned Shift = llvm::countTrailingZeros(Mask);
273 return (V << Shift) & Mask;
274 }
275 llvm_unreachable("Unsupported flag");
276 }
277
278 // Returns the SVETypeFlags for the given element type.
279 uint64_t encodeEltType(StringRef EltName) {
280 auto It = EltTypes.find(EltName);
281 if (It != EltTypes.end())
282 return encodeFlag(It->getValue(), "EltTypeMask");
283 llvm_unreachable("Unsupported EltType");
284 }
285
286 // Returns the SVETypeFlags for the given memory element type.
287 uint64_t encodeMemoryElementType(uint64_t MT) {
288 return encodeFlag(MT, "MemEltTypeMask");
289 }
290
291 // Returns the SVETypeFlags for the given merge type.
292 uint64_t encodeMergeType(uint64_t MT) {
293 return encodeFlag(MT, "MergeTypeMask");
294 }
295
Sander de Smalen41d52662020-04-22 13:58:35 +0100296 // Returns the SVETypeFlags for the given splat operand.
297 unsigned encodeSplatOperand(unsigned SplatIdx) {
298 assert(SplatIdx < 7 && "SplatIdx out of encodable range");
299 return encodeFlag(SplatIdx + 1, "SplatOperandMask");
300 }
301
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100302 // Returns the SVETypeFlags value for the given SVEType.
303 uint64_t encodeTypeFlags(const SVEType &T);
304
Sander de Smalenc5b81462020-03-18 11:07:20 +0000305 /// Emit arm_sve.h.
306 void createHeader(raw_ostream &o);
307
308 /// Emit all the __builtin prototypes and code needed by Sema.
309 void createBuiltins(raw_ostream &o);
310
311 /// Emit all the information needed to map builtin -> LLVM IR intrinsic.
312 void createCodeGenMap(raw_ostream &o);
313
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100314 /// Emit all the range checks for the immediates.
315 void createRangeChecks(raw_ostream &o);
316
Sander de Smalenc5b81462020-03-18 11:07:20 +0000317 /// Create the SVETypeFlags used in CGBuiltins
318 void createTypeFlags(raw_ostream &o);
319
320 /// Create intrinsic and add it to \p Out
321 void createIntrinsic(Record *R, SmallVectorImpl<std::unique_ptr<Intrinsic>> &Out);
Sander de Smalen5087ace2020-03-15 14:29:45 +0000322};
323
324} // end anonymous namespace
325
326
327//===----------------------------------------------------------------------===//
Sander de Smalenc5b81462020-03-18 11:07:20 +0000328// Type implementation
Sander de Smalen8b409ea2020-03-16 10:14:05 +0000329//===----------------------------------------------------------------------===//
Sander de Smalen8b409ea2020-03-16 10:14:05 +0000330
Sander de Smalenc5b81462020-03-18 11:07:20 +0000331std::string SVEType::builtin_str() const {
332 std::string S;
333 if (isVoid())
334 return "v";
335
336 if (isVoidPointer())
337 S += "v";
338 else if (!Float)
339 switch (ElementBitwidth) {
340 case 1: S += "b"; break;
341 case 8: S += "c"; break;
342 case 16: S += "s"; break;
343 case 32: S += "i"; break;
344 case 64: S += "Wi"; break;
345 case 128: S += "LLLi"; break;
346 default: llvm_unreachable("Unhandled case!");
347 }
348 else
349 switch (ElementBitwidth) {
350 case 16: S += "h"; break;
351 case 32: S += "f"; break;
352 case 64: S += "d"; break;
353 default: llvm_unreachable("Unhandled case!");
354 }
355
356 if (!isFloat()) {
357 if ((isChar() || isPointer()) && !isVoidPointer()) {
358 // Make chars and typed pointers explicitly signed.
359 if (Signed)
360 S = "S" + S;
361 else if (!Signed)
362 S = "U" + S;
363 } else if (!isVoidPointer() && !Signed) {
364 S = "U" + S;
365 }
366 }
367
368 // Constant indices are "int", but have the "constant expression" modifier.
369 if (isImmediate()) {
370 assert(!isFloat() && "fp immediates are not supported");
371 S = "I" + S;
372 }
373
374 if (isScalar()) {
375 if (Constant) S += "C";
376 if (Pointer) S += "*";
377 return S;
378 }
379
380 assert(isScalableVector() && "Unsupported type");
381 return "q" + utostr(getNumElements() * NumVectors) + S;
382}
383
Sander de Smalen981f0802020-03-18 15:05:08 +0000384std::string SVEType::str() const {
385 if (isPredicatePattern())
386 return "sv_pattern";
387
388 if (isPrefetchOp())
389 return "sv_prfop";
390
391 std::string S;
392 if (Void)
393 S += "void";
394 else {
395 if (isScalableVector())
396 S += "sv";
397 if (!Signed && !Float)
398 S += "u";
399
400 if (Float)
401 S += "float";
402 else if (isScalarPredicate())
403 S += "bool";
404 else
405 S += "int";
406
407 if (!isScalarPredicate())
408 S += utostr(ElementBitwidth);
409 if (!isScalableVector() && isVector())
410 S += "x" + utostr(getNumElements());
411 if (NumVectors > 1)
412 S += "x" + utostr(NumVectors);
413 S += "_t";
414 }
415
416 if (Constant)
417 S += " const";
418 if (Pointer)
419 S += " *";
420
421 return S;
422}
Sander de Smalenc5b81462020-03-18 11:07:20 +0000423void SVEType::applyTypespec() {
424 for (char I : TS) {
425 switch (I) {
426 case 'P':
427 Predicate = true;
428 ElementBitwidth = 1;
429 break;
430 case 'U':
431 Signed = false;
432 break;
433 case 'c':
434 ElementBitwidth = 8;
435 break;
436 case 's':
437 ElementBitwidth = 16;
438 break;
439 case 'i':
440 ElementBitwidth = 32;
441 break;
442 case 'l':
443 ElementBitwidth = 64;
444 break;
445 case 'h':
446 Float = true;
447 ElementBitwidth = 16;
448 break;
449 case 'f':
450 Float = true;
451 ElementBitwidth = 32;
452 break;
453 case 'd':
454 Float = true;
455 ElementBitwidth = 64;
456 break;
457 default:
458 llvm_unreachable("Unhandled type code!");
459 }
460 }
461 assert(ElementBitwidth != ~0U && "Bad element bitwidth!");
462}
463
464void SVEType::applyModifier(char Mod) {
465 switch (Mod) {
466 case 'v':
467 Void = true;
468 break;
469 case 'd':
470 DefaultType = true;
471 break;
472 case 'c':
473 Constant = true;
474 LLVM_FALLTHROUGH;
475 case 'p':
476 Pointer = true;
477 Bitwidth = ElementBitwidth;
478 NumVectors = 0;
479 break;
Sander de Smalenfc645392020-04-20 14:57:13 +0100480 case 'e':
481 Signed = false;
482 ElementBitwidth /= 2;
483 break;
Sander de Smalen515020c2020-04-20 14:41:58 +0100484 case 'h':
485 ElementBitwidth /= 2;
486 break;
Sander de Smalenfc645392020-04-20 14:57:13 +0100487 case 'q':
488 ElementBitwidth /= 4;
489 break;
490 case 'o':
491 ElementBitwidth *= 4;
492 break;
Sander de Smalenc5b81462020-03-18 11:07:20 +0000493 case 'P':
494 Signed = true;
495 Float = false;
496 Predicate = true;
497 Bitwidth = 16;
498 ElementBitwidth = 1;
499 break;
Sander de Smalen41d52662020-04-22 13:58:35 +0100500 case 'a':
501 Bitwidth = ElementBitwidth;
502 NumVectors = 0;
503 break;
Sander de Smalen515020c2020-04-20 14:41:58 +0100504 case 'u':
505 Predicate = false;
506 Signed = false;
507 Float = false;
508 break;
Andrzej Warzynski72f56582020-04-07 11:09:01 +0100509 case 'x':
510 Predicate = false;
511 Signed = true;
512 Float = false;
513 break;
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100514 case 'i':
515 Predicate = false;
516 Float = false;
517 ElementBitwidth = Bitwidth = 64;
518 NumVectors = 0;
519 Signed = false;
520 Immediate = true;
521 break;
522 case 'I':
523 Predicate = false;
524 Float = false;
525 ElementBitwidth = Bitwidth = 32;
526 NumVectors = 0;
527 Signed = true;
528 Immediate = true;
529 PredicatePattern = true;
530 break;
Sander de Smalen17a68c62020-04-14 13:17:52 +0100531 case 'l':
532 Predicate = false;
533 Signed = true;
534 Float = false;
535 ElementBitwidth = Bitwidth = 64;
536 NumVectors = 0;
537 break;
538 case 'S':
539 Constant = true;
540 Pointer = true;
541 ElementBitwidth = Bitwidth = 8;
542 NumVectors = 0;
543 Signed = true;
544 break;
545 case 'W':
546 Constant = true;
547 Pointer = true;
548 ElementBitwidth = Bitwidth = 8;
549 NumVectors = 0;
550 Signed = false;
551 break;
552 case 'T':
553 Constant = true;
554 Pointer = true;
555 ElementBitwidth = Bitwidth = 16;
556 NumVectors = 0;
557 Signed = true;
558 break;
559 case 'X':
560 Constant = true;
561 Pointer = true;
562 ElementBitwidth = Bitwidth = 16;
563 NumVectors = 0;
564 Signed = false;
565 break;
566 case 'Y':
567 Constant = true;
568 Pointer = true;
569 ElementBitwidth = Bitwidth = 32;
570 NumVectors = 0;
571 Signed = false;
572 break;
573 case 'U':
574 Constant = true;
575 Pointer = true;
576 ElementBitwidth = Bitwidth = 32;
577 NumVectors = 0;
578 Signed = true;
579 break;
580 case 'A':
581 Pointer = true;
582 ElementBitwidth = Bitwidth = 8;
583 NumVectors = 0;
584 Signed = true;
585 break;
586 case 'B':
587 Pointer = true;
588 ElementBitwidth = Bitwidth = 16;
589 NumVectors = 0;
590 Signed = true;
591 break;
592 case 'C':
593 Pointer = true;
594 ElementBitwidth = Bitwidth = 32;
595 NumVectors = 0;
596 Signed = true;
597 break;
598 case 'D':
599 Pointer = true;
600 ElementBitwidth = Bitwidth = 64;
601 NumVectors = 0;
602 Signed = true;
603 break;
604 case 'E':
605 Pointer = true;
606 ElementBitwidth = Bitwidth = 8;
607 NumVectors = 0;
608 Signed = false;
609 break;
610 case 'F':
611 Pointer = true;
612 ElementBitwidth = Bitwidth = 16;
613 NumVectors = 0;
614 Signed = false;
615 break;
616 case 'G':
617 Pointer = true;
618 ElementBitwidth = Bitwidth = 32;
619 NumVectors = 0;
620 Signed = false;
621 break;
Sander de Smalenc5b81462020-03-18 11:07:20 +0000622 default:
623 llvm_unreachable("Unhandled character!");
624 }
625}
626
627
628//===----------------------------------------------------------------------===//
629// Intrinsic implementation
630//===----------------------------------------------------------------------===//
631
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100632Intrinsic::Intrinsic(StringRef Name, StringRef Proto, uint64_t MergeTy,
633 StringRef MergeSuffix, uint64_t MemoryElementTy,
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100634 StringRef LLVMName, uint64_t Flags,
635 ArrayRef<ImmCheck> Checks, TypeSpec BT, ClassKind Class,
636 SVEEmitter &Emitter, StringRef Guard)
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100637 : Name(Name.str()), LLVMName(LLVMName), Proto(Proto.str()),
638 BaseTypeSpec(BT), Class(Class), Guard(Guard.str()),
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100639 MergeSuffix(MergeSuffix.str()), BaseType(BT, 'd'), Flags(Flags),
640 ImmChecks(Checks.begin(), Checks.end()) {
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100641
642 // Types[0] is the return value.
643 for (unsigned I = 0; I < Proto.size(); ++I) {
644 SVEType T(BaseTypeSpec, Proto[I]);
645 Types.push_back(T);
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100646
647 // Add range checks for immediates
648 if (I > 0) {
649 if (T.isPredicatePattern())
650 ImmChecks.emplace_back(
651 I - 1, Emitter.getEnumValueForImmCheck("ImmCheck0_31"));
652 }
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100653 }
654
655 // Set flags based on properties
656 this->Flags |= Emitter.encodeTypeFlags(BaseType);
657 this->Flags |= Emitter.encodeMemoryElementType(MemoryElementTy);
658 this->Flags |= Emitter.encodeMergeType(MergeTy);
Sander de Smalen41d52662020-04-22 13:58:35 +0100659 if (hasSplat())
660 this->Flags |= Emitter.encodeSplatOperand(getSplatIdx());
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100661}
662
Sander de Smalenc5b81462020-03-18 11:07:20 +0000663std::string Intrinsic::getBuiltinTypeStr() {
664 std::string S;
665
666 SVEType RetT = getReturnType();
667 // Since the return value must be one type, return a vector type of the
668 // appropriate width which we will bitcast. An exception is made for
669 // returning structs of 2, 3, or 4 vectors which are returned in a sret-like
670 // fashion, storing them to a pointer arg.
671 if (RetT.getNumVectors() > 1) {
672 S += "vv*"; // void result with void* first argument
673 } else
674 S += RetT.builtin_str();
675
676 for (unsigned I = 0; I < getNumParams(); ++I)
677 S += getParamType(I).builtin_str();
678
679 return S;
680}
681
682std::string Intrinsic::replaceTemplatedArgs(std::string Name, TypeSpec TS,
683 std::string Proto) const {
684 std::string Ret = Name;
685 while (Ret.find('{') != std::string::npos) {
686 size_t Pos = Ret.find('{');
687 size_t End = Ret.find('}');
688 unsigned NumChars = End - Pos + 1;
689 assert(NumChars == 3 && "Unexpected template argument");
690
691 SVEType T;
692 char C = Ret[Pos+1];
693 switch(C) {
694 default:
695 llvm_unreachable("Unknown predication specifier");
696 case 'd':
697 T = SVEType(TS, 'd');
698 break;
699 case '0':
700 case '1':
701 case '2':
702 case '3':
703 T = SVEType(TS, Proto[C - '0']);
704 break;
705 }
706
707 // Replace templated arg with the right suffix (e.g. u32)
708 std::string TypeCode;
709 if (T.isInteger())
710 TypeCode = T.isSigned() ? 's' : 'u';
711 else if (T.isPredicateVector())
712 TypeCode = 'b';
713 else
714 TypeCode = 'f';
715 Ret.replace(Pos, NumChars, TypeCode + utostr(T.getElementSizeInBits()));
716 }
717
718 return Ret;
719}
720
Sander de Smalenc5b81462020-03-18 11:07:20 +0000721std::string Intrinsic::mangleName(ClassKind LocalCK) const {
722 std::string S = getName();
723
724 if (LocalCK == ClassG) {
725 // Remove the square brackets and everything in between.
726 while (S.find("[") != std::string::npos) {
727 auto Start = S.find("[");
728 auto End = S.find(']');
729 S.erase(Start, (End-Start)+1);
730 }
731 } else {
732 // Remove the square brackets.
733 while (S.find("[") != std::string::npos) {
734 auto BrPos = S.find('[');
735 if (BrPos != std::string::npos)
736 S.erase(BrPos, 1);
737 BrPos = S.find(']');
738 if (BrPos != std::string::npos)
739 S.erase(BrPos, 1);
740 }
741 }
742
743 // Replace all {d} like expressions with e.g. 'u32'
744 return replaceTemplatedArgs(S, getBaseTypeSpec(), getProto()) +
745 getMergeSuffix();
746}
747
748void Intrinsic::emitIntrinsic(raw_ostream &OS) const {
749 // Use the preprocessor to
750 if (getClassKind() != ClassG || getProto().size() <= 1) {
751 OS << "#define " << mangleName(getClassKind())
752 << "(...) __builtin_sve_" << mangleName(ClassS)
753 << "(__VA_ARGS__)\n";
754 } else {
Sander de Smalen981f0802020-03-18 15:05:08 +0000755 std::string FullName = mangleName(ClassS);
756 std::string ProtoName = mangleName(ClassG);
757
758 OS << "__aio __attribute__((__clang_arm_builtin_alias("
759 << "__builtin_sve_" << FullName << ")))\n";
760
761 OS << getTypes()[0].str() << " " << ProtoName << "(";
762 for (unsigned I = 0; I < getTypes().size() - 1; ++I) {
763 if (I != 0)
764 OS << ", ";
765 OS << getTypes()[I + 1].str();
766 }
767 OS << ");\n";
Sander de Smalenc5b81462020-03-18 11:07:20 +0000768 }
769}
770
771//===----------------------------------------------------------------------===//
772// SVEEmitter implementation
773//===----------------------------------------------------------------------===//
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100774uint64_t SVEEmitter::encodeTypeFlags(const SVEType &T) {
775 if (T.isFloat()) {
776 switch (T.getElementSizeInBits()) {
777 case 16:
778 return encodeEltType("EltTyFloat16");
779 case 32:
780 return encodeEltType("EltTyFloat32");
781 case 64:
782 return encodeEltType("EltTyFloat64");
783 default:
784 llvm_unreachable("Unhandled float element bitwidth!");
785 }
786 }
787
788 if (T.isPredicateVector()) {
789 switch (T.getElementSizeInBits()) {
790 case 8:
791 return encodeEltType("EltTyBool8");
792 case 16:
793 return encodeEltType("EltTyBool16");
794 case 32:
795 return encodeEltType("EltTyBool32");
796 case 64:
797 return encodeEltType("EltTyBool64");
798 default:
799 llvm_unreachable("Unhandled predicate element bitwidth!");
800 }
801 }
802
803 switch (T.getElementSizeInBits()) {
804 case 8:
805 return encodeEltType("EltTyInt8");
806 case 16:
807 return encodeEltType("EltTyInt16");
808 case 32:
809 return encodeEltType("EltTyInt32");
810 case 64:
811 return encodeEltType("EltTyInt64");
812 default:
813 llvm_unreachable("Unhandled integer element bitwidth!");
814 }
815}
816
Sander de Smalenc5b81462020-03-18 11:07:20 +0000817void SVEEmitter::createIntrinsic(
818 Record *R, SmallVectorImpl<std::unique_ptr<Intrinsic>> &Out) {
819 StringRef Name = R->getValueAsString("Name");
820 StringRef Proto = R->getValueAsString("Prototype");
821 StringRef Types = R->getValueAsString("Types");
822 StringRef Guard = R->getValueAsString("ArchGuard");
823 StringRef LLVMName = R->getValueAsString("LLVMIntrinsic");
Sander de Smalenf6ea0262020-04-14 15:31:20 +0100824 uint64_t Merge = R->getValueAsInt("Merge");
825 StringRef MergeSuffix = R->getValueAsString("MergeSuffix");
826 uint64_t MemEltType = R->getValueAsInt("MemEltType");
Sander de Smalenc5b81462020-03-18 11:07:20 +0000827 std::vector<Record*> FlagsList = R->getValueAsListOfDefs("Flags");
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100828 std::vector<Record*> ImmCheckList = R->getValueAsListOfDefs("ImmChecks");
Sander de Smalenc5b81462020-03-18 11:07:20 +0000829
830 int64_t Flags = 0;
831 for (auto FlagRec : FlagsList)
832 Flags |= FlagRec->getValueAsInt("Value");
Sander de Smalenc5b81462020-03-18 11:07:20 +0000833
834 // Extract type specs from string
835 SmallVector<TypeSpec, 8> TypeSpecs;
836 TypeSpec Acc;
837 for (char I : Types) {
838 Acc.push_back(I);
839 if (islower(I)) {
840 TypeSpecs.push_back(TypeSpec(Acc));
841 Acc.clear();
842 }
843 }
844
845 // Remove duplicate type specs.
Benjamin Kramer4065e922020-03-28 19:19:55 +0100846 llvm::sort(TypeSpecs);
Sander de Smalenc5b81462020-03-18 11:07:20 +0000847 TypeSpecs.erase(std::unique(TypeSpecs.begin(), TypeSpecs.end()),
848 TypeSpecs.end());
849
850 // Create an Intrinsic for each type spec.
851 for (auto TS : TypeSpecs) {
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100852 // Collate a list of range/option checks for the immediates.
853 SmallVector<ImmCheck, 2> ImmChecks;
854 for (auto *R : ImmCheckList) {
Christopher Tetreault464a0692020-04-15 15:16:17 -0700855 int64_t Arg = R->getValueAsInt("Arg");
856 int64_t EltSizeArg = R->getValueAsInt("EltSizeArg");
857 int64_t Kind = R->getValueAsDef("Kind")->getValueAsInt("Value");
858 assert(Arg >= 0 && Kind >= 0 && "Arg and Kind must be nonnegative");
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100859
860 unsigned ElementSizeInBits = 0;
861 if (EltSizeArg >= 0)
862 ElementSizeInBits =
863 SVEType(TS, Proto[EltSizeArg + /* offset by return arg */ 1])
864 .getElementSizeInBits();
865 ImmChecks.push_back(ImmCheck(Arg, Kind, ElementSizeInBits));
866 }
867
868 Out.push_back(std::make_unique<Intrinsic>(
869 Name, Proto, Merge, MergeSuffix, MemEltType, LLVMName, Flags, ImmChecks,
870 TS, ClassS, *this, Guard));
Sander de Smalen981f0802020-03-18 15:05:08 +0000871
872 // Also generate the short-form (e.g. svadd_m) for the given type-spec.
873 if (Intrinsic::isOverloadedIntrinsic(Name))
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100874 Out.push_back(std::make_unique<Intrinsic>(
875 Name, Proto, Merge, MergeSuffix, MemEltType, LLVMName, Flags,
876 ImmChecks, TS, ClassG, *this, Guard));
Sander de Smalenc5b81462020-03-18 11:07:20 +0000877 }
878}
879
880void SVEEmitter::createHeader(raw_ostream &OS) {
Sander de Smalen5087ace2020-03-15 14:29:45 +0000881 OS << "/*===---- arm_sve.h - ARM SVE intrinsics "
882 "-----------------------------------===\n"
883 " *\n"
884 " *\n"
885 " * Part of the LLVM Project, under the Apache License v2.0 with LLVM "
886 "Exceptions.\n"
887 " * See https://llvm.org/LICENSE.txt for license information.\n"
888 " * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n"
889 " *\n"
890 " *===-----------------------------------------------------------------"
891 "------===\n"
892 " */\n\n";
893
894 OS << "#ifndef __ARM_SVE_H\n";
895 OS << "#define __ARM_SVE_H\n\n";
896
897 OS << "#if !defined(__ARM_FEATURE_SVE)\n";
898 OS << "#error \"SVE support not enabled\"\n";
899 OS << "#else\n\n";
900
901 OS << "#include <stdint.h>\n\n";
Sander de Smalenc5b81462020-03-18 11:07:20 +0000902 OS << "#ifdef __cplusplus\n";
903 OS << "extern \"C\" {\n";
904 OS << "#else\n";
Sander de Smalen5087ace2020-03-15 14:29:45 +0000905 OS << "#include <stdbool.h>\n";
906 OS << "#endif\n\n";
907
908 OS << "typedef __fp16 float16_t;\n";
909 OS << "typedef float float32_t;\n";
910 OS << "typedef double float64_t;\n";
911 OS << "typedef bool bool_t;\n\n";
912
913 OS << "typedef __SVInt8_t svint8_t;\n";
914 OS << "typedef __SVInt16_t svint16_t;\n";
915 OS << "typedef __SVInt32_t svint32_t;\n";
916 OS << "typedef __SVInt64_t svint64_t;\n";
917 OS << "typedef __SVUint8_t svuint8_t;\n";
918 OS << "typedef __SVUint16_t svuint16_t;\n";
919 OS << "typedef __SVUint32_t svuint32_t;\n";
920 OS << "typedef __SVUint64_t svuint64_t;\n";
921 OS << "typedef __SVFloat16_t svfloat16_t;\n";
922 OS << "typedef __SVFloat32_t svfloat32_t;\n";
923 OS << "typedef __SVFloat64_t svfloat64_t;\n";
924 OS << "typedef __SVBool_t svbool_t;\n\n";
925
Sander de Smalenc8a5b302020-04-14 15:56:36 +0100926 OS << "typedef enum\n";
927 OS << "{\n";
928 OS << " SV_POW2 = 0,\n";
929 OS << " SV_VL1 = 1,\n";
930 OS << " SV_VL2 = 2,\n";
931 OS << " SV_VL3 = 3,\n";
932 OS << " SV_VL4 = 4,\n";
933 OS << " SV_VL5 = 5,\n";
934 OS << " SV_VL6 = 6,\n";
935 OS << " SV_VL7 = 7,\n";
936 OS << " SV_VL8 = 8,\n";
937 OS << " SV_VL16 = 9,\n";
938 OS << " SV_VL32 = 10,\n";
939 OS << " SV_VL64 = 11,\n";
940 OS << " SV_VL128 = 12,\n";
941 OS << " SV_VL256 = 13,\n";
942 OS << " SV_MUL4 = 29,\n";
943 OS << " SV_MUL3 = 30,\n";
944 OS << " SV_ALL = 31\n";
945 OS << "} sv_pattern;\n\n";
946
Sander de Smalen981f0802020-03-18 15:05:08 +0000947 OS << "/* Function attributes */\n";
948 OS << "#define __aio static inline __attribute__((__always_inline__, "
949 "__nodebug__, __overloadable__))\n\n";
950
Sander de Smalenc5b81462020-03-18 11:07:20 +0000951 SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
952 std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
953 for (auto *R : RV)
954 createIntrinsic(R, Defs);
Sander de Smalen5087ace2020-03-15 14:29:45 +0000955
Sander de Smalenc5b81462020-03-18 11:07:20 +0000956 // Sort intrinsics in header file by following order/priority:
957 // - Architectural guard (i.e. does it require SVE2 or SVE2_AES)
958 // - Class (is intrinsic overloaded or not)
959 // - Intrinsic name
960 std::stable_sort(
961 Defs.begin(), Defs.end(), [](const std::unique_ptr<Intrinsic> &A,
962 const std::unique_ptr<Intrinsic> &B) {
Eric Fiselieraf2968e2020-04-16 18:35:31 -0400963 auto ToTuple = [](const std::unique_ptr<Intrinsic> &I) {
964 return std::make_tuple(I->getGuard(), (unsigned)I->getClassKind(), I->getName());
965 };
966 return ToTuple(A) < ToTuple(B);
Sander de Smalenc5b81462020-03-18 11:07:20 +0000967 });
968
969 StringRef InGuard = "";
970 for (auto &I : Defs) {
971 // Emit #endif/#if pair if needed.
972 if (I->getGuard() != InGuard) {
973 if (!InGuard.empty())
974 OS << "#endif //" << InGuard << "\n";
975 InGuard = I->getGuard();
976 if (!InGuard.empty())
977 OS << "\n#if " << InGuard << "\n";
978 }
979
980 // Actually emit the intrinsic declaration.
981 I->emitIntrinsic(OS);
982 }
983
984 if (!InGuard.empty())
985 OS << "#endif //" << InGuard << "\n";
986
987 OS << "#ifdef __cplusplus\n";
988 OS << "} // extern \"C\"\n";
989 OS << "#endif\n\n";
990 OS << "#endif /*__ARM_FEATURE_SVE */\n\n";
Sander de Smalen5087ace2020-03-15 14:29:45 +0000991 OS << "#endif /* __ARM_SVE_H */\n";
992}
993
Sander de Smalenc5b81462020-03-18 11:07:20 +0000994void SVEEmitter::createBuiltins(raw_ostream &OS) {
995 std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
996 SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
997 for (auto *R : RV)
998 createIntrinsic(R, Defs);
999
1000 // The mappings must be sorted based on BuiltinID.
1001 llvm::sort(Defs, [](const std::unique_ptr<Intrinsic> &A,
1002 const std::unique_ptr<Intrinsic> &B) {
1003 return A->getMangledName() < B->getMangledName();
1004 });
1005
1006 OS << "#ifdef GET_SVE_BUILTINS\n";
1007 for (auto &Def : Defs) {
1008 // Only create BUILTINs for non-overloaded intrinsics, as overloaded
1009 // declarations only live in the header file.
1010 if (Def->getClassKind() != ClassG)
1011 OS << "BUILTIN(__builtin_sve_" << Def->getMangledName() << ", \""
1012 << Def->getBuiltinTypeStr() << "\", \"n\")\n";
1013 }
1014 OS << "#endif\n\n";
1015}
1016
1017void SVEEmitter::createCodeGenMap(raw_ostream &OS) {
1018 std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
1019 SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
1020 for (auto *R : RV)
1021 createIntrinsic(R, Defs);
1022
1023 // The mappings must be sorted based on BuiltinID.
1024 llvm::sort(Defs, [](const std::unique_ptr<Intrinsic> &A,
1025 const std::unique_ptr<Intrinsic> &B) {
1026 return A->getMangledName() < B->getMangledName();
1027 });
1028
1029 OS << "#ifdef GET_SVE_LLVM_INTRINSIC_MAP\n";
1030 for (auto &Def : Defs) {
1031 // Builtins only exist for non-overloaded intrinsics, overloaded
1032 // declarations only live in the header file.
1033 if (Def->getClassKind() == ClassG)
1034 continue;
1035
Sander de Smalenf6ea0262020-04-14 15:31:20 +01001036 uint64_t Flags = Def->getFlags();
Sander de Smalenc5b81462020-03-18 11:07:20 +00001037 auto FlagString = std::to_string(Flags);
1038
1039 std::string LLVMName = Def->getLLVMName();
1040 std::string Builtin = Def->getMangledName();
1041 if (!LLVMName.empty())
1042 OS << "SVEMAP1(" << Builtin << ", " << LLVMName << ", " << FlagString
1043 << "),\n";
1044 else
1045 OS << "SVEMAP2(" << Builtin << ", " << FlagString << "),\n";
1046 }
1047 OS << "#endif\n\n";
1048}
1049
Sander de Smalenc8a5b302020-04-14 15:56:36 +01001050void SVEEmitter::createRangeChecks(raw_ostream &OS) {
1051 std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
1052 SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
1053 for (auto *R : RV)
1054 createIntrinsic(R, Defs);
1055
1056 // The mappings must be sorted based on BuiltinID.
1057 llvm::sort(Defs, [](const std::unique_ptr<Intrinsic> &A,
1058 const std::unique_ptr<Intrinsic> &B) {
1059 return A->getMangledName() < B->getMangledName();
1060 });
1061
1062
1063 OS << "#ifdef GET_SVE_IMMEDIATE_CHECK\n";
1064
1065 // Ensure these are only emitted once.
1066 std::set<std::string> Emitted;
1067
1068 for (auto &Def : Defs) {
1069 if (Emitted.find(Def->getMangledName()) != Emitted.end() ||
1070 Def->getImmChecks().empty())
1071 continue;
1072
1073 OS << "case SVE::BI__builtin_sve_" << Def->getMangledName() << ":\n";
1074 for (auto &Check : Def->getImmChecks())
1075 OS << "ImmChecks.push_back(std::make_tuple(" << Check.getArg() << ", "
1076 << Check.getKind() << ", " << Check.getElementSizeInBits() << "));\n";
1077 OS << " break;\n";
1078
1079 Emitted.insert(Def->getMangledName());
1080 }
1081
1082 OS << "#endif\n\n";
1083}
1084
Sander de Smalenc5b81462020-03-18 11:07:20 +00001085/// Create the SVETypeFlags used in CGBuiltins
1086void SVEEmitter::createTypeFlags(raw_ostream &OS) {
1087 OS << "#ifdef LLVM_GET_SVE_TYPEFLAGS\n";
1088 for (auto &KV : FlagTypes)
1089 OS << "const uint64_t " << KV.getKey() << " = " << KV.getValue() << ";\n";
1090 OS << "#endif\n\n";
1091
1092 OS << "#ifdef LLVM_GET_SVE_ELTTYPES\n";
1093 for (auto &KV : EltTypes)
1094 OS << " " << KV.getKey() << " = " << KV.getValue() << ",\n";
1095 OS << "#endif\n\n";
1096
1097 OS << "#ifdef LLVM_GET_SVE_MEMELTTYPES\n";
1098 for (auto &KV : MemEltTypes)
1099 OS << " " << KV.getKey() << " = " << KV.getValue() << ",\n";
1100 OS << "#endif\n\n";
Sander de Smalenf6ea0262020-04-14 15:31:20 +01001101
1102 OS << "#ifdef LLVM_GET_SVE_MERGETYPES\n";
1103 for (auto &KV : MergeTypes)
1104 OS << " " << KV.getKey() << " = " << KV.getValue() << ",\n";
1105 OS << "#endif\n\n";
Sander de Smalenc8a5b302020-04-14 15:56:36 +01001106
1107 OS << "#ifdef LLVM_GET_SVE_IMMCHECKTYPES\n";
1108 for (auto &KV : ImmCheckTypes)
1109 OS << " " << KV.getKey() << " = " << KV.getValue() << ",\n";
1110 OS << "#endif\n\n";
Sander de Smalenc5b81462020-03-18 11:07:20 +00001111}
1112
Sander de Smalen5087ace2020-03-15 14:29:45 +00001113namespace clang {
1114void EmitSveHeader(RecordKeeper &Records, raw_ostream &OS) {
Sander de Smalenc5b81462020-03-18 11:07:20 +00001115 SVEEmitter(Records).createHeader(OS);
1116}
1117
1118void EmitSveBuiltins(RecordKeeper &Records, raw_ostream &OS) {
1119 SVEEmitter(Records).createBuiltins(OS);
1120}
1121
1122void EmitSveBuiltinCG(RecordKeeper &Records, raw_ostream &OS) {
1123 SVEEmitter(Records).createCodeGenMap(OS);
1124}
Sander de Smalenc8a5b302020-04-14 15:56:36 +01001125
1126void EmitSveRangeChecks(RecordKeeper &Records, raw_ostream &OS) {
1127 SVEEmitter(Records).createRangeChecks(OS);
1128}
1129
Sander de Smalenc5b81462020-03-18 11:07:20 +00001130void EmitSveTypeFlags(RecordKeeper &Records, raw_ostream &OS) {
1131 SVEEmitter(Records).createTypeFlags(OS);
Sander de Smalen5087ace2020-03-15 14:29:45 +00001132}
1133
1134} // End namespace clang