decoder.h 1.15 KB
/*
 * 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