SDValue MSP430TargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const { DebugLoc dl = Op.getDebugLoc(); const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress(); SDValue Result = DAG.getBlockAddress(BA, getPointerTy(), /*isTarget=*/true); return DAG.getNode(MSP430ISD::Wrapper, dl, getPointerTy(), Result);; }
SDValue AVM2TargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const { const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress(); SDValue Result = DAG.getBlockAddress(BA, getPointerTy(), /*isTarget=*/true, 0); return Result; }
SDValue Cpu0TargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const { const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress(); // FIXME there isn't actually debug info here DebugLoc dl = Op.getDebugLoc(); if (getTargetMachine().getRelocationModel() != Reloc::PIC_) { return DAG.getBlockAddress(BA, MVT::i32, true, Cpu0II::MO_ABS); } EVT ValTy = Op.getValueType(); unsigned GOTFlag = Cpu0II::MO_GOT; unsigned OFSTFlag = Cpu0II::MO_ABS; SDValue BAGOTOffset = DAG.getBlockAddress(BA, ValTy, true, GOTFlag); BAGOTOffset = DAG.getNode(Cpu0ISD::Wrapper, dl, ValTy, GetGlobalReg(DAG, ValTy), BAGOTOffset); SDValue BALOOffset = DAG.getBlockAddress(BA, ValTy, true, OFSTFlag); SDValue Load = DAG.getLoad(ValTy, dl, DAG.getEntryNode(), BAGOTOffset, MachinePointerInfo(), false, false, false, 0); SDValue Lo = DAG.getNode(Cpu0ISD::Lo, dl, ValTy, BALOOffset); return DAG.getNode(ISD::ADD, dl, ValTy, Load, Lo); }
SDValue LanaiTargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const { SDLoc DL(Op); const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress(); uint8_t OpFlagHi = LanaiII::MO_ABS_HI; uint8_t OpFlagLo = LanaiII::MO_ABS_LO; SDValue Hi = DAG.getBlockAddress(BA, MVT::i32, true, OpFlagHi); SDValue Lo = DAG.getBlockAddress(BA, MVT::i32, true, OpFlagLo); Hi = DAG.getNode(LanaiISD::HI, DL, MVT::i32, Hi); Lo = DAG.getNode(LanaiISD::LO, DL, MVT::i32, Lo); SDValue Result = DAG.getNode(ISD::OR, DL, MVT::i32, Hi, Lo); return Result; }