Skip to content

Commit c300ab6

Browse files
committed
Added isVector() condition to avoid scalar constants.
1 parent 2895e5e commit c300ab6

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

clang/utils/TableGen/NeonEmitter.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,22 +1401,19 @@ void Intrinsic::emitBodyAsBuiltinCall() {
14011401
if (LocalCK == ClassB || (T.isHalf() && !T.isScalarForMangling())) {
14021402
CastToType.makeInteger(8, true);
14031403
Arg = "__builtin_bit_cast(" + CastToType.str() + ", " + Arg + ")";
1404+
} else if ((T.isPoly() || (T.isVector() && T.isInteger() && !T.isSigned() &&
1405+
(StringRef(Name).contains("_p8") ||
1406+
StringRef(Name).contains("_p16") ||
1407+
StringRef(Name).contains("_p64"))))) {
1408+
CastToType.makeSigned();
1409+
Arg = "__builtin_bit_cast(" + CastToType.str() + ", " + Arg + ")";
1410+
} else if (LocalCK == ClassI && CastToType.isInteger()) {
1411+
CastToType.makeSigned();
1412+
Arg = "__builtin_bit_cast(" + CastToType.str() + ", " + Arg + ")";
14041413
}
1405-
else if ((T.isPoly() ||
1406-
(T.isInteger() && !T.isSigned() &&
1407-
StringRef(Name).contains("_p8")) ||
1408-
StringRef(Name).contains("_p16") ||
1409-
StringRef(Name).contains("_p64"))) {
1410-
CastToType.makeSigned();
1411-
Arg = "__builtin_bit_cast(" + CastToType.str() + ", " + Arg + ")";
1412-
}
1413-
} else if (LocalCK == ClassI) {
1414-
if (CastToType.isInteger()) {
1415-
CastToType.makeSigned();
1416-
Arg = "__builtin_bit_cast(" + CastToType.str() + ", " + Arg + ")";
1417-
}
14181414
}
14191415

1416+
14201417
S += Arg + ", ";
14211418
}
14221419

0 commit comments

Comments
 (0)