|
|
|
Native Code Generation
Exercises
-
Design VirtualRISC code templates for the "iadd" opcode given the
different possible "locations" in which
register allocation may place the operands and results.
-
What is the relationship between the local stack in the JVM and the
registers used in native code generation?
-
How many registers are needed to evaluate the following expression?
((x + 2) * (x - (2 + y)))
-
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.
- Appel Exercise 9.1
Reading
- Dragon, Chapter 8.5, 8.6, 8.8-10
Materials
Native Code Generation
|