public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Oskar Enoksson <osken393@student.liu.se>
To: egcs@cygnus.com, Mike Stump <mrs@wrs.com>
Subject: Re: Alpha and -funroll-loops
Date: Tue, 22 Sep 1998 19:31:00 -0000	[thread overview]
Message-ID: <Pine.GSO.3.96.980922203612.7109R-100000@lystra.lysator.liu.se> (raw)

> Also, I searched invoke.texi, and didn't find the mention, can you
> quote a portion of it for me?

In info/gcc-info-12 of snapshot 980914:

   * Loop unrolling doesn't work properly for certain C++ programs.
     This is a bug in the C++ front end.  It sometimes emits incorrect
     debug info, and the loop unrolling code is unable to recover from
     this error.

I tried some c-code and noticed that loops of known lengths are not 
detected by gcc on Alpha and therefore -funroll-loops has no effect. Is
this the bug? For example, the following code is not unrolled with
-funroll-loops:

/* gcc -O3 -funroll-loops -S unroll_me.c */

main() {
  float a[50][50][50];
  int i,j,k;

  for(k=0; k<50; k++)
    for(j=0; j<50; j++)
      for(i=0; i<50; i++)
        a[k][j][i]=2*a[k][j][i]-.5*a[k][j][i]*a[k][j][i]*a[k][j][i];
}

With -funroll-all-loops the code is unrolled, but the test i<50 is 
also unrolled (not as with g77 which would unroll the above in five
instances, only testing after every fifth operation). This unrolling does
not improve speed at all on my Alpha.

The resulting executable is 3 times slower than corresponding g77-code
on my Alpha 433, (no L3 cache) because g77 -funroll-loops works fine on
the Alpha.

All this is true for both egcs 1.1 and snapshot 980914.

I think gcc unrolled the above code correctly on my Pentium with
-funroll-loops (can't check it right now though).

Regards.
/Oskar


             reply	other threads:[~1998-09-22 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-22 19:31 Oskar Enoksson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-09-22 11:27 Mike Stump
1998-09-21 19:37 Oskar Enoksson
1998-09-23  5:00 ` Dave Love

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=Pine.GSO.3.96.980922203612.7109R-100000@lystra.lysator.liu.se \
    --to=osken393@student.liu.se \
    --cc=egcs@cygnus.com \
    --cc=mrs@wrs.com \
    /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).