When a programmer compiles code with optimization

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of this translation. D. What restrictions must be imposed on the use of this translation to guarantee that it has the behavior specified by the C code? 3.16. SUMMARY The jump targets Arguments p1 and p2 are in registers %ebx and %ecx. 1 .L15: MODE_A 2 movl (%ecx),%edx 3 movl (%ebx),%eax 4 movl %eax,(%ecx) 5 jmp .L14 6 .p2align 4,,7 Inserted to optimize cache performance 7 .L16: MODE_B 8 movl (%ecx),%eax 9 addl (%ebx),%eax 10 movl %eax,(%ebx) 11 movl %eax,%edx 12 jmp .L14 13 .p2align 4,,7 Inserted to optimize cache performance 14 .L17: MODE_C 15 movl $15,(%ebx) 16 movl (%ecx),%edx 17 jmp .L14 18 .p2align 4,,7 Inserted to optimize cache performance 19 .L18: MODE_D 20 movl (%ecx),%eax 21 movl %eax,(%ebx) 22 .L19: MODE_E 23 movl $17,%edx 24 jmp .L14 25 .p2align 4,,7 Inserted to optimize cache performance 26 .L20: 27 movl $-1,%edx 28 .L14: default 29 movl %edx,%eax Set return value 195 Figure 3.36: Assembly Code for Problem 3.33. This code implements the different branches of a switch statement. Homework Problem 3.33 [Category 2]: The following code shows an example of branching on an enumera...
View Full Document

Ask a homework question - tutors are online