Open jsiek opened 1 year ago
Currently, x86_Int doesn't restrict arguments. e.g. Figure 2.5 (Python version) allows both arguments of a movq to be memory references. I assumed this was intentional - but maybe it wasn't?
The restriction is not expressed in the grammar. (That kind of restriction is difficult to express in a grammar.) The restriction is instead expressed in the text, on page 21, and the lifting of the restrictions for x86_Var is stated on page 22.
I should add, those restrictions are difficult to express without significantly increasing the size of the grammar.
That makes sense. I think it is not bad as it is, this is just a nuance that I need to explain in class better. An alternative might be a grammar x86_Int* that just has a footnote saying there are no argument restrictions.
We currently use x86_Var as the output of assign homes, which is a bit confusing because assign homes removes the variables. We need a variant of x86_Int that relaxes the argument restrictions.