1 //===- NeonEmitter.cpp - Generate arm_neon.h for use with clang -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This tablegen backend is responsible for emitting arm_neon.h, which includes
11 // a declaration and definition of each function specified by the ARM NEON
12 // compiler interface. See ARM document DUI0348B.
14 // Each NEON instruction is implemented in terms of 1 or more functions which
15 // are suffixed with the element type of the input vectors. Functions may be
16 // implemented in terms of generic vector operations such as +, *, -, etc. or
17 // by calling a __builtin_-prefixed function which will be handled by clang's
20 // Additional validation code can be generated by this file when runHeader() is
21 // called, rather than the normal run() entry point.
23 //===----------------------------------------------------------------------===//
25 #include "NeonEmitter.h"
26 #include "llvm/ADT/SmallString.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/StringExtras.h"
33 /// ParseTypes - break down a string such as "fQf" into a vector of StringRefs,
34 /// which each StringRef representing a single type declared in the string.
35 /// for "fQf" we would end up with 2 StringRefs, "f", and "Qf", representing
36 /// 2xfloat and 4xfloat respectively.
37 static void ParseTypes(Record *r, std::string &s,
38 SmallVectorImpl<StringRef> &TV) {
39 const char *data = s.data();
42 for (unsigned i = 0, e = s.size(); i != e; ++i, ++len) {
43 if (data[len] == 'P' || data[len] == 'Q' || data[len] == 'U')
55 throw TGError(r->getLoc(),
56 "Unexpected letter: " + std::string(data + len, 1));
59 TV.push_back(StringRef(data, len + 1));
65 /// Widen - Convert a type code into the next wider type. char -> short,
66 /// short -> int, etc.
67 static char Widen(const char t) {
75 default: throw "unhandled type in widen!";
80 /// Narrow - Convert a type code into the next smaller type. short -> char,
81 /// float -> half float, etc.
82 static char Narrow(const char t) {
92 default: throw "unhandled type in widen!";
97 /// For a particular StringRef, return the base type code, and whether it has
98 /// the quad-vector, polynomial, or unsigned modifiers set.
99 static char ClassifyType(StringRef ty, bool &quad, bool &poly, bool &usgn) {
103 if (ty[off] == 'Q') {
109 if (ty[off] == 'P') {
114 // remember unsigned.
115 if (ty[off] == 'U') {
120 // base type to get the type string for.
124 /// ModType - Transform a type code and its modifiers based on a mod code. The
125 /// mod code definitions may be found at the top of arm_neon.td.
126 static char ModType(const char mod, char type, bool &quad, bool &poly,
127 bool &usgn, bool &scal, bool &cnst, bool &pntr) {
191 /// TypeString - for a modifier and type, generate the name of the typedef for
192 /// that type. QUc -> uint8x8_t.
193 static std::string TypeString(const char mod, StringRef typestr) {
206 // base type to get the type string for.
207 char type = ClassifyType(typestr, quad, poly, usgn);
209 // Based on the modifying character, change the type and width if necessary.
210 type = ModType(mod, type, quad, poly, usgn, scal, cnst, pntr);
219 s += poly ? "poly8" : "int8";
222 s += quad ? "x16" : "x8";
225 s += poly ? "poly16" : "int16";
228 s += quad ? "x8" : "x4";
234 s += quad ? "x4" : "x2";
240 s += quad ? "x2" : "x1";
246 s += quad ? "x8" : "x4";
252 s += quad ? "x4" : "x2";
255 throw "unhandled type!";
266 // Append _t, finishing the type string typedef type.
278 /// BuiltinTypeString - for a modifier and type, generate the clang
279 /// BuiltinsARM.def prototype code for the function. See the top of clang's
280 /// Builtins.def for a description of the type strings.
281 static std::string BuiltinTypeString(const char mod, StringRef typestr,
282 ClassKind ck, bool ret) {
295 // base type to get the type string for.
296 char type = ClassifyType(typestr, quad, poly, usgn);
298 // Based on the modifying character, change the type and width if necessary.
299 type = ModType(mod, type, quad, poly, usgn, scal, cnst, pntr);
310 usgn = usgn | poly | ((ck == ClassI || ck == ClassW) && scal && type != 'f');
330 // Since the return value must be one type, return a vector type of the
331 // appropriate width which we will bitcast. An exception is made for
332 // returning structs of 2, 3, or 4 vectors which are returned in a sret-like
333 // fashion, storing them to a pointer arg.
335 if (mod == '2' || mod == '3' || mod == '4')
337 if (mod == 'f' || (ck != ClassB && type == 'f'))
338 return quad ? "V4f" : "V2f";
339 if (ck != ClassB && type == 's')
340 return quad ? "V8s" : "V4s";
341 if (ck != ClassB && type == 'i')
342 return quad ? "V4i" : "V2i";
343 if (ck != ClassB && type == 'l')
344 return quad ? "V2LLi" : "V1LLi";
346 return quad ? "V16c" : "V8c";
349 // Non-return array types are passed as individual vectors.
351 return quad ? "V16cV16c" : "V8cV8c";
353 return quad ? "V16cV16cV16c" : "V8cV8cV8c";
355 return quad ? "V16cV16cV16cV16c" : "V8cV8cV8cV8c";
357 if (mod == 'f' || (ck != ClassB && type == 'f'))
358 return quad ? "V4f" : "V2f";
359 if (ck != ClassB && type == 's')
360 return quad ? "V8s" : "V4s";
361 if (ck != ClassB && type == 'i')
362 return quad ? "V4i" : "V2i";
363 if (ck != ClassB && type == 'l')
364 return quad ? "V2LLi" : "V1LLi";
366 return quad ? "V16c" : "V8c";
369 /// MangleName - Append a type or width suffix to a base neon function name,
370 /// and insert a 'q' in the appropriate location if the operation works on
371 /// 128b rather than 64b. E.g. turn "vst2_lane" into "vst2q_lane_f32", etc.
372 static std::string MangleName(const std::string &name, StringRef typestr,
374 if (name == "vcvt_f32_f16")
380 char type = ClassifyType(typestr, quad, poly, usgn);
382 std::string s = name;
387 case ClassS: s += poly ? "_p8" : usgn ? "_u8" : "_s8"; break;
388 case ClassI: s += "_i8"; break;
389 case ClassW: s += "_8"; break;
395 case ClassS: s += poly ? "_p16" : usgn ? "_u16" : "_s16"; break;
396 case ClassI: s += "_i16"; break;
397 case ClassW: s += "_16"; break;
403 case ClassS: s += usgn ? "_u32" : "_s32"; break;
404 case ClassI: s += "_i32"; break;
405 case ClassW: s += "_32"; break;
411 case ClassS: s += usgn ? "_u64" : "_s64"; break;
412 case ClassI: s += "_i64"; break;
413 case ClassW: s += "_64"; break;
420 case ClassI: s += "_f16"; break;
421 case ClassW: s += "_16"; break;
428 case ClassI: s += "_f32"; break;
429 case ClassW: s += "_32"; break;
434 throw "unhandled type!";
440 // Insert a 'q' before the first '_' character so that it ends up before
441 // _lane or _n on vector-scalar operations.
443 size_t pos = s.find('_');
444 s = s.insert(pos, "q");
449 // Generate the string "(argtype a, argtype b, ...)"
450 static std::string GenArgs(const std::string &proto, StringRef typestr) {
451 bool define = proto.find('i') != std::string::npos;
457 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
459 s += TypeString(proto[i], typestr);
471 static std::string Duplicate(unsigned nElts, StringRef typestr,
472 const std::string &a) {
475 s = "(" + TypeString('d', typestr) + "){ ";
476 for (unsigned i = 0; i != nElts; ++i) {
486 // Generate the definition for this intrinsic, e.g. "a + b" for OpAdd.
487 static std::string GenOpString(OpKind op, const std::string &proto,
489 bool dummy, quad = false;
490 char type = ClassifyType(typestr, quad, dummy, dummy);
493 case 'c': nElts = 8; break;
494 case 's': nElts = 4; break;
495 case 'i': nElts = 2; break;
496 case 'l': nElts = 1; break;
497 case 'h': nElts = 4; break;
498 case 'f': nElts = 2; break;
501 std::string ts = TypeString(proto[0], typestr);
503 if (op == OpHi || op == OpLo) {
504 s = "union { " + ts + " r; double d; } u; u.d";
519 s += "a * " + Duplicate(nElts << (int)quad, typestr, "b");
525 s += "a + (b * " + Duplicate(nElts << (int)quad, typestr, "c") + ")";
531 s += "a - (b * " + Duplicate(nElts << (int)quad, typestr, "c") + ")";
537 s += "(" + ts + ")(a == b)";
540 s += "(" + ts + ")(a >= b)";
543 s += "(" + ts + ")(a <= b)";
546 s += "(" + ts + ")(a > b)";
549 s += "(" + ts + ")(a < b)";
573 s += "(" + ts + ")a";
576 s += "__builtin_shufflevector((int64x1_t)a";
577 s += ", (int64x1_t)b, 0, 1)";
580 s += "(((float64x2_t)a)[1])";
583 s += "(((float64x2_t)a)[0])";
586 s += Duplicate(nElts << (int)quad, typestr, "a");
589 // ((0 & 1) | (~0 & 2))
590 ts = TypeString(proto[1], typestr);
591 s += "(a & (" + ts + ")b) | ";
592 s += "(~a & (" + ts + ")c)";
595 s += "__builtin_shufflevector(a, a";
596 for (unsigned i = 2; i <= nElts << (int)quad; i += 2)
597 for (unsigned j = 0; j != 2; ++j)
598 s += ", " + utostr(i - j - 1);
603 s += "__builtin_shufflevector(a, a";
604 for (unsigned i = nElts; i <= nElts << (1 + (int)quad); i += nElts)
605 for (unsigned j = 0; j != nElts; ++j)
606 s += ", " + utostr(i - j - 1);
610 s += "__builtin_shufflevector(a, a";
611 for (unsigned i = nElts; i <= nElts << (int)quad; i += nElts)
612 for (unsigned j = 0; j != nElts; ++j)
613 s += ", " + utostr(i - j - 1);
617 throw "unknown OpKind!";
620 if (op == OpHi || op == OpLo)
621 s += "; return u.r;";
627 static unsigned GetNeonEnum(const std::string &proto, StringRef typestr) {
628 unsigned mod = proto[0];
631 if (mod == 'v' || mod == 'f')
641 // Base type to get the type string for.
642 char type = ClassifyType(typestr, quad, poly, usgn);
644 // Based on the modifying character, change the type and width if necessary.
645 type = ModType(mod, type, quad, poly, usgn, scal, cnst, pntr);
649 if (quad && proto[1] != 'g')
672 throw "unhandled type!";
678 // Generate the definition for this intrinsic, e.g. __builtin_neon_cls(a)
679 static std::string GenBuiltin(const std::string &name, const std::string &proto,
680 StringRef typestr, ClassKind ck) {
681 bool dummy, quad = false;
682 char type = ClassifyType(typestr, quad, dummy, dummy);
685 case 'c': nElts = 8; break;
686 case 's': nElts = 4; break;
687 case 'i': nElts = 2; break;
688 case 'l': nElts = 1; break;
689 case 'h': nElts = 4; break;
690 case 'f': nElts = 2; break;
692 if (quad) nElts <<= 1;
697 // If this builtin returns a struct 2, 3, or 4 vectors, pass it as an implicit
698 // sret-like argument.
699 bool sret = (proto[0] == '2' || proto[0] == '3' || proto[0] == '4');
701 // If this builtin takes an immediate argument, we need to #define it rather
702 // than use a standard declaration, so that SemaChecking can range check
703 // the immediate passed by the user.
704 bool define = proto.find('i') != std::string::npos;
706 // If all types are the same size, bitcasting the args will take care
707 // of arg checking. The actual signedness etc. will be taken care of with
709 if (proto.find('s') == std::string::npos)
712 if (proto[0] != 'v') {
713 std::string ts = TypeString(proto[0], typestr);
717 s += "({ " + ts + " r; ";
718 else if (proto[0] != 's')
723 s += ts + " r; r = ";
727 bool splat = proto.find('a') != std::string::npos;
729 s += "__builtin_neon_";
731 std::string vname(name, 0, name.size()-2);
732 s += MangleName(vname, typestr, ck);
734 s += MangleName(name, typestr, ck);
738 // Pass the address of the return variable as the first argument to sret-like
743 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
744 std::string args = std::string(&arg, 1);
746 args = "(" + args + ")";
748 // Handle multiple-vector values specially, emitting each subvector as an
749 // argument to the __builtin.
750 if (proto[i] == '2' || proto[i] == '3' || proto[i] == '4') {
751 for (unsigned vi = 0, ve = proto[i] - '0'; vi != ve; ++vi) {
752 s += args + ".val[" + utostr(vi) + "]";
762 if (splat && (i + 1) == e)
763 s += Duplicate(nElts, typestr, args);
770 // Extra constant integer to hold type class enum for this function, e.g. s8
772 s += ", " + utostr(GetNeonEnum(proto, typestr));
779 if (proto[0] != 'v') {
790 static std::string GenBuiltinDef(const std::string &name,
791 const std::string &proto,
792 StringRef typestr, ClassKind ck) {
793 std::string s("BUILTIN(__builtin_neon_");
795 // If all types are the same size, bitcasting the args will take care
796 // of arg checking. The actual signedness etc. will be taken care of with
798 if (proto.find('s') == std::string::npos)
801 s += MangleName(name, typestr, ck);
804 for (unsigned i = 0, e = proto.size(); i != e; ++i)
805 s += BuiltinTypeString(proto[i], typestr, ck, i == 0);
807 // Extra constant integer to hold type class enum for this function, e.g. s8
815 /// run - Read the records in arm_neon.td and output arm_neon.h. arm_neon.h
816 /// is comprised of type definitions and function declarations.
817 void NeonEmitter::run(raw_ostream &OS) {
818 EmitSourceFileHeader("ARM NEON Header", OS);
820 // FIXME: emit license into file?
822 OS << "#ifndef __ARM_NEON_H\n";
823 OS << "#define __ARM_NEON_H\n\n";
825 OS << "#ifndef __ARM_NEON__\n";
826 OS << "#error \"NEON support not enabled\"\n";
829 OS << "#include <stdint.h>\n\n";
831 // Emit NEON-specific scalar typedefs.
832 OS << "typedef float float32_t;\n";
833 OS << "typedef uint8_t poly8_t;\n";
834 OS << "typedef uint16_t poly16_t;\n";
835 OS << "typedef uint16_t float16_t;\n";
837 // Emit Neon vector typedefs.
838 std::string TypedefTypes("cQcsQsiQilQlUcQUcUsQUsUiQUiUlQUlhQhfQfPcQPcPsQPs");
839 SmallVector<StringRef, 24> TDTypeVec;
840 ParseTypes(0, TypedefTypes, TDTypeVec);
842 // Emit vector typedefs.
843 for (unsigned i = 0, e = TDTypeVec.size(); i != e; ++i) {
844 bool dummy, quad = false;
845 (void) ClassifyType(TDTypeVec[i], quad, dummy, dummy);
846 OS << "typedef __attribute__(( __vector_size__(";
848 OS << utostr(8*(quad ? 2 : 1)) << ") )) ";
852 OS << TypeString('s', TDTypeVec[i]);
853 OS << " " << TypeString('d', TDTypeVec[i]) << ";\n";
856 OS << "typedef __attribute__(( __vector_size__(8) )) "
857 "double float64x1_t;\n";
858 OS << "typedef __attribute__(( __vector_size__(16) )) "
859 "double float64x2_t;\n";
862 // Emit struct typedefs.
863 for (unsigned vi = 2; vi != 5; ++vi) {
864 for (unsigned i = 0, e = TDTypeVec.size(); i != e; ++i) {
865 std::string ts = TypeString('d', TDTypeVec[i]);
866 std::string vs = TypeString('0' + vi, TDTypeVec[i]);
867 OS << "typedef struct " << vs << " {\n";
868 OS << " " << ts << " val";
869 OS << "[" << utostr(vi) << "]";
875 OS << "#define __ai static __attribute__((__always_inline__))\n\n";
877 std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
879 // Unique the return+pattern types, and assign them.
880 for (unsigned i = 0, e = RV.size(); i != e; ++i) {
882 std::string name = LowercaseString(R->getName());
883 std::string Proto = R->getValueAsString("Prototype");
884 std::string Types = R->getValueAsString("Types");
886 SmallVector<StringRef, 16> TypeVec;
887 ParseTypes(R, Types, TypeVec);
889 OpKind k = OpMap[R->getValueAsDef("Operand")->getName()];
891 bool define = Proto.find('i') != std::string::npos;
893 for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
894 assert(!Proto.empty() && "");
896 // static always inline + return type
900 OS << "__ai " << TypeString(Proto[0], TypeVec[ti]);
902 // Function name with type suffix
903 OS << " " << MangleName(name, TypeVec[ti], ClassS);
905 // Function arguments
906 OS << GenArgs(Proto, TypeVec[ti]);
915 OS << GenOpString(k, Proto, TypeVec[ti]);
917 if (R->getSuperClasses().size() < 2)
918 throw TGError(R->getLoc(), "Builtin has no class kind");
920 ClassKind ck = ClassMap[R->getSuperClasses()[1]];
923 throw TGError(R->getLoc(), "Builtin has no class kind");
924 OS << GenBuiltin(name, Proto, TypeVec[ti], ck);
932 OS << "#undef __ai\n\n";
933 OS << "#endif /* __ARM_NEON_H */\n";
936 static unsigned RangeFromType(StringRef typestr) {
937 // base type to get the type string for.
938 bool quad = false, dummy = false;
939 char type = ClassifyType(typestr, quad, dummy, dummy);
943 return (8 << (int)quad) - 1;
946 return (4 << (int)quad) - 1;
949 return (2 << (int)quad) - 1;
951 return (1 << (int)quad) - 1;
953 throw "unhandled type!";
956 assert(0 && "unreachable");
960 /// runHeader - Emit a file with sections defining:
961 /// 1. the NEON section of BuiltinsARM.def.
962 /// 2. the SemaChecking code for the type overload checking.
963 /// 3. the SemaChecking code for validation of intrinsic immedate arguments.
964 void NeonEmitter::runHeader(raw_ostream &OS) {
965 std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
967 StringMap<OpKind> EmittedMap;
969 // Generate BuiltinsARM.def for NEON
970 OS << "#ifdef GET_NEON_BUILTINS\n";
971 for (unsigned i = 0, e = RV.size(); i != e; ++i) {
973 OpKind k = OpMap[R->getValueAsDef("Operand")->getName()];
977 std::string Proto = R->getValueAsString("Prototype");
979 // Functions with 'a' (the splat code) in the type prototype should not get
980 // their own builtin as they use the non-splat variant.
981 if (Proto.find('a') != std::string::npos)
984 std::string Types = R->getValueAsString("Types");
985 SmallVector<StringRef, 16> TypeVec;
986 ParseTypes(R, Types, TypeVec);
988 if (R->getSuperClasses().size() < 2)
989 throw TGError(R->getLoc(), "Builtin has no class kind");
991 std::string name = LowercaseString(R->getName());
992 ClassKind ck = ClassMap[R->getSuperClasses()[1]];
994 for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
995 // Generate the BuiltinsARM.def declaration for this builtin, ensuring
996 // that each unique BUILTIN() macro appears only once in the output
998 std::string bd = GenBuiltinDef(name, Proto, TypeVec[ti], ck);
999 if (EmittedMap.count(bd))
1002 EmittedMap[bd] = OpNone;
1008 // Generate the overloaded type checking code for SemaChecking.cpp
1009 OS << "#ifdef GET_NEON_OVERLOAD_CHECK\n";
1010 for (unsigned i = 0, e = RV.size(); i != e; ++i) {
1012 OpKind k = OpMap[R->getValueAsDef("Operand")->getName()];
1016 std::string Proto = R->getValueAsString("Prototype");
1017 std::string Types = R->getValueAsString("Types");
1018 std::string name = LowercaseString(R->getName());
1020 // Functions with 'a' (the splat code) in the type prototype should not get
1021 // their own builtin as they use the non-splat variant.
1022 if (Proto.find('a') != std::string::npos)
1025 // Functions which have a scalar argument cannot be overloaded, no need to
1026 // check them if we are emitting the type checking code.
1027 if (Proto.find('s') != std::string::npos)
1030 SmallVector<StringRef, 16> TypeVec;
1031 ParseTypes(R, Types, TypeVec);
1033 if (R->getSuperClasses().size() < 2)
1034 throw TGError(R->getLoc(), "Builtin has no class kind");
1036 int si = -1, qi = -1;
1037 unsigned mask = 0, qmask = 0;
1038 for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
1039 // Generate the switch case(s) for this builtin for the type validation.
1040 bool quad = false, poly = false, usgn = false;
1041 (void) ClassifyType(TypeVec[ti], quad, poly, usgn);
1045 qmask |= 1 << GetNeonEnum(Proto, TypeVec[ti]);
1048 mask |= 1 << GetNeonEnum(Proto, TypeVec[ti]);
1052 OS << "case ARM::BI__builtin_neon_"
1053 << MangleName(name, TypeVec[si], ClassB)
1054 << ": mask = " << "0x" << utohexstr(mask) << "; break;\n";
1056 OS << "case ARM::BI__builtin_neon_"
1057 << MangleName(name, TypeVec[qi], ClassB)
1058 << ": mask = " << "0x" << utohexstr(qmask) << "; break;\n";
1062 // Generate the intrinsic range checking code for shift/lane immediates.
1063 OS << "#ifdef GET_NEON_IMMEDIATE_CHECK\n";
1064 for (unsigned i = 0, e = RV.size(); i != e; ++i) {
1067 OpKind k = OpMap[R->getValueAsDef("Operand")->getName()];
1071 std::string name = LowercaseString(R->getName());
1072 std::string Proto = R->getValueAsString("Prototype");
1073 std::string Types = R->getValueAsString("Types");
1075 // Functions with 'a' (the splat code) in the type prototype should not get
1076 // their own builtin as they use the non-splat variant.
1077 if (Proto.find('a') != std::string::npos)
1080 // Functions which do not have an immediate do not need to have range
1081 // checking code emitted.
1082 if (Proto.find('i') == std::string::npos)
1085 SmallVector<StringRef, 16> TypeVec;
1086 ParseTypes(R, Types, TypeVec);
1088 if (R->getSuperClasses().size() < 2)
1089 throw TGError(R->getLoc(), "Builtin has no class kind");
1091 ClassKind ck = ClassMap[R->getSuperClasses()[1]];
1093 for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
1094 std::string namestr, shiftstr, rangestr;
1096 // Builtins which are overloaded by type will need to have their upper
1097 // bound computed at Sema time based on the type constant.
1098 if (Proto.find('s') == std::string::npos) {
1100 if (R->getValueAsBit("isShift")) {
1101 shiftstr = ", true";
1103 // Right shifts have an 'r' in the name, left shifts do not.
1104 if (name.find('r') != std::string::npos)
1105 rangestr = "l = 1; ";
1107 rangestr += "u = RFT(TV" + shiftstr + ")";
1109 rangestr = "u = " + utostr(RangeFromType(TypeVec[ti]));
1111 // Make sure cases appear only once by uniquing them in a string map.
1112 namestr = MangleName(name, TypeVec[ti], ck);
1113 if (EmittedMap.count(namestr))
1115 EmittedMap[namestr] = OpNone;
1117 // Calculate the index of the immediate that should be range checked.
1118 unsigned immidx = 0;
1120 // Builtins that return a struct of multiple vectors have an extra
1121 // leading arg for the struct return.
1122 if (Proto[0] == '2' || Proto[0] == '3' || Proto[0] == '4')
1125 // Add one to the index for each argument until we reach the immediate
1126 // to be checked. Structs of vectors are passed as multiple arguments.
1127 for (unsigned ii = 1, ie = Proto.size(); ii != ie; ++ii) {
1128 switch (Proto[ii]) {
1129 default: immidx += 1; break;
1130 case '2': immidx += 2; break;
1131 case '3': immidx += 3; break;
1132 case '4': immidx += 4; break;
1133 case 'i': ie = ii + 1; break;
1136 OS << "case ARM::BI__builtin_neon_" << MangleName(name, TypeVec[ti], ck)
1137 << ": i = " << immidx << "; " << rangestr << "; break;\n";