ACSE 2.0.3
Advanced Compiler System for Education
Loading...
Searching...
No Matches
target_info.h File Reference

Properties of the target machine. More...

#include <stdbool.h>
#include <stdint.h>
#include "list.h"
#include "program.h"

Go to the source code of this file.

Macros

#define TARGET_NAME   "RISC-V_RV32IM"
 Name of the target architecture.
#define TARGET_PTR_GRANULARITY   1
 Number of bytes for each memory address.
#define TARGET_REG_ZERO_IS_CONST   true
#define NUM_GP_REGS   23
 Number of general-purpose registers usable by the register allocator.
#define NUM_SPILL_REGS   3

Typedefs

typedef int32_t t_regInt
 Signed data type with the same size of a target register.

Enumerations

enum  {
  REG_ZERO = 0 , REG_RA , REG_SP , REG_GP ,
  REG_TP , REG_T0 , REG_T1 , REG_T2 ,
  REG_S0 , REG_S1 , REG_A0 , REG_A1 ,
  REG_A2 , REG_A3 , REG_A4 , REG_A5 ,
  REG_A6 , REG_A7 , REG_S2 , REG_S3 ,
  REG_S4 , REG_S5 , REG_S6 , REG_S7 ,
  REG_S8 , REG_S9 , REG_S10 , REG_S11 ,
  REG_T3 , REG_T4 , REG_T5 , REG_T6 ,
  NUM_REGISTERS
}
 Machine register names. More...
enum  {
  OPC_ADD , OPC_SUB , OPC_AND , OPC_OR ,
  OPC_XOR , OPC_MUL , OPC_DIV , OPC_REM ,
  OPC_SLL , OPC_SRL , OPC_SRA , OPC_ADDI ,
  OPC_SUBI , OPC_ANDI , OPC_ORI , OPC_XORI ,
  OPC_MULI , OPC_DIVI , OPC_REMI , OPC_SLLI ,
  OPC_SRLI , OPC_SRAI , OPC_SEQ , OPC_SNE ,
  OPC_SLT , OPC_SLTU , OPC_SGE , OPC_SGEU ,
  OPC_SGT , OPC_SGTU , OPC_SLE , OPC_SLEU ,
  OPC_SEQI , OPC_SNEI , OPC_SLTI , OPC_SLTIU ,
  OPC_SGEI , OPC_SGEIU , OPC_SGTI , OPC_SGTIU ,
  OPC_SLEI , OPC_SLEIU , OPC_J , OPC_BEQ ,
  OPC_BNE , OPC_BLT , OPC_BLTU , OPC_BGE ,
  OPC_BGEU , OPC_BGT , OPC_BGTU , OPC_BLE ,
  OPC_BLEU , OPC_LI , OPC_LA , OPC_LW ,
  OPC_SW , OPC_LW_G , OPC_SW_G , OPC_NOP ,
  OPC_ECALL , OPC_EBREAK , OPC_CALL_EXIT_0 , OPC_CALL_READ_INT ,
  OPC_CALL_PRINT_INT , OPC_CALL_PRINT_CHAR
}

Functions

bool isJumpInstruction (t_instruction *instr)
bool isUnconditionalJump (t_instruction *instr)
bool isExitInstruction (t_instruction *instr)
bool isCallInstruction (t_instruction *instr)
t_regID getSpillMachineRegister (int i)
t_listNodegetListOfGenPurposeMachineRegisters (void)
t_listNodegetListOfMachineRegisters (void)
t_listNodegetListOfCallerSaveMachineRegisters (void)

Detailed Description

Properties of the target machine.

Definition in file target_info.h.