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

Discussion

A machine that sets condition codes as a side effect of arithmetic allows the generator to

  • A.omit a separate comparison when the value was just computed
  • B.dispense with conditional jumps altogether in the generated code
  • C.evaluate both branches of a conditional simultaneously
  • D.avoid allocating any registers for boolean values

Answer: A

If the flags already reflect the value, the comparison is redundant. Tracking the state of the condition codes is a small but worthwhile part of a good back end. The saving is one instruction per comparison, which adds up inside a loop.

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

Post your comment

Please log in or register to post a comment.