Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
"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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions