Lines Matching refs:proto
468 static bool UseMacro(const std::string &proto) {
472 if (proto.find('i') != std::string::npos)
477 if (proto.find('p') != std::string::npos ||
478 proto.find('c') != std::string::npos)
487 static bool MacroArgUsedDirectly(const std::string &proto, unsigned i) {
488 return (proto[i] == 'i' || proto[i] == 'p' || proto[i] == 'c');
492 static std::string GenArgs(const std::string &proto, StringRef typestr) {
493 bool define = UseMacro(proto);
499 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
504 if (MacroArgUsedDirectly(proto, i))
507 s += TypeString(proto[i], typestr) + " __";
520 static std::string GenMacroLocals(const std::string &proto, StringRef typestr) {
525 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
528 if (proto[i] == 'i')
535 if (MacroArgUsedDirectly(proto, i)) {
536 s += TypeString(proto[i], typestr) + " __";
546 s += TypeString(proto[i], typestr) + " __";
611 static std::string GenOpString(OpKind op, const std::string &proto,
615 bool define = UseMacro(proto);
617 std::string ts = TypeString(proto[0], typestr);
775 ts = TypeString(proto[1], typestr);
809 s += "(" + TypeString(proto[0], typestr) + ")";
826 s += "(" + TypeString(proto[0], typestr) + ")";
841 static unsigned GetNeonEnum(const std::string &proto, StringRef typestr) {
842 unsigned mod = proto[0];
846 mod = proto[1];
863 if (quad && proto[1] != 'g')
893 static std::string GenBuiltin(const std::string &name, const std::string &proto,
899 bool sret = (proto[0] >= '2' && proto[0] <= '4');
901 bool define = UseMacro(proto);
906 if (proto.find('s') == std::string::npos)
909 if (proto[0] != 'v') {
910 std::string ts = TypeString(proto[0], typestr);
924 bool splat = proto.find('a') != std::string::npos;
942 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
954 argType = ModType(proto[i], argType, argQuad, argPoly, argUsgn, argScalar,
959 if (proto[i] >= '2' && proto[i] <= '4') {
964 for (unsigned vi = 0, ve = proto[i] - '0'; vi != ve; ++vi) {
996 s += ", " + utostr(GetNeonEnum(proto, typestr));
1000 if (proto[0] != 'v' && sret) {
1010 const std::string &proto,
1017 if (proto.find('s') == std::string::npos)
1023 for (unsigned i = 0, e = proto.size(); i != e; ++i)
1024 s += BuiltinTypeString(proto[i], typestr, ck, i == 0);
1035 const std::string &proto,
1038 assert(!proto.empty() && "");
1039 bool define = UseMacro(proto);
1046 s += "__ai " + TypeString(proto[0], outTypeStr) + " ";
1061 s += GenArgs(proto, inTypeStr);
1066 s += GenMacroLocals(proto, inTypeStr);
1072 s += GenOpString(kind, proto, outTypeStr);
1074 s += GenBuiltin(name, proto, outTypeStr, classKind);
1204 std::string Proto = R->getValueAsString("Prototype");
1229 OS << GenIntrinsic(name, Proto, TypeVec[ti], TypeVec[srcti],
1233 OS << GenIntrinsic(name, Proto, TypeVec[ti], TypeVec[ti],
1282 std::string Proto = R->getValueAsString("Prototype");
1286 if (Proto.find('a') != std::string::npos)
1303 std::string bd = GenBuiltinDef(name, Proto, TypeVec[ti], ck);
1321 std::string Proto = R->getValueAsString("Prototype");
1327 if (Proto.find('a') != std::string::npos)
1332 if (Proto.find('s') != std::string::npos)
1350 qmask |= 1 << GetNeonEnum(Proto, TypeVec[ti]);
1353 mask |= 1 << GetNeonEnum(Proto, TypeVec[ti]);
1377 std::string Proto = R->getValueAsString("Prototype");
1382 if (Proto.find('a') != std::string::npos)
1387 size_t immPos = Proto.find('i');
1407 } else if (Proto.find('s') == std::string::npos) {
1422 rangestr = "u = " + utostr(RangeFromType(Proto[immPos-1], TypeVec[ti]));
1435 if (Proto[0] >= '2' && Proto[0] <= '4')
1440 for (unsigned ii = 1, ie = Proto.size(); ii != ie; ++ii) {
1441 switch (Proto[ii]) {
1459 const std::string &proto,
1462 assert(!proto.empty() && "");
1481 s += TypeString(proto[0], outTypeStr) + " test_" + mangledName + "(";
1484 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
1486 if (proto[i] == 'i')
1488 s += comma + TypeString(proto[i], inTypeStr) + " ";
1494 if (proto[0] != 'v')
1498 for (unsigned i = 1, e = proto.size(); i != e; ++i, ++arg) {
1499 if (proto[i] == 'i') {
1505 s += utostr(RangeFromType(proto[i-1], inTypeStr));
1530 std::string Proto = R->getValueAsString("Prototype");
1549 OS << GenTest(name, Proto, TypeVec[ti], TypeVec[srcti], isShift);
1552 OS << GenTest(name, Proto, TypeVec[ti], TypeVec[ti], isShift);