@@ -578,6 +578,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
578
578
// FIXME - use subtarget debug flags
579
579
if (!Subtarget.isTargetDarwin() && !Subtarget.isTargetELF() &&
580
580
!Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64() &&
581
+ !Subtarget.isTargetUEFI64() &&
581
582
TM.Options.ExceptionModel != ExceptionHandling::SjLj) {
582
583
setOperationAction(ISD::EH_LABEL, MVT::Other, Expand);
583
584
}
@@ -2543,7 +2544,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
2543
2544
setOperationAction(ISD::FSINCOS, MVT::f32, Custom);
2544
2545
}
2545
2546
2546
- if (Subtarget.isTargetWin64()) {
2547
+ if (Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64() ) {
2547
2548
setOperationAction(ISD::SDIV, MVT::i128, Custom);
2548
2549
setOperationAction(ISD::UDIV, MVT::i128, Custom);
2549
2550
setOperationAction(ISD::SREM, MVT::i128, Custom);
@@ -19656,7 +19657,8 @@ SDValue X86TargetLowering::LowerSINT_TO_FP(SDValue Op,
19656
19657
else if (isLegalConversion(SrcVT, true, Subtarget))
19657
19658
return Op;
19658
19659
19659
- if (Subtarget.isTargetWin64() && SrcVT == MVT::i128)
19660
+ if ((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
19661
+ SrcVT == MVT::i128)
19660
19662
return LowerWin64_INT128_TO_FP(Op, DAG);
19661
19663
19662
19664
if (SDValue Extract = vectorizeExtractedCast(Op, dl, DAG, Subtarget))
@@ -20163,7 +20165,8 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op,
20163
20165
if (DstVT.isVector())
20164
20166
return lowerUINT_TO_FP_vec(Op, dl, DAG, Subtarget);
20165
20167
20166
- if (Subtarget.isTargetWin64() && SrcVT == MVT::i128)
20168
+ if ((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
20169
+ SrcVT == MVT::i128)
20167
20170
return LowerWin64_INT128_TO_FP(Op, DAG);
20168
20171
20169
20172
if (SDValue Extract = vectorizeExtractedCast(Op, dl, DAG, Subtarget))
@@ -27880,7 +27883,6 @@ Register X86TargetLowering::getRegisterByName(const char* RegName, LLT VT,
27880
27883
.Case("r14", X86::R14)
27881
27884
.Case("r15", X86::R15)
27882
27885
.Default(0);
27883
-
27884
27886
if (Reg == X86::EBP || Reg == X86::RBP) {
27885
27887
if (!TFI.hasFP(MF))
27886
27888
report_fatal_error("register " + StringRef(RegName) +
@@ -27924,7 +27926,7 @@ Register X86TargetLowering::getExceptionSelectorRegister(
27924
27926
}
27925
27927
27926
27928
bool X86TargetLowering::needsFixedCatchObjects() const {
27927
- return Subtarget.isTargetWin64();
27929
+ return Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64() ;
27928
27930
}
27929
27931
27930
27932
SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const {
@@ -29515,7 +29517,8 @@ static SDValue LowerMULO(SDValue Op, const X86Subtarget &Subtarget,
29515
29517
}
29516
29518
29517
29519
SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) const {
29518
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29520
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29521
+ "Unexpected target");
29519
29522
EVT VT = Op.getValueType();
29520
29523
assert(VT.isInteger() && VT.getSizeInBits() == 128 &&
29521
29524
"Unexpected return type for lowering");
@@ -29582,7 +29585,8 @@ SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) cons
29582
29585
SDValue X86TargetLowering::LowerWin64_FP_TO_INT128(SDValue Op,
29583
29586
SelectionDAG &DAG,
29584
29587
SDValue &Chain) const {
29585
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29588
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29589
+ "Unexpected target");
29586
29590
EVT VT = Op.getValueType();
29587
29591
bool IsStrict = Op->isStrictFPOpcode();
29588
29592
@@ -29615,7 +29619,8 @@ SDValue X86TargetLowering::LowerWin64_FP_TO_INT128(SDValue Op,
29615
29619
29616
29620
SDValue X86TargetLowering::LowerWin64_INT128_TO_FP(SDValue Op,
29617
29621
SelectionDAG &DAG) const {
29618
- assert(Subtarget.isTargetWin64() && "Unexpected target");
29622
+ assert((Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64()) &&
29623
+ "Unexpected target");
29619
29624
EVT VT = Op.getValueType();
29620
29625
bool IsStrict = Op->isStrictFPOpcode();
29621
29626
@@ -33861,7 +33866,8 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33861
33866
return;
33862
33867
}
33863
33868
33864
- if (VT == MVT::i128 && Subtarget.isTargetWin64()) {
33869
+ if (VT == MVT::i128 &&
33870
+ (Subtarget.isTargetWin64() || Subtarget.isTargetUEFI64())) {
33865
33871
SDValue Chain;
33866
33872
SDValue V = LowerWin64_FP_TO_INT128(SDValue(N, 0), DAG, Chain);
33867
33873
Results.push_back(V);
@@ -37136,6 +37142,8 @@ X86TargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
37136
37142
// N.B. the order the invoke BBs are processed in doesn't matter here.
37137
37143
SmallVector<MachineBasicBlock *, 64> MBBLPads;
37138
37144
const MCPhysReg *SavedRegs = MF->getRegInfo().getCalleeSavedRegs();
37145
+ // llvm::outs() << "Callee saved regs from isellowering " <<
37146
+ // SavedRegs->
37139
37147
for (MachineBasicBlock *MBB : InvokeBBs) {
37140
37148
// Remove the landing pad successor from the invoke block and replace it
37141
37149
// with the new dispatch block.
@@ -60753,8 +60761,8 @@ bool X86TargetLowering::hasStackProbeSymbol(const MachineFunction &MF) const {
60753
60761
/// Returns true if stack probing through inline assembly is requested.
60754
60762
bool X86TargetLowering::hasInlineStackProbe(const MachineFunction &MF) const {
60755
60763
60756
- // No inline stack probe for Windows, they have their own mechanism.
60757
- if (Subtarget.isOSWindows() ||
60764
+ // No inline stack probe for Windows and UEFI , they have their own mechanism.
60765
+ if (Subtarget.isOSWindows() || Subtarget.isUEFI() ||
60758
60766
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
60759
60767
return false;
60760
60768
@@ -60778,9 +60786,10 @@ X86TargetLowering::getStackProbeSymbolName(const MachineFunction &MF) const {
60778
60786
if (MF.getFunction().hasFnAttribute("probe-stack"))
60779
60787
return MF.getFunction().getFnAttribute("probe-stack").getValueAsString();
60780
60788
60781
- // Generally, if we aren't on Windows, the platform ABI does not include
60782
- // support for stack probes, so don't emit them.
60783
- if (!Subtarget.isOSWindows() || Subtarget.isTargetMachO() ||
60789
+ // Generally, if we aren't on Windows or UEFI, the platform ABI does not
60790
+ // include support for stack probes, so don't emit them.
60791
+ if (!(Subtarget.isOSWindows() || Subtarget.isUEFI()) ||
60792
+ Subtarget.isTargetMachO() ||
60784
60793
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
60785
60794
return "";
60786
60795
0 commit comments