: TargetInstrInfo(ARMInsts, sizeof(ARMInsts)/sizeof(ARMInsts[0])) {
}
+const TargetRegisterClass *ARMInstrInfo::getPointerRegClass() const {
+ return &ARM::IntRegsRegClass;
+}
+
/// Return true if the instruction is a register to register move and
/// leave the source and dest operands in the passed parameters.
///
///
virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
+ /// getPointerRegClass - Return the register class to use to hold pointers.
+ /// This is used for addressing modes.
+ virtual const TargetRegisterClass *getPointerRegClass() const;
+
/// Return true if the instruction is a register to register move and
/// leave the source and dest operands in the passed parameters.
///
"ldr $dst, $addr",
[(set IntRegs:$dst, (load iaddr:$addr))]>;
-def str : InstARM<(ops IntRegs:$src, IntRegs:$addr),
- "str $src, [$addr]",
- [(store IntRegs:$src, IntRegs:$addr)]>;
+def str : InstARM<(ops IntRegs:$src, memri:$addr),
+ "str $src, $addr",
+ [(store IntRegs:$src, iaddr:$addr)]>;
def movrr : InstARM<(ops IntRegs:$dst, IntRegs:$src),
"mov $dst, $src", []>;
//sub sp, sp, #NumBytes
BuildMI(MBB, MBBI, ARM::subri, 2, ARM::R13).addReg(ARM::R13).addImm(NumBytes);
- //add ip, sp, #NumBytes - 4
- BuildMI(MBB, MBBI, ARM::addri, 2, ARM::R12).addReg(ARM::R13).addImm(NumBytes - 4);
- //str lr, [ip]
- BuildMI(MBB, MBBI, ARM::str, 1, ARM::R14).addReg(ARM::R12);
+ //str lr, [sp, #NumBytes - 4]
+ BuildMI(MBB, MBBI, ARM::str, 2, ARM::R14).addImm(NumBytes - 4).addReg(ARM::R13);
}
void ARMRegisterInfo::emitEpilogue(MachineFunction &MF,