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

  Explaining threat category

An individual threat can be represented in more than one threat category. If a hacker hacks into a network, copies a few files.

  Determining smallest-last vertex ordering

Determine a smallest-last vertex ordering and plot degree when deleted diagram for given random geometric graphs.

  Discuss whether you accept demand from manager

Discuss whether you should accept this demand from your manager or whether you should persuade your team to give their time to the organization rather than to their families. What factors might be significant in your decision?

  Adding two unsigned and signed binary numbers

Add the two binary numbers and interpret the sum assuming that the numbers are (1) unsigned, and (2) signed.

  Describing online services provided by selected companies

Identify and briefly describe the online services provided by the selected companies (e.g. online catalogue search, online information search.

  Dscribe implications of e-publishing they effect way we read

Dscribe implications of e-publishing as they effect way we read and understand content. Describe e-books, print on demand, copyright and XrML and use of multimedia.

  Function in programs to print upside down triangles

Apply function in programs to prints triangles, upside down triangles, and diamond.

  How computer technology has changed our society

How have the major players including the government either made these statements true or false? What are examples of why or why not.

  Odd-length cycle in directed graph by linear-time algorithm

Give a linear-time algorithm to find an odd-length cycle in a directed graph. You may NOT assume that the graph is strongly connected.

  Prediction for open standards that may change world again

In April of 1990, entire concept of domain was born, and email addresses "opened up". What might be the prediction about more open standards which may change our world again?

  Determining asymptotic formula for recurrence equations

Give an asymptotic formula for each of the recurrence equations given below, using big "Θ" rather than just big "O" for better results when possible.

  Explain compiler assign subcomputations

How would you have compiler assign 14 subcomputations to 15 cores? Describe briefly. (Symmetry means there is no unique answer).

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