Quiz time
Now that you have finished reading the chapter, try answering the following questions to test your knowledge:
- What field do you have to add to a TableGen instruction record to enable the generation of the encodings?
The encoding information for an instruction record is primarily carried by the Inst
field.
See the Defining the MC layer for the instructions section for more details.
- Imagine that you defined the encoding of one of your operands like this:
let Inst{0-3} = op
. The resulting encoding is incorrect. What is the likely cause?
The likely cause is that you swapped the order of the bits in the encoding. You likely wanted to use let Inst{3-0} = op
instead.
See the Defining the MC layer for the instructions section for more details.
- Must all the instructions have encodings? Why?
No; only the instructions that are expected to reach the MC layer must have encodings. This is because the Machine layer may...