CSCE 425/825 - Compiler Construction

CSCE 425/825
Course Home Page
Course Description
Calendar
Project Upload
Resources
Project
Java
ANTLR
JVM and ASM
Eclipse and Plugins

Native Code Generation

Exercises

  1. Design VirtualRISC code templates for the "iadd" opcode given the different possible "locations" in which register allocation may place the operands and results.
  2. What is the relationship between the local stack in the JVM and the registers used in native code generation?
  3. How many registers are needed to evaluate the following expression?
    ((x + 2) * (x - (2 + y)))
    
  4. Construct the interference graph and search for a minimal coloring to allocate registers for the variables in following code fragment:
    x = 5;
    y = x * 2;
    z = x;
    a = y + z - 4;
    y = a;
    
    Does your solution change if you make different assumptions about the liveness of variables on output? If so, make sure to explicitly state your assumption.
  5. Appel Exercise 9.1

Reading

  • Dragon, Chapter 8.5, 8.6, 8.8-10

Materials

Native Code Generation