Question: Starting with C code of the form short test (short x, short y) { short val = if ( if ( else .L2: val =

Starting with C code of the form

short test (short x, short y) { short val = if ( if ( else .L2: val = ) { } else if ( val = return val; movq

short test (short x, short y) { short val = if ( if ( else .L2: val = ) { } else if ( val = return val; movq imulq movq orq cmpq cmovge ret val = } GCC generates the following assembly code: short test (short x, short y) x in %rdi, y in %rsi test: leaq 12 (%rsi), %rbx testq jge %rdi, %rdi .L2 _) %rdi, %rbx %rsi, %rbx %rdi, %rdx %rsi, %rdx %rsi, %rdi %rdx, %rbx idivq %rsi, %rdi cmpq $10, %rsi cmovge %rdi, %rbx ret Fill in the missing expressions in the C code.

Step by Step Solution

3.39 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Except that some of the conditionals have been implemented by conditiona... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!