@@ -576,6 +576,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
576
576
// FIXME - use subtarget debug flags
577
577
if (!Subtarget.isTargetDarwin() && !Subtarget.isTargetELF() &&
578
578
!Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64() &&
579
+ !Subtarget.isTargetUEFI64() &&
579
580
TM.Options.ExceptionModel != ExceptionHandling::SjLj) {
580
581
setOperationAction(ISD::EH_LABEL, MVT::Other, Expand);
581
582
}
@@ -2521,7 +2522,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
2521
2522
setOperationAction(ISD::FSINCOS, MVT::f32, Custom);
2522
2523
}
2523
2524
2524
- if (Subtarget.isTargetWin64()) {
2525
+ if (Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64() ) {
2525
2526
setOperationAction(ISD::SDIV, MVT::i128, Custom);
2526
2527
setOperationAction(ISD::UDIV, MVT::i128, Custom);
2527
2528
setOperationAction(ISD::SREM, MVT::i128, Custom);
@@ -19487,7 +19488,8 @@ SDValue X86TargetLowering::LowerSINT_TO_FP(SDValue Op,
19487
19488
else if (isLegalConversion(SrcVT, true, Subtarget))
19488
19489
return Op;
19489
19490
19490
- if (Subtarget.isTargetWin64() && SrcVT == MVT::i128)
19491
+ if ((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
19492
+ SrcVT == MVT::i128)
19491
19493
return LowerWin64_INT128_TO_FP(Op, DAG);
19492
19494
19493
19495
if (SDValue Extract = vectorizeExtractedCast(Op, dl, DAG, Subtarget))
@@ -19994,7 +19996,8 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op,
19994
19996
if (DstVT.isVector())
19995
19997
return lowerUINT_TO_FP_vec(Op, dl, DAG, Subtarget);
19996
19998
19997
- if (Subtarget.isTargetWin64() && SrcVT == MVT::i128)
19999
+ if ((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
20000
+ SrcVT == MVT::i128)
19998
20001
return LowerWin64_INT128_TO_FP(Op, DAG);
19999
20002
20000
20003
if (SDValue Extract = vectorizeExtractedCast(Op, dl, DAG, Subtarget))
@@ -27626,7 +27629,6 @@ Register X86TargetLowering::getRegisterByName(const char* RegName, LLT VT,
27626
27629
.Case("r14", X86::R14)
27627
27630
.Case("r15", X86::R15)
27628
27631
.Default(0);
27629
-
27630
27632
if (Reg == X86::EBP || Reg == X86::RBP) {
27631
27633
if (!TFI.hasFP(MF))
27632
27634
report_fatal_error("register " + StringRef(RegName) +
@@ -27670,7 +27672,7 @@ Register X86TargetLowering::getExceptionSelectorRegister(
27670
27672
}
27671
27673
27672
27674
bool X86TargetLowering::needsFixedCatchObjects() const {
27673
- return Subtarget.isTargetWin64();
27675
+ return Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64() ;
27674
27676
}
27675
27677
27676
27678
SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const {
@@ -29224,7 +29226,8 @@ static SDValue LowerMULO(SDValue Op, const X86Subtarget &Subtarget,
29224
29226
}
29225
29227
29226
29228
SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) const {
29227
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29229
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29230
+ "Unexpected target");
29228
29231
EVT VT = Op.getValueType();
29229
29232
assert(VT.isInteger() && VT.getSizeInBits() == 128 &&
29230
29233
"Unexpected return type for lowering");
@@ -29291,7 +29294,8 @@ SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) cons
29291
29294
SDValue X86TargetLowering::LowerWin64_FP_TO_INT128(SDValue Op,
29292
29295
SelectionDAG &DAG,
29293
29296
SDValue &Chain) const {
29294
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29297
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29298
+ "Unexpected target");
29295
29299
EVT VT = Op.getValueType();
29296
29300
bool IsStrict = Op->isStrictFPOpcode();
29297
29301
@@ -29324,7 +29328,8 @@ SDValue X86TargetLowering::LowerWin64_FP_TO_INT128(SDValue Op,
29324
29328
29325
29329
SDValue X86TargetLowering::LowerWin64_INT128_TO_FP(SDValue Op,
29326
29330
SelectionDAG &DAG) const {
29327
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29331
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29332
+ "Unexpected target");
29328
29333
EVT VT = Op.getValueType();
29329
29334
bool IsStrict = Op->isStrictFPOpcode();
29330
29335
@@ -33564,7 +33569,8 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33564
33569
return;
33565
33570
}
33566
33571
33567
- if (VT == MVT::i128 && Subtarget.isTargetWin64()) {
33572
+ if (VT == MVT::i128 &&
33573
+ (Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64())) {
33568
33574
SDValue Chain;
33569
33575
SDValue V = LowerWin64_FP_TO_INT128(SDValue(N, 0), DAG, Chain);
33570
33576
Results.push_back(V);
@@ -36945,6 +36951,8 @@ X86TargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
36945
36951
// N.B. the order the invoke BBs are processed in doesn't matter here.
36946
36952
SmallVector<MachineBasicBlock *, 64> MBBLPads;
36947
36953
const MCPhysReg *SavedRegs = MF->getRegInfo().getCalleeSavedRegs();
36954
+ // llvm::outs() << "Callee saved regs from isellowering " <<
36955
+ // SavedRegs->
36948
36956
for (MachineBasicBlock *MBB : InvokeBBs) {
36949
36957
// Remove the landing pad successor from the invoke block and replace it
36950
36958
// with the new dispatch block.
@@ -60153,8 +60161,8 @@ bool X86TargetLowering::hasStackProbeSymbol(const MachineFunction &MF) const {
60153
60161
/// Returns true if stack probing through inline assembly is requested.
60154
60162
bool X86TargetLowering::hasInlineStackProbe(const MachineFunction &MF) const {
60155
60163
60156
- // No inline stack probe for Windows, they have their own mechanism.
60157
- if (Subtarget.isOSWindows() ||
60164
+ // No inline stack probe for Windows and UEFI , they have their own mechanism.
60165
+ if (Subtarget.isOSWindows() || Subtarget.isUEFI() ||
60158
60166
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
60159
60167
return false;
60160
60168
@@ -60178,9 +60186,10 @@ X86TargetLowering::getStackProbeSymbolName(const MachineFunction &MF) const {
60178
60186
if (MF.getFunction().hasFnAttribute("probe-stack"))
60179
60187
return MF.getFunction().getFnAttribute("probe-stack").getValueAsString();
60180
60188
60181
- // Generally, if we aren't on Windows, the platform ABI does not include
60182
- // support for stack probes, so don't emit them.
60183
- if (!Subtarget.isOSWindows() || Subtarget.isTargetMachO() ||
60189
+ // Generally, if we aren't on Windows or UEFI, the platform ABI does not
60190
+ // include support for stack probes, so don't emit them.
60191
+ if (!(Subtarget.isOSWindows() || Subtarget.isUEFI()) ||
60192
+ Subtarget.isTargetMachO() ||
60184
60193
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
60185
60194
return "";
60186
60195
0 commit comments