public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Igor Bukanov <igor@mir2.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Aligning function on a page boundary
Date: Wed, 27 Feb 2008 14:00:00 -0000	[thread overview]
Message-ID: <20080227130900.GA8976@uranus.ravnborg.org> (raw)
In-Reply-To: <7dee4710802270451t5c6359deo2dacd0c5f4a60308@mail.gmail.com>

On Wed, Feb 27, 2008 at 01:51:10PM +0100, Igor Bukanov wrote:
> Hi,
> 
> is it possible with GCC 4.1 to align one single function on a CPU page
> boundary for ELF targets? This is very desired since the function in
> question is an interpreter loop . It has 50K of code and is executed
> very often. Aligning it on the page boundary should reduce TLB misses.
> 
> It seems the forthcoming GCC 4.3 allows that as it supports the align
> attribute for functions,  but it would be nice to do that with GCC
> 4.1.

One way is to use the section attribute to tell gcc to put the
function in a specific section and then in the linker script
page align said section.
This is used extensively in the linux kernel.

	Sam

  reply	other threads:[~2008-02-27 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 13:09 Igor Bukanov
2008-02-27 14:00 ` Sam Ravnborg [this message]
2008-02-27 14:08   ` Igor Bukanov
2008-02-27 17:43     ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080227130900.GA8976@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=igor@mir2.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).