Changeset View
Changeset View
Standalone View
Standalone View
clang/utils/TableGen/NeonEmitter.cpp
Show First 20 Lines • Show All 1,407 Lines • ▼ Show 20 Lines | for (unsigned I = 0; I < getNumParams(); ++I) { | ||||
Variable &V = Variables["p" + utostr(I)]; | Variable &V = Variables["p" + utostr(I)]; | ||||
Type T = V.getType(); | Type T = V.getType(); | ||||
// Handle multiple-vector values specially, emitting each subvector as an | // Handle multiple-vector values specially, emitting each subvector as an | ||||
// argument to the builtin. | // argument to the builtin. | ||||
if (T.getNumVectors() > 1) { | if (T.getNumVectors() > 1) { | ||||
// Check if an explicit cast is needed. | // Check if an explicit cast is needed. | ||||
std::string Cast; | std::string Cast; | ||||
if (T.isChar() || T.isPoly() || !T.isSigned()) { | if (LocalCK == ClassB) { | ||||
Type T2 = T; | Type T2 = T; | ||||
T2.makeOneVector(); | T2.makeOneVector(); | ||||
T2.makeInteger(8, /*Signed=*/true); | T2.makeInteger(8, /*Signed=*/true); | ||||
Cast = "(" + T2.str() + ")"; | Cast = "(" + T2.str() + ")"; | ||||
} | } | ||||
for (unsigned J = 0; J < T.getNumVectors(); ++J) | for (unsigned J = 0; J < T.getNumVectors(); ++J) | ||||
S += Cast + V.getName() + ".val[" + utostr(J) + "], "; | S += Cast + V.getName() + ".val[" + utostr(J) + "], "; | ||||
Show All 15 Lines | for (unsigned I = 0; I < getNumParams(); ++I) { | ||||
} else { | } else { | ||||
Arg = V.getName(); | Arg = V.getName(); | ||||
} | } | ||||
// Check if an explicit cast is needed. | // Check if an explicit cast is needed. | ||||
if (CastToType.isVector() && LocalCK == ClassB) { | if (CastToType.isVector() && LocalCK == ClassB) { | ||||
CastToType.makeInteger(8, true); | CastToType.makeInteger(8, true); | ||||
Arg = "(" + CastToType.str() + ")" + Arg; | Arg = "(" + CastToType.str() + ")" + Arg; | ||||
} else if (CastToType.isVector() && LocalCK == ClassI) { | |||||
CastToType.makeSigned(); | |||||
Arg = "(" + CastToType.str() + ")" + Arg; | |||||
} | } | ||||
S += Arg + ", "; | S += Arg + ", "; | ||||
} | } | ||||
// Extra constant integer to hold type class enum for this function, e.g. s8 | // Extra constant integer to hold type class enum for this function, e.g. s8 | ||||
if (getClassKind(true) == ClassB) { | if (getClassKind(true) == ClassB) { | ||||
Type ThisTy = getReturnType(); | Type ThisTy = getReturnType(); | ||||
▲ Show 20 Lines • Show All 1,192 Lines • Show Last 20 Lines |