Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

--funroll-loops?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
Ph0eniX
Guru
Guru
User avatar
Posts: 502
Joined: Fri Sep 24, 2004 8:59 pm
Location: New York, U.S.

--funroll-loops?

  • Quote

Post by Ph0eniX » Sat Feb 03, 2007 6:08 pm

I saw this in someone's make.conf. What does the "--funroll-loops" options do?

Grazie! :)
Top
Elfan
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Tue Aug 15, 2006 12:57 am

  • Quote

Post by Elfan » Sat Feb 03, 2007 7:15 pm

From the gcc manual

Code: Select all

-funroll-loops
    Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop. -funroll-loops implies both -fstrength-reduce and -frerun-cse-after-loop. This option makes code larger, and may or may not make it run faster.
-funroll-all-loops
    Unroll all loops, even if their number of iterations is uncertain when the loop is entered. This usually makes programs run more slowly. -funroll-all-loops implies the same options as -funroll-loops, 
See this page for more info.
Top
koziolek
n00b
n00b
User avatar
Posts: 25
Joined: Sun Jan 28, 2007 9:03 am
Location: Warsaw, Poland
Contact:
Contact koziolek
Website

Re: --funroll-loops?

  • Quote

Post by koziolek » Sat Feb 03, 2007 8:21 pm

Ph0eniX wrote:What does the "--funroll-loops" options do?
In make.conf they slow things down :). In some special applications they can give much speed-up but generally (in make.conf) they are a bad idea.
WWW
Beer is proof that God loves us and wants us to be happy. (Benjamin Franklin)
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Feb 03, 2007 9:32 pm

Ph0eniX,

Its an attempt to make code faster by making it bigger.
Normally a loop involves a jump instruction, back to the start of the loop, which takes up time and space and if the branch prediction fails, causes a CPU stall. The jump adds nothing to the programs output.

The jump instruction can be removed by repeating the loop code as many times as is needed, removing the above disadvatanges. However, the code gets bigger, when ran from cache may no longer fit in the cache, so it gets slower again while cache misses are addressed.

In general, optimisations like this, that make the code bigger, should only be used where you have time to test to ensure they have the desired effect. That means you don't use them globally in make.conf.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Ph0eniX
Guru
Guru
User avatar
Posts: 502
Joined: Fri Sep 24, 2004 8:59 pm
Location: New York, U.S.

  • Quote

Post by Ph0eniX » Tue Feb 06, 2007 5:41 pm

Thanks everyone! :)
Top
Post Reply

5 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic