{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw1soln - HW 1 Sample Solution Problem 1 See optimization...

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

View Full Document Right Arrow Icon
HW 1 -- Sample Solution Problem 1 See optimization flags for gcc as examples. Problem 2 1. factorial: loadI 5 => r1 loadI 1 => r2 HEAD: nop loadI 1 => r3 cmp_LT r3, r1 => r4 cbr r4 => BODY, EXIT BODY: nop mult r2, r1 => r2 subI r1, 1 => r1 jumpI => HEAD EXIT: nop loadI 1020 => r5 store r2 => r5 output 1020 2. single basic block: (1) loadI 1024 => r0 loadI 5 => r1 storeAI r1 => r0, 0 loadI 7 => r2 storeAI r2 => r0, 4 add r1, r2 => r3 storeAI r3 => r0, 8 mult r3, r1 => r4 storeAI r4 => r0, 12 subI r4, 1 => r5 storeAI r5 => r0, 16 addI r5, 7 => r6 storeAI r6 => r0, 20
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}