Solved

Loop unrolling

Posted on 2002-07-01
1
241 Views
Last Modified: 2010-04-15
What are loop overheads? How are they overcome by unrolling?

Please let me know

Thanks,
Arut
0
Comment
Question by:arut
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 7121621
A 'loop overhead' is e.g.

int i;

for ( i = 0; i < 3; i++) {

 printf ( "i: %d\n", i);
}

Here, checking whether 'i' is smaller than 3 is the overhead.

'Unrolling' would make it

 printf ( "i: %d\n", i);
 printf ( "i: %d\n", ++i);
 printf ( "i: %d\n", ++i);

thus avoiding the overhead. But, you can also see the limitations if the loop bound is not constant.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Retrun object in plist format 5 55
In C, why can't I shift a 64-bit integer more than 32 bits? 13 204
IIS Log files on Exchange 2013 server 6 84
What is sub-make ? 2 39
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now