public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Toon Moene <toon@moene.indiv.nluug.nl>
To: Richard Henderson <rth@cygnus.com>
Cc: egcs@cygnus.com
Subject: Re: More than you ever wanted to know about Fortran array indexing;-)
Date: Mon, 06 Oct 1997 07:02:00 -0000	[thread overview]
Message-ID: <9710061346.AA05616@moene.indiv.nluug.nl> (raw)
In-Reply-To: <19971005174628.31661@dot.cygnus.com>

>  The appended patch, I believe, does this.  The result is
>  relatively good code for all of the examples that have
>  been posted so far.

Yep, the timing for bs3dvw.f also is around the same value as with  
the FFECOM_FASTER_ARRAY_REFS "solution".  BTW, it seems to be very  
hard to get consistent timings on a Linux Alpha - in five runs I got  
anywhere between 3.6 and 4.3 seconds, whereas on my machine it is  
consistent up to the tenth of seconds (and it takes 90 seconds !).

>  Only, I would like to see loop take y[i-1], y[i], y[i+1],
>  make one induction variable, and use -4(R), 0(R), 4(R)
>  in the loop.  Hmm...

This is a nice follow-on project :-)  Note that lots of  
computational physics code is based on finite difference or finite  
element algorithms, which all have these opportunities for  
optimisation.

Or recognise that, on loop unrolling, you've got the following  
equivalences:

1	y(i-1)	y(i)	y(i+1)
2		y(i-1)	y(i)	y(i+1)
3			y(i-1)	y(i)	y(i+1)
4				y(i-1)	y(i)	y(i+1)

Anyway, we can consider this problem "solved" (apply Jeff's `use'  
patch, your `expr' patch, my `fold' patch and your `frontend'  
patch), unless Craig objects against the frontend changes.

There is namely a pedantic-standards-interpretation question hiding  
in your frontend patch:  Should the compiler evaluate each and  
every expression in the mode it is written in ?  Note that  
currently, g77+backend as a whole already violate that rule because  
of the `sizetype' promotion `expr.c' does.  What your frontend patch  
does is lift this uncleanliness up into the frontend ...

We'll see - Craig has the last word on this.

Cheers,
Toon.

PS: I'm starting a test now with all those patches applied to  
egcs-970929, to see if it still works on my Fortran code ;-)

PS2: My `fold' patch has a typo; somewhere it says:
+               && multiple_of_p (Ttype, REE_OPERAND (xarg0, 1), arg1))
     Obviously, this should be:
+               && multiple_of_p (type, TREE_OPERAND (xarg0, 1),  
arg1))

  reply	other threads:[~1997-10-06  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-05  5:02 More than you ever wanted to know about Fortran array indexing ;-) Toon Moene
1997-10-05 17:49 ` Richard Henderson
1997-10-06  7:02   ` Toon Moene [this message]
1997-10-07 23:14   ` More than you ever wanted to know about Fortran array indexing;-) Toon Moene
1997-10-08 21:19     ` More than you ever wanted to know about Fortran array indexing ;-) Jeffrey A Law
1997-10-09 15:14       ` More than you ever wanted to know about Fortran array indexing;-) Toon Moene
1997-10-13  9:27         ` More than you ever wanted to know about Fortran array indexing ;-) Jeffrey A Law

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=9710061346.AA05616@moene.indiv.nluug.nl \
    --to=toon@moene.indiv.nluug.nl \
    --cc=egcs@cygnus.com \
    --cc=rth@cygnus.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).