46 #define DEBUG_TYPE "xfer"
60 const char *getPassName()
const override {
61 return "Hexagon Split Const32s and Const64s";
70 bool HexagonSplitConst32AndConst64::runOnMachineFunction(
MachineFunction &Fn) {
83 MBBb != MBBe; ++MBBb) {
91 if (Opc == Hexagon::CONST32_Int_Real &&
102 MII = MBB->
erase (MI);
106 else if (Opc == Hexagon::CONST32_Int_Real ||
107 Opc == Hexagon::CONST32_Float_Real) {
113 if (Opc == Hexagon::CONST32_Float_Real) {
121 TII->
get(Hexagon::A2_tfrsi), DestReg).addImm(ImmValue);
122 MII = MBB->
erase (MI);
125 else if (Opc == Hexagon::CONST64_Int_Real ||
126 Opc == Hexagon::CONST64_Float_Real) {
132 if (Opc == Hexagon::CONST64_Float_Real) {
139 unsigned DestLo = TRI->
getSubReg(DestReg, Hexagon::subreg_loreg);
140 unsigned DestHi = TRI->
getSubReg(DestReg, Hexagon::subreg_hireg);
142 int32_t LowWord = (ImmValue & 0xFFFFFFFF);
143 int32_t HighWord = (ImmValue >> 32) & 0xFFFFFFFF;
146 TII->
get(Hexagon::A2_tfrsi), DestLo).addImm(LowWord);
148 TII->
get(Hexagon::A2_tfrsi), DestHi).addImm(HighWord);
149 MII = MBB->
erase (MI);
167 return new HexagonSplitConst32AndConst64();
void initializeHexagonSplitConst32AndConst64Pass(PassRegistry &)
const ConstantFP * getFPImm() const
bool isBlockAddress() const
isBlockAddress - Tests if this is a MO_BlockAddress operand.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
virtual TargetLoweringObjectFile * getObjFileLowering() const
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
TargetInstrInfo - Interface to description of machine instruction set.
bundle_iterator< MachineInstr, instr_iterator > iterator
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
const MachineOperand & getOperand(unsigned i) const
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
FunctionPass class - This class is used to implement most global optimizations.
bool IsSmallDataEnabled() const
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
MachineOperand class - Representation of each machine instruction operand.
APInt bitcastToAPInt() const
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Representation of each machine instruction.
FunctionPass * createHexagonSplitConst32AndConst64()
const uint64_t * getRawData() const
This function returns a pointer to the internal storage of the APInt.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const APFloat & getValueAPF() const
unsigned getReg() const
getReg - Returns the register number.
virtual const TargetInstrInfo * getInstrInfo() const
BasicBlockListType::iterator iterator
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...