decoder.h
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef DECODER_H
#define DECODER_H
#define DECODER_MAX_INSTR 128
#define SAVE_REG_OPT (1<<6)
#define SAVE_REG_CALLOUT (1<<7)
typedef struct BasicBlockInstr {
union alpha_instruction instr;
int prePCAnn;
int postPCAnn;
int offset;
int cycles;
int mergedBranch;
int saveReg;
int isBranch;
} BasicBlockInstr;
typedef struct BasicBlock {
VA vPC;
MA mPC;
VA nextPC; /* just after the BB */
int numInstructions;
int numCycles;
int hasPCAnn; /* flag */
int hasSC; /* flag */
int usesFP; /* flag */
/* register allocation. Modified by translator */
struct RegAlloc {
uint32 accessed;
int numRegsAlloc;
int reg[32]; /* Shadow register */
int preload[NUM_SHADOW_REGS]; /* list of sim registers */
} regAlloc;
BasicBlockInstr instr[DECODER_MAX_INSTR];
} BasicBlock;
extern void Decode(VA,MA,BasicBlock *);
#endif