[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrBuilder.h
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 1 18:38:30 PST 2005
Changes in directory llvm/lib/Target/X86:
X86InstrBuilder.h updated: 1.14 -> 1.15
---
Log message:
Add a new method.
---
Diffs of the changes: (+10 -1)
Index: llvm/lib/Target/X86/X86InstrBuilder.h
diff -u llvm/lib/Target/X86/X86InstrBuilder.h:1.14 llvm/lib/Target/X86/X86InstrBuilder.h:1.15
--- llvm/lib/Target/X86/X86InstrBuilder.h:1.14 Fri Dec 17 16:41:46 2004
+++ llvm/lib/Target/X86/X86InstrBuilder.h Sat Jan 1 20:38:18 2005
@@ -49,7 +49,9 @@
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 @@
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);
More information about the llvm-commits
mailing list