mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
New addFrameReference function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2ab4124e3
commit
a1826c2ecd
@ -20,8 +20,9 @@
|
|||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
|
|
||||||
/// addDirectMem - This function is used to add a direct memory reference to the
|
/// addDirectMem - This function is used to add a direct memory reference to the
|
||||||
/// current instruction -- that is, a dereference of an address in a register, with
|
/// current instruction -- that is, a dereference of an address in a register,
|
||||||
/// no scale, index or displacement. An example is: DWORD PTR [EAX].
|
/// with no scale, index or displacement. An example is: DWORD PTR [EAX].
|
||||||
|
///
|
||||||
inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
|
inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
|
||||||
unsigned Reg) {
|
unsigned Reg) {
|
||||||
// Because memory references are always represented with four
|
// Because memory references are always represented with four
|
||||||
@ -30,12 +31,23 @@ inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// addRegOffset - This function is used to add a memory reference of
|
/// addRegOffset - This function is used to add a memory reference of the form
|
||||||
/// the form [Reg + Offset], i.e., one with no scale or index, but
|
/// [Reg + Offset], i.e., one with no scale or index, but with a
|
||||||
/// with a displacement. An example is: DWORD PTR [EAX + 4].
|
/// displacement. An example is: DWORD PTR [EAX + 4].
|
||||||
|
///
|
||||||
inline const MachineInstrBuilder &addRegOffset(const MachineInstrBuilder &MIB,
|
inline const MachineInstrBuilder &addRegOffset(const MachineInstrBuilder &MIB,
|
||||||
unsigned Reg, unsigned Offset) {
|
unsigned Reg, int Offset) {
|
||||||
return MIB.addReg(Reg).addZImm(1).addMReg(0).addSImm(Offset);
|
return MIB.addReg(Reg).addZImm(1).addMReg(0).addSImm(Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// addFrameReference - This function is used to add a reference to the base of
|
||||||
|
/// an abstract object on the stack frame of the current function. This
|
||||||
|
/// reference has base register <noreg> and a FrameIndex offset until it is
|
||||||
|
/// resolved.
|
||||||
|
///
|
||||||
|
inline const MachineInstrBuilder &
|
||||||
|
addFrameReference(const MachineInstrBuilder &MIB, int FI) {
|
||||||
|
return MIB.addReg(0).addZImm(1).addMReg(0).addFrameIndex(FI);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user