본문 바로가기
csapp

3.6.5 Implementing Conditional Branches with Conditional Control

by 정구지개발자 2023. 4. 13.
728x90
  • The most general way to translate conditional expressions and statements from C into machine code is to use combinations of conditional and unconditional jumps

3.6.6 Implementing Conditional Branches with Conditional Moves

  • Processors employ sophisticated branch pre- diction logic to try to guess whether or not each jump instruction will be followed.
  • the code compiled using conditional moves requires around 8 clock cycles regardless of the data being tested. The flow of control does not depend on data, and this makes it easier for the processor to keep its pipeline full.
  • The source and destination values can be 16, 32, or 64 bits long. Single- byte conditional moves are not supported
  • Unlike conditional jumps, the processor can execute conditional move in- structions without having to predict the outcome of the test.

 

728x90

'csapp' 카테고리의 다른 글

3.6.8 Switch Statements  (0) 2023.04.14
3.6.7 Loops  (0) 2023.04.14
3.6 Control  (0) 2023.04.10
3.5 Arithmetic and Logical Operations  (0) 2023.04.10
3.4.2 Data Movement Instructions  (0) 2023.04.08

댓글