CS912 Code Selection Assignment


You are to generate Alpha assembly code from intermediate code created by the java2c tool, which is part of the Hyperion system for native execution of Java programs. The Hyperion intermediate code (HYP-IC) is for a register-based virtual machine, which is only Java-specific in that some of the arithmetic instructions have Java semantics.

Your job is to select an Alpha instruction (or, in some cases, multiple Alpha instructions) for each HYP-IC instruction. You will also have to map HYP-IC temporaries (registers) to Alpha registers. However, you are not responsible for register allocation, so you can assume an infinite number of Alpha integer and floating-point registers.

The source code for the Hyperion system, including java2c and some test programs, is available on the UNH CIS Alpha machines in ~pjh/cs912/java2c.tar.gz. Please see the README file for more information on HYP-IC.

The distribution includes two versions of java2c. The first version generates all C code, which can be used right away to execute test programs. The second version generates C code plus HYP-IC code. The README file also includes information about using these two versions.

The test programs included in the distribution are Java versions of the Hennessy benchmarks, plus a program to compute Pi. You are responsible for generating correct code for all of these programs. However, since you are not writing a register allocator, you probably will not be able to execute your output. We will need to rely on visual checks of the output.

Your output should therefore be as clean and neat as possible. Output Alpha instructions, labels and directives one per line. Your output, except for register names, should also be fully compatible with the Alpha Unix assembler.

The due date for this assignment is Wednesday October 11. For full credit, you should e-mail me a gzip-ed tar file for your code selector before class that evening. Please include in your distribution a description of how to use your tool. Also please provide a list of any known shortcomings of the tool and a description of how you have tested the tool. (I.e., if your tool segfaults on some case, tell me that. Don't let me discover it myself!)

Late submissions will only be accepted up to Wednesday October 25. Each week (or partial week) (after October 11) that you assignment is late will result in a 10% penalty (10% of 100%, not 10% of your grade).

Remember that the bulk of your course grade is for the semester-long project. You need to complete this assignment as quickly as possible to leave time to do a good project.


Last modified on August 4, 2000.

Comments and questions should be directed to pjh@cs.unh.edu