Machine-translated by Google. Questions are authored in English.
Top

Discussion

Instruction selection is the task of

  • A.selecting which one of several source files ought to be compiled first
  • B.picking the optimisations to apply to the intermediate code
  • C.choosing target instructions that implement the intermediate operations
  • D.deciding the order in which the phases of the compiler will run

Answer: C

Correct answer: choosing target instructions that implement the intermediate operations

Instruction selection maps each intermediate operation, or a pattern of several, onto the machine instructions that realise it - often with several valid choices differing in cost.

A three-address addition might become an add, a load-effective-address, or an increment, according to the operands and the addressing modes available. Because the choice depends entirely on the target's instruction set, it is a back-end task and one of the parts that must be rewritten when a compiler is retargeted.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.