mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Add function returning which operand holds immediate constant
for a given opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9e29f78029
commit
4c5fe2d3ed
@ -210,6 +210,13 @@ public:
|
||||
return getDescriptor(opCode).latency;
|
||||
}
|
||||
|
||||
//
|
||||
// Which operand holds an immediate constant? Returns -1 if none
|
||||
//
|
||||
virtual int getImmmedConstantPos(MachineOpCode opCode) const {
|
||||
return -1; // immediate position is machine specific, so say -1 == "none"
|
||||
}
|
||||
|
||||
// Check if the specified constant fits in the immediate field
|
||||
// of this machine instruction
|
||||
//
|
||||
|
@ -210,6 +210,13 @@ public:
|
||||
return getDescriptor(opCode).latency;
|
||||
}
|
||||
|
||||
//
|
||||
// Which operand holds an immediate constant? Returns -1 if none
|
||||
//
|
||||
virtual int getImmmedConstantPos(MachineOpCode opCode) const {
|
||||
return -1; // immediate position is machine specific, so say -1 == "none"
|
||||
}
|
||||
|
||||
// Check if the specified constant fits in the immediate field
|
||||
// of this machine instruction
|
||||
//
|
||||
|
@ -90,6 +90,22 @@ class UltraSparcInstrInfo : public MachineInstrInfo {
|
||||
public:
|
||||
/*ctor*/ UltraSparcInstrInfo(const TargetMachine& tgt);
|
||||
|
||||
//
|
||||
// All immediate constants are in position 0 except the
|
||||
// store instructions.
|
||||
//
|
||||
virtual int getImmmedConstantPos(MachineOpCode opCode) const {
|
||||
bool ignore;
|
||||
if (this->maxImmedConstant(opCode, ignore) != 0)
|
||||
{
|
||||
assert(! this->isStore((MachineOpCode) STB - 1)); // first store is STB
|
||||
assert(! this->isStore((MachineOpCode) STD + 1)); // last store is STD
|
||||
return (opCode >= STB || opCode <= STD)? 2 : 1;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual bool hasResultInterlock (MachineOpCode opCode) const
|
||||
{
|
||||
// All UltraSPARC instructions have interlocks (note that delay slots
|
||||
|
Loading…
x
Reference in New Issue
Block a user