Changeset View
Changeset View
Standalone View
Standalone View
lib/Target/X86/X86ISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4,792 Lines • ▼ Show 20 Lines | bool X86TargetLowering::preferShiftsToClearExtremeBits(SDValue Y) const { | ||||
// 64-bit shifts on 32-bit targets produce really bad bloated code. | // 64-bit shifts on 32-bit targets produce really bad bloated code. | ||||
if (VT == MVT::i64 && !Subtarget.is64Bit()) | if (VT == MVT::i64 && !Subtarget.is64Bit()) | ||||
return false; | return false; | ||||
return true; | return true; | ||||
} | } | ||||
bool X86TargetLowering::shouldTransformSignedTruncationCheck( | |||||
EVT XVT, unsigned KeptBits) const { | |||||
spatel: Any reason this is in the header file for AArch but in the cpp file for x86? | |||||
lebedev.riAuthorUnsubmitted Not Done ReplyInline ActionsThat seems to be the way the other hooks are defined - in source for X86, in header for aarch64. lebedev.ri: That seems to be the way the other hooks are defined - in source for X86, in header for aarch64. | |||||
spatelUnsubmitted Not Done ReplyInline ActionsHmm...it's a matter of taste where we draw the "too-complex-for-a-header" line. But in this case, I'd prefer that we disregard the target pref and make identical overrides have the same form, so it's clear that there's no difference between these targets. Go with the header version since that's smaller? spatel: Hmm...it's a matter of taste where we draw the "too-complex-for-a-header" line. But in this… | |||||
lebedev.riAuthorUnsubmitted Not Done ReplyInline ActionsOK. lebedev.ri: OK. | |||||
// For vectors, we don't have a preference.. | |||||
if (XVT.isVector()) | |||||
return false; | |||||
auto VTIsOk = [](EVT VT) -> bool { | |||||
return VT == MVT::i8 || VT == MVT::i16 || VT == MVT::i32 || VT == MVT::i64; | |||||
}; | |||||
// We are ok with KeptBitsVT being byte/word/dword, what MOVS supports. | |||||
// XVT will be larger than KeptBitsVT. | |||||
MVT KeptBitsVT = MVT::getIntegerVT(KeptBits); | |||||
return VTIsOk(XVT) && VTIsOk(KeptBitsVT); | |||||
} | |||||
MVT X86TargetLowering::hasFastEqualityCompare(unsigned NumBits) const { | MVT X86TargetLowering::hasFastEqualityCompare(unsigned NumBits) const { | ||||
MVT VT = MVT::getIntegerVT(NumBits); | MVT VT = MVT::getIntegerVT(NumBits); | ||||
if (isTypeLegal(VT)) | if (isTypeLegal(VT)) | ||||
return VT; | return VT; | ||||
// PMOVMSKB can handle this. | // PMOVMSKB can handle this. | ||||
if (NumBits == 128 && isTypeLegal(MVT::v16i8)) | if (NumBits == 128 && isTypeLegal(MVT::v16i8)) | ||||
return MVT::v16i8; | return MVT::v16i8; | ||||
▲ Show 20 Lines • Show All 35,724 Lines • Show Last 20 Lines |
Any reason this is in the header file for AArch but in the cpp file for x86?