Assignment 6: Written 1:   Adding new data types
1 Problem description
2 Submission
8.2

Assignment 6: Written 1: Adding new data types

Due: Thu 11/04 at 9:00pm

1 Problem description

  1. Suppose we want to add support to Diamondback for single-precision (32-bit) floating point numbers. Describe what phases of the compiler might be impacted, and describe the changes needed.

  2. Suppose we implemented the above correctly. Now suppose we wanted to also add support for double-precision (64-bit) numbers. Describe what else might need to change.

You do not need to go into detail about the exact assembly code produced. Instead you should focus on the impact on the compiler pipeline and semantic issues. For basics on floating point arithmetic in the x86 instruction set, see here. The most basic understanding is that there are 8 floating point registers named st0-st7 and there are special instructions for loading, storing and performing floating-point arithmetic operations on these registers.

Reminder: Every time we enhance our source language, we need to consider several things:

  1. Its impact on the concrete syntax of the language

  2. Examples using the new enhancements, so we build intuition of them

  3. Its impact on the abstract syntax and semantics of the language

  4. Any new or changed transformations needed to process the new forms

  5. Executable tests to confirm the enhancement works as intended

You should go through this process for these features, except you do not need to write any executable tests.

2 Submission

Wait! Please read the assignment again and verify that you have not forgotten anything!

Please submit your homework to gradescope by the above deadline.