|
ACSE 2.0.3
Advanced Compiler System for Education
|
Definitions and functions to support the compilation target. More...
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. | |
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_listNode * | getListOfGenPurposeMachineRegisters (void) |
| t_listNode * | getListOfMachineRegisters (void) |
| t_listNode * | getListOfCallerSaveMachineRegisters (void) |
| void | doTargetSpecificTransformations (t_program *program) |
Definitions and functions to support the compilation target.
These functions and definitions allow the compiler to appropriately handle the target-specific semantics of some special instructions, included the instructions that are available to the ACSE intermediate representation but are not part of the target assembly language itself.
| #define NUM_GP_REGS 23 |
Number of general-purpose registers usable by the register allocator.
Definition at line 37 of file target_info.h.
| #define NUM_SPILL_REGS 3 |
Number of registers available for spilled temporaries. Should be equal to the maximum number of unique register operands in a single instruction.
Definition at line 41 of file target_info.h.
| #define TARGET_NAME "RISC-V_RV32IM" |
Name of the target architecture.
Definition at line 27 of file target_info.h.
| #define TARGET_PTR_GRANULARITY 1 |
Number of bytes for each memory address.
Definition at line 30 of file target_info.h.
| #define TARGET_REG_ZERO_IS_CONST true |
Defined to 'true' if the target has a 'zero' register whose value is always the constant zero.
Definition at line 34 of file target_info.h.
| typedef int32_t t_regInt |
Signed data type with the same size of a target register.
Definition at line 24 of file target_info.h.
| anonymous enum |
Opcode IDs used internally by ACSE to identify the various instructions.
Some opcodes are labeled "pseudo" if they need to be transformed to a sequence of other non-pseudo opcodes before emitting the output assembly file. Other pseudo opcodes are handled by the assembler, those are not marked as "pseudo" here.
Definition at line 86 of file target_info.h.
| anonymous enum |
Machine register names.
Definition at line 44 of file target_info.h.
| void doTargetSpecificTransformations | ( | t_program * | program | ) |
Perform lowering of the program to a subset of the IR which can be represented as instructions of the target architecture.
| program | The program that needs to be transformed. The transformation is performed in-place. |
Definition at line 349 of file target_transform.c.
| t_listNode * getListOfCallerSaveMachineRegisters | ( | void | ) |
Retrieves the list of register IDs that can be modified by a given function call instruction, except for input and output parameters.
Definition at line 77 of file target_info.c.
| t_listNode * getListOfGenPurposeMachineRegisters | ( | void | ) |
Retrieves the list of register IDs available for the register allocator, sorted in order of priority.
Definition at line 55 of file target_info.c.
| t_listNode * getListOfMachineRegisters | ( | void | ) |
Retrieves the complete list of machine registers exception made for ones with a fixed value.
Definition at line 68 of file target_info.c.
| t_regID getSpillMachineRegister | ( | int | i | ) |
Retrieves a register ID suitable for spill operations. The maximum index is always bounded by NUM_SPILL_REGS.
| i | The index of the spill register to return, between 0 and NUM_SPILL_REGS (excluded). |
Definition at line 48 of file target_info.c.
| bool isCallInstruction | ( | t_instruction * | instr | ) |
Tests if the instruction is used to perform a function or system call.
| instr | The instruction to be examined. |
Definition at line 42 of file target_info.c.
| bool isExitInstruction | ( | t_instruction * | instr | ) |
Tests if the instruction causes the program to exit.
| instr | The instruction to be examined. |
Definition at line 9 of file target_info.c.
| bool isJumpInstruction | ( | t_instruction * | instr | ) |
Tests for jump/branch instructions.
| instr | The instruction to be examined. |
Definition at line 21 of file target_info.c.
| bool isUnconditionalJump | ( | t_instruction * | instr | ) |
Tests for unconditional jump instructions.
| instr | The instruction to be examined. |
Definition at line 15 of file target_info.c.