#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/DataTypes.h"
+#include <vector>
class MachineInstrDescriptor;
+class TmpInstruction;
+class MachineInstr;
+class Value;
+class Instruction;
typedef int InstrSchedClass;
isSignExtended = getDescriptor(opCode).immedIsSignExtended;
return getDescriptor(opCode).maxImmedConst;
}
+
+ //-------------------------------------------------------------------------
+ // Code generation support for creating individual machine instructions
+ //-------------------------------------------------------------------------
+
+ // Create an instruction sequence to put the constant `val' into
+ // the virtual register `dest'. `val' may be a ConstPoolVal or a
+ // GlobalValue, viz., the constant address of a global variable or function.
+ // The generated instructions are returned in `minstrVec'.
+ // Any temp. registers (TmpInstruction) created are returned in `tempVec'.
+ //
+ virtual void CreateCodeToLoadConst(Value* val,
+ Instruction* dest,
+ vector<MachineInstr*>& minstrVec,
+ vector<TmpInstruction*>& temps) const =0;
};
#endif
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/DataTypes.h"
+#include <vector>
class MachineInstrDescriptor;
+class TmpInstruction;
+class MachineInstr;
+class Value;
+class Instruction;
typedef int InstrSchedClass;
isSignExtended = getDescriptor(opCode).immedIsSignExtended;
return getDescriptor(opCode).maxImmedConst;
}
+
+ //-------------------------------------------------------------------------
+ // Code generation support for creating individual machine instructions
+ //-------------------------------------------------------------------------
+
+ // Create an instruction sequence to put the constant `val' into
+ // the virtual register `dest'. `val' may be a ConstPoolVal or a
+ // GlobalValue, viz., the constant address of a global variable or function.
+ // The generated instructions are returned in `minstrVec'.
+ // Any temp. registers (TmpInstruction) created are returned in `tempVec'.
+ //
+ virtual void CreateCodeToLoadConst(Value* val,
+ Instruction* dest,
+ vector<MachineInstr*>& minstrVec,
+ vector<TmpInstruction*>& temps) const =0;
};
#endif
public:
/*ctor*/ UltraSparcInstrInfo();
- virtual bool hasResultInterlock (MachineOpCode opCode)
+ virtual bool hasResultInterlock (MachineOpCode opCode) const
{
// All UltraSPARC instructions have interlocks (note that delay slots
// are not considered here).
return (opCode == FCMPS || opCode == FCMPD || opCode == FCMPQ);
}
-
-
-
+ //-------------------------------------------------------------------------
+ // Code generation support for creating individual machine instructions
+ //-------------------------------------------------------------------------
+ // Create an instruction sequence to put the constant `val' into
+ // the virtual register `dest'. The generated instructions are
+ // returned in `minstrVec'. Any temporary registers (TmpInstruction)
+ // created are returned in `tempVec'.
+ //
+ virtual void CreateCodeToLoadConst(Value* val,
+ Instruction* dest,
+ vector<MachineInstr*>& minstrVec,
+ vector<TmpInstruction*>& tempVec) const;
};