mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
Improve compatiblity with HPUX on Itanium, patch by Duraid Madina
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
typedef long long cycles_t;
|
typedef long long CycleCount_t;
|
||||||
static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2));
|
static const CycleCount_t HUGE_LATENCY = ~((long long) 1 << (sizeof(CycleCount_t)-2));
|
||||||
static const cycles_t INVALID_LATENCY = -HUGE_LATENCY;
|
static const CycleCount_t INVALID_LATENCY = -HUGE_LATENCY;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// class MachineResource
|
// class MachineResource
|
||||||
@ -78,7 +78,7 @@ struct InstrClassRUsage {
|
|||||||
unsigned maxNumIssue;
|
unsigned maxNumIssue;
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
cycles_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
|
|
||||||
// Feasible slots to use for instructions in this class.
|
// Feasible slots to use for instructions in this class.
|
||||||
// The size of vector S[] is `numSlots'.
|
// The size of vector S[] is `numSlots'.
|
||||||
@ -109,7 +109,7 @@ struct InstrIssueDelta {
|
|||||||
MachineOpCode opCode;
|
MachineOpCode opCode;
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
cycles_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -119,13 +119,13 @@ struct InstrRUsage {
|
|||||||
// Issue restrictions for this instruction
|
// Issue restrictions for this instruction
|
||||||
bool isSingleIssue;
|
bool isSingleIssue;
|
||||||
bool breaksGroup;
|
bool breaksGroup;
|
||||||
cycles_t numBubbles;
|
CycleCount_t numBubbles;
|
||||||
|
|
||||||
// Feasible slots to use for this instruction.
|
// Feasible slots to use for this instruction.
|
||||||
std::vector<bool> feasibleSlots;
|
std::vector<bool> feasibleSlots;
|
||||||
|
|
||||||
// Resource usages for this instruction, with one resource vector per cycle.
|
// Resource usages for this instruction, with one resource vector per cycle.
|
||||||
cycles_t numCycles;
|
CycleCount_t numCycles;
|
||||||
std::vector<std::vector<resourceId_t> > resourcesByCycle;
|
std::vector<std::vector<resourceId_t> > resourcesByCycle;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -461,7 +461,7 @@ GenericValue lle_X_scanf(FunctionType *M, const vector<GenericValue> &args) {
|
|||||||
|
|
||||||
// int clock(void) - Profiling implementation
|
// int clock(void) - Profiling implementation
|
||||||
GenericValue lle_i_clock(FunctionType *M, const vector<GenericValue> &Args) {
|
GenericValue lle_i_clock(FunctionType *M, const vector<GenericValue> &Args) {
|
||||||
extern int clock(void);
|
extern unsigned int clock(void);
|
||||||
GenericValue GV; GV.IntVal = clock();
|
GenericValue GV; GV.IntVal = clock();
|
||||||
return GV;
|
return GV;
|
||||||
}
|
}
|
||||||
|
@ -61,22 +61,22 @@ RUConflict(const std::vector<resourceId_t>& fromRVec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static cycles_t
|
static CycleCount_t
|
||||||
ComputeMinGap(const InstrRUsage &fromRU,
|
ComputeMinGap(const InstrRUsage &fromRU,
|
||||||
const InstrRUsage &toRU)
|
const InstrRUsage &toRU)
|
||||||
{
|
{
|
||||||
cycles_t minGap = 0;
|
CycleCount_t minGap = 0;
|
||||||
|
|
||||||
if (fromRU.numBubbles > 0)
|
if (fromRU.numBubbles > 0)
|
||||||
minGap = fromRU.numBubbles;
|
minGap = fromRU.numBubbles;
|
||||||
|
|
||||||
if (minGap < fromRU.numCycles) {
|
if (minGap < fromRU.numCycles) {
|
||||||
// only need to check from cycle `minGap' onwards
|
// only need to check from cycle `minGap' onwards
|
||||||
for (cycles_t gap=minGap; gap <= fromRU.numCycles-1; gap++) {
|
for (CycleCount_t gap=minGap; gap <= fromRU.numCycles-1; gap++) {
|
||||||
// check if instr. #2 can start executing `gap' cycles after #1
|
// check if instr. #2 can start executing `gap' cycles after #1
|
||||||
// by checking for resource conflicts in each overlapping cycle
|
// by checking for resource conflicts in each overlapping cycle
|
||||||
cycles_t numOverlap =std::min(fromRU.numCycles - gap, toRU.numCycles);
|
CycleCount_t numOverlap =std::min(fromRU.numCycles - gap, toRU.numCycles);
|
||||||
for (cycles_t c = 0; c <= numOverlap-1; c++)
|
for (CycleCount_t c = 0; c <= numOverlap-1; c++)
|
||||||
if (RUConflict(fromRU.resourcesByCycle[gap + c],
|
if (RUConflict(fromRU.resourcesByCycle[gap + c],
|
||||||
toRU.resourcesByCycle[c])) {
|
toRU.resourcesByCycle[c])) {
|
||||||
// conflict found so minGap must be more than `gap'
|
// conflict found so minGap must be more than `gap'
|
||||||
|
Reference in New Issue
Block a user