Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi can you help me answer the following questions on Performance Analysis & Instructor Set Architecture? Using the free c compiler from the GNU free

Hi can you help me answer the following questions on Performance Analysis & Instructor Set Architecture? Using the free c compiler from the GNU free compiler collection (GCC) project. Thank you!

image text in transcribed

CPHICxCPlxTc). If possible, create a main function to cal max1 and use the time command to measure the performance. Compare the measure to your estimatian. What do you think are the factors that cause the difference? Please provide your analysis. You may find references online regarding the CPl of each instruction.) Exercises 1. nstruction Analysis) This exercise will familir you with several ospects of instruction set and the fundamental of compiler. Given max.c (below), please use "gcc -S max.c" to compile the code into assembly code. (The result will be in max.s.) From the result answer the following questions int max1 (int a, int b) return (axb?a:b int max2 (int a, int b int isaGTb a>bi int max max-: max-b; return max: What does the code hint about the kind of instruction sef? (e.g. Accumulator, Register Memory Memory Memory, Register Register) Please justify your answer Can you tell whether the architecture is either Restricted Alignment or Unrestricted Alignment? Please explain how do you come up with yaur answer. Create a new function (e.g. testMax) to cal maxt. Generate new assembly code What does the result suggest regarding the register saving (caller save vs. callee save)? Please provide your analysis. How does the arguments be passed and the return value returned from a function? Please explain the code Find the part of code (snippet) that do compcrison and conditional branch. Explair how does it work If max.c is complied with optimization turned on (using "goc 02 -S max.c"), what are the differences that you may observe from the result (comparing to that without optimization). Please provide your analysis Please estimate the CPU Time required by the maxt function (using the equation

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

Step: 3

blur-text-image

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

=+A Look at Three Technical Documents

Answered: 1 week ago

Question

6. Are my sources reliable?

Answered: 1 week ago

Question

5. Are my sources compelling?

Answered: 1 week ago