Add a new method.

llvm-svn: 19249
This commit is contained in:
Chris Lattner 2005-01-02 02:38:18 +00:00
parent b62b45b3fc
commit e7228736e0
1 changed files with 10 additions and 1 deletions

View File

@ -49,7 +49,9 @@ struct X86AddressMode {
GlobalValue *GV;
X86AddressMode() : BaseType(RegBase), Scale(1), IndexReg(0), Disp(0),
GV(NULL) {}
GV(NULL) {
Base.Reg = 0;
}
};
/// addDirectMem - This function is used to add a direct memory reference to the
@ -73,6 +75,13 @@ inline const MachineInstrBuilder &addRegOffset(const MachineInstrBuilder &MIB,
return MIB.addReg(Reg).addZImm(1).addReg(0).addSImm(Offset);
}
/// addRegReg - This function is used to add a memory reference of the form:
/// [Reg + Reg].
inline const MachineInstrBuilder &addRegReg(const MachineInstrBuilder &MIB,
unsigned Reg1, unsigned Reg2) {
return MIB.addReg(Reg1).addZImm(1).addReg(Reg2).addSImm(0);
}
inline const MachineInstrBuilder &addFullAddress(const MachineInstrBuilder &MIB,
const X86AddressMode &AM) {
assert (AM.Scale == 1 || AM.Scale == 2 || AM.Scale == 4 || AM.Scale == 8);