Question: loop.c Compile in Linux machine #include int main () int for i, a[10], sum=0; (i=0; i loop-unoptimized-1st This command compiles loop.c with no optimizations This

 "loop.c" Compile in Linux machine #include int main () int for

"loop.c" Compile in Linux machine #include int main () int for i, a[10], sum=0; (i=0; i loop-unoptimized-1st This command compiles loop.c with no optimizations This command also redirects output to a file called "loop-unoptimized.lst" that contains the assembly code for the C program together with the C instructions. View this file and study the assembly code generated to compute the loop operation. You may need to reference some the x86 instruction set. http://flint.cs.yale.edu/cs421/papers/x86-asm/asm.html has a description of x86 instructions. You can search other x86 instruction set references online Next, recompile the program with optimizations (the-O2 flag): gec -c -g -Wa, -a,-ad -02 loop.c> loop-optimized.1st Now view the loop-optimized.Ist file. How is the optimized version more efficient than the unoptimized version? This will require some deciphering of the x86 instructions. What does this imply for executing benchmarks or for releasing products to the public

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!