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

Discussion

Code motion that inserts a computation on a path where it was not previously performed is safe only if

  • A.the computation appears at least twice in the procedure
  • B.the target machine happens to have an idle functional unit available
  • C.the inserted computation is a compile time constant
  • D.the computation cannot raise an exception or have side effects

Answer: D

A division that would have been skipped must not be executed early if it might trap. Compilers therefore restrict speculative motion to operations that cannot fault. Hardware support for speculation relaxes the restriction on some machines.

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

Post your comment

Please log in or register to post a comment.