Changeset View
Changeset View
Standalone View
Standalone View
llvm/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 2,703 Lines • ▼ Show 20 Lines | unsigned X86TargetLowering::getJumpTableEncoding() const { | ||||
// symbol. | // symbol. | ||||
if (isPositionIndependent() && Subtarget.isPICStyleGOT()) | if (isPositionIndependent() && Subtarget.isPICStyleGOT()) | ||||
return MachineJumpTableInfo::EK_Custom32; | return MachineJumpTableInfo::EK_Custom32; | ||||
// Otherwise, use the normal jump table encoding heuristics. | // Otherwise, use the normal jump table encoding heuristics. | ||||
return TargetLowering::getJumpTableEncoding(); | return TargetLowering::getJumpTableEncoding(); | ||||
} | } | ||||
bool X86TargetLowering::splitValueIntoRegisterParts( | |||||
SelectionDAG &DAG, const SDLoc &DL, SDValue Val, SDValue *Parts, | |||||
unsigned NumParts, MVT PartVT, Optional<CallingConv::ID> CC) const { | |||||
bool IsABIRegCopy = CC.has_value(); | |||||
EVT ValueVT = Val.getValueType(); | |||||
if (IsABIRegCopy && ValueVT == MVT::bf16 && PartVT == MVT::f32) { | |||||
unsigned ValueBits = ValueVT.getSizeInBits(); | |||||
unsigned PartBits = PartVT.getSizeInBits(); | |||||
Val = DAG.getNode(ISD::BITCAST, DL, MVT::getIntegerVT(ValueBits), Val); | |||||
Val = DAG.getNode(ISD::ANY_EXTEND, DL, MVT::getIntegerVT(PartBits), Val); | |||||
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val); | |||||
Parts[0] = Val; | |||||
return true; | |||||
} | |||||
return false; | |||||
} | |||||
SDValue X86TargetLowering::joinRegisterPartsIntoValue( | |||||
SelectionDAG &DAG, const SDLoc &DL, const SDValue *Parts, unsigned NumParts, | |||||
MVT PartVT, EVT ValueVT, Optional<CallingConv::ID> CC) const { | |||||
bool IsABIRegCopy = CC.has_value(); | |||||
if (IsABIRegCopy && ValueVT == MVT::bf16 && PartVT == MVT::f32) { | |||||
unsigned ValueBits = ValueVT.getSizeInBits(); | |||||
unsigned PartBits = PartVT.getSizeInBits(); | |||||
SDValue Val = Parts[0]; | |||||
Val = DAG.getNode(ISD::BITCAST, DL, MVT::getIntegerVT(PartBits), Val); | |||||
Val = DAG.getNode(ISD::TRUNCATE, DL, MVT::getIntegerVT(ValueBits), Val); | |||||
Val = DAG.getNode(ISD::BITCAST, DL, ValueVT, Val); | |||||
return Val; | |||||
} | |||||
return SDValue(); | |||||
} | |||||
bool X86TargetLowering::useSoftFloat() const { | bool X86TargetLowering::useSoftFloat() const { | ||||
return Subtarget.useSoftFloat(); | return Subtarget.useSoftFloat(); | ||||
} | } | ||||
void X86TargetLowering::markLibCallAttributes(MachineFunction *MF, unsigned CC, | void X86TargetLowering::markLibCallAttributes(MachineFunction *MF, unsigned CC, | ||||
ArgListTy &Args) const { | ArgListTy &Args) const { | ||||
// Only relabel X86-32 for C / Stdcall CCs. | // Only relabel X86-32 for C / Stdcall CCs. | ||||
▲ Show 20 Lines • Show All 32,759 Lines • Show Last 20 Lines |