Illustrate how compiler would unroll loop four times

Assignment Help Basic Computer Science
Reference no: EM1371116

Use the following code fragment:
Loop: LD R1,0(R2) ; load R1 from address 0+R2
DADDI R1,R1,#1 ; R1=R1+1
SD 0(R2),R1 ; store R1 at address 0+R2
DADDI R2,R2,#4 ; R2=R2+4
DSUB R4,R3,R2 ; R4=R3-R2
BNEZ R4,Loop ; branch to Loop if R4!=0

Assume that the initial value of R3 is R2+396.

(a) Show how a compiler would unroll the loop 4 times. Be sure to include the code that compute all of the pointers required for the operation within each iteration. Assume that the processor has as many registers as required.

(b) Show how a compiler would schedule the unrolled version of the loop from (a) for execution on a 4-wide VLIW processor that can execute an instruction on any execution unit. Assume latencies of 1 cycle for LD operation, and 0 cycle for DADDI and DSUB.

Reference no: EM1371116

Questions Cloud

Illustrate what is area of employment : Illustrate what is area of employment why has this shift occurred in illustrate what direction would shift in labour supply and demand go. Illustrate what would be its effect on equilibrium of labour market.
Explain the cognitive and non-cognitive abilities relating : Explain the cognitive and non-cognitive abilities relating to Emotional Intelligence and Provide an example of how you might use EQ in your daily life
What is the net force in the x-direction on charge : A 13g rifle bullet traveling 150m/s buries itself in a 3.7 kg pendulum hanging on a 2.9 m long string, which makes the pendulum swing upward in an arc. Resolve the horizontal component of the pendulum's maximum displacement.
Illustrate what is expected interest rate that will charge : Illustrate what is expected interest rate that will be charged by a bank that cannot exactly distinguish between two types but knows probabilities of each type.
Illustrate how compiler would unroll loop four times : Illustrate how compiler would unroll loop 4 times. Make sure to include code which compute all the pointers required for operation within each iteration. suppose that processor has as many registers as required.
What is an oligopoly : What is an "oligopoly" and why do they exist? Mention three or four oligopolies whose products you own or regularly purchase.
Find out the magnitude of the normal force : A ski starts from rest and slides down a 22° incline 75 m long. If the coefficient of friction is 0.09, what is the ski's speed at the base of the incline? If there is snow level at foot of the incline and it has the same coefficient of friction, ..
Find the change in the reserve requirement needed : Suppose that the banking system has no excess reserves. Calculate the maximum amount of check-writing deposits when bank reserves total $10,000 and the reserve requirement;
Illustrate what is average variable cost : Suppose that a firm's only variable input is labour. When 50 workers are used, average product of labour is 50 and marginal product of labour is 75. Wage rate is $80 and total cost of fixed input is $500. Illustrate what is average variable cost. ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Cnditions under which full offsite backup is worth the cost

Discuss conditions under which it is worth the cost. Suggest some kind of compromise, lower cost solutions that still proved some recovery capabilities, and cases where these might be a preferred alternative.

  Ways to avoid communication pitfalls

Based on the section on "Watch out for communication pitfalls" in the Bateman and Snell text, describe some ways that Lei could have avoided this situation.

  Eu directive on the protection of personal data

How does the EU directive on the protection of personal data impose requirements on organizations in non-EU countries?"

  Servlet to return randomly chosen greeting

Write a servlet that returns a randomly chosen greeting from a list of five different greetings.

  Detection software automatically analyzes network traffic

What detection software automatically analyzes all network traffic. Assesses system vulnerabilities, recognizess any unauthorized access (intrusions).

  Creating presentation to law school class on digital crime

You have been asked to present a presentation to law school class on digital crime. After presentation, a student asks why so few people are really prosecuted for computer crime.

  Key factors limiting use of personalization

Two key factors limiting the use of personalization to more precisely target marketing efforts to individual customers are?

  Structured analysis and object-oriented techniques

A frequently asked question is "Can structured techniques and object-oriented techniques be mixed?

  Calculate performance of cache and the average cpi

Assume the instruction cache miss rate is 0.5% and the data cache miss rate is 1%. Calculate the performance of the cache (CPU execution time) and the average CPI.

  Explain worst possible reports from system

Imagine worst possible reports from a system. What is wrong with them? Write as many problems as you can. What are the consequences of such reports?

  Information assets to estimate for risk management purposes

If the organization has three information assets to estimate for risk management purposes which vulnerability must be estimated for additional controls first? Which vulnerability must be evaluated last?

  How much laser be tipped before light no longer continues

If a laser is to be pointed into the end of the fibre, but is "tipped" to one side by θ degrees, how much can the laser be "tipped" before the light no longer continues down the fibre?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd