diff options
Diffstat (limited to 'llvm/lib/Target/Mips/MipsISelLowering.h')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index 84ad40d6bbbe..ee1ab6a17a91 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -247,14 +247,16 @@ class TargetRegisterClass; DOUBLE_SELECT_I64, // Load/Store Left/Right nodes. - LWL = ISD::FIRST_TARGET_MEMORY_OPCODE, + FIRST_MEMORY_OPCODE, + LWL = FIRST_MEMORY_OPCODE, LWR, SWL, SWR, LDL, LDR, SDL, - SDR + SDR, + LAST_MEMORY_OPCODE = SDR, }; } // ene namespace MipsISD @@ -365,6 +367,8 @@ class TargetRegisterClass; return ABI.IsN64() ? Mips::A1_64 : Mips::A1; } + bool softPromoteHalfType() const override { return true; } + bool isJumpTableRelative() const override { return getTargetMachine().isPositionIndependent(); } @@ -485,6 +489,33 @@ class TargetRegisterClass; DAG.getNode(MipsISD::GPRel, DL, DAG.getVTList(Ty), GPRel)); } + // This method creates the following nodes, which are necessary for + // loading a dllimported symbol: + // + // (lw (add (shl(%high(sym), 16), %low(sym))) + template <class NodeTy> + SDValue getDllimportSymbol(NodeTy *N, const SDLoc &DL, EVT Ty, + SelectionDAG &DAG) const { + SDValue Hi = + getTargetNode(N, Ty, DAG, MipsII::MO_ABS_HI | MipsII::MO_DLLIMPORT); + SDValue Lo = + getTargetNode(N, Ty, DAG, MipsII::MO_ABS_LO | MipsII::MO_DLLIMPORT); + return DAG.getNode(ISD::ADD, DL, Ty, DAG.getNode(MipsISD::Lo, DL, Ty, Lo), + DAG.getNode(MipsISD::Hi, DL, Ty, Hi)); + } + + // This method creates the following nodes, which are necessary for + // loading a dllimported global variable: + // + // (lw (lw (add (shl(%high(sym), 16), %low(sym)))) + template <class NodeTy> + SDValue getDllimportVariable(NodeTy *N, const SDLoc &DL, EVT Ty, + SelectionDAG &DAG, SDValue Chain, + const MachinePointerInfo &PtrInfo) const { + return DAG.getLoad(Ty, DL, Chain, getDllimportSymbol(N, DL, Ty, DAG), + PtrInfo); + } + /// This function fills Ops, which is the list of operands that will later /// be used when a function call node is created. It also generates /// copyToReg nodes to set up argument registers. @@ -550,6 +581,7 @@ class TargetRegisterClass; bool HasExtractInsert) const; SDValue lowerFABS64(SDValue Op, SelectionDAG &DAG, bool HasExtractInsert) const; + SDValue lowerFCANONICALIZE(SDValue Op, SelectionDAG &DAG) const; SDValue lowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; SDValue lowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; SDValue lowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const; @@ -610,7 +642,7 @@ class TargetRegisterClass; bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, - LLVMContext &Context) const override; + LLVMContext &Context, const Type *RetTy) const override; SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, @@ -620,7 +652,7 @@ class TargetRegisterClass; SDValue LowerInterruptReturn(SmallVectorImpl<SDValue> &RetOps, const SDLoc &DL, SelectionDAG &DAG) const; - bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const override; + bool shouldSignExtendTypeInLibCall(Type *Ty, bool IsSigned) const override; // Inline asm support ConstraintType getConstraintType(StringRef Constraint) const override; |
