public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Craig Burley <burley@gnu.org>
To: davem@dm.cobaltmicro.com
Cc: law@cygnus.com, d.love@dl.ac.uk, toon@moene.indiv.nluug.nl,
	egcs@cygnus.com
Subject: Re: ix86 double alignment (was Re: egcs-1.1 release schedule)
Date: Tue, 23 Jun 1998 06:30:00 -0000	[thread overview]
Message-ID: <199806231317.JAA11446@melange.gnu.org> (raw)
In-Reply-To: <199806230945.CAA20017@dm.cobaltmicro.com>

>   Date: Mon, 22 Jun 1998 14:29:42 -0400 (EDT)
>   From: Craig Burley <burley@gnu.org>
>
>   A case we can't 64-bit align is:
>
>	   real r(2)
>	   double precision d1, d2
>	   equivalence (r(1),d1)
>	   equivalence (r(2),d2)
>
>   Regardless of whether this is stack, static, or even part of a common
>   block, we can't 64-bit align both d1 and d2.  (Well, not without
>   an option to completely change the way we implement Fortran; I wonder
>   if Sun does that to support weird-but-conforming code on SPARCs,
>   such as the above.)
>
>I can give some insight to this on certain cases on the Sparc.
[...]
>This would need some investigation before such a scheme is enable in
>egcs, so I'd say defer thinking about it until after the 1.1 release
>happens.

Yes, let me make this clear.  I brought up SPARC only to illustrate
my awareness that this issue is a general one for all gcc targets
in theory at least and in practice for at least two targets (x86
and SPARC), probably others as well (`sh', whatever that is, already
seems to have its own work done in this area...can someone send me
a `sh' machine please? ;-).

I am *not* recommending any of the changes we're discussing actually
applying to code generation on SPARCs at all, at least not in the
short term (1.1).

In particular, while this align-doubles-properly-or-performance-will-
really-really-suck issue has *frequently* come to my attention for
the x86 architecture, basically *never* can I recall anyone complaining
about not being able to compile real Fortran code using standard-
conforming (but, as Dave Love rightly points out, nonportable due
to machines like SPARC) constructs like the one I illustrated above.

My impression: SPARC users, even of g77, have already been "trained"
by Sun to not expect some weird force-bad-alignment code to work
on that architecture.  So they don't complain to us, either.

(And, yes, there is a way to "fix" this problem: provide a command-line
option that the compiler handles by making all ints and floats 64-bit,
all doubles 128-bit, and adjusting the run-time libraries and so on
accordingly.  Not that the *precision* goes up, just that the Fortran
INTEGER, LOGICAL, and REAL types suddenly have 32 useful bits and 32
junk bits in 64 bits of space, DOUBLE PRECISION and COMPLEX have 64+64
bits, and so on.  With only a relatively small amount of hair, this
makes full Fortran standards conformance possible, and makes most
data needs expand by a factor of two with no increase in precision or
range and a general decrease in run-time performance.  A great way to
discourage people from insisting that their old codes run without
modification.  Can't recall what I've been told, if anything, about
whether Sun provides such an option in any of its Fortran compilers.
Perhaps just the *threat* of "solving" this problem this way is all
that has ever been needed, like the cold-war MAD policy regarding use
of nuclear armaments.  But I can't recall anybody asking for this option
in g77, though I might be so quick to say "fine, send us lots of money"
that I forgot all about any such requests.  :)

So, the tempting thing some people have thought is "well, SPARC
users are used to a `broken' Fortran implementation for years,
being happier with the performance gains; why not foist this on
Intel users?"  Unfortunately, the existing user base, library
code, and iron base makes this worth solving for only newer
instances of those, but not worth breaking for the older ones.

The upshot: when [56]86 users aren't using "dangerous" options like
`-malign-double', we still need to do 64-bit alignment wherever
possible but without breaking compatibility to get decent
performance.

BTW, as much as I want this problem "cured" for [56]86 users in egcs
1.1, I *really* hope the libm performance problems on Alpha are
generally fixed by the time such a version of egcs is released,
because it disturbs me a bit that we might make [56]86 appear
even better price/performance-wise than Alphas than they have in
the past, especially since we *know* we can speed up the Alphas
more than the [56]86 just by fixing just the software.  (And,
intentionally, I've kept the Alpha architecture manual within
reach, but not the ix86 one so, for over a year now.  :)

        tq vm, (burley)

  reply	other threads:[~1998-06-23  6:30 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-18  1:32 egcs-1.1 release schedule Jeffrey A Law
1998-06-19  9:02 ` Gerald Pfeifer
1998-06-19 23:47   ` Jeffrey A Law
1998-06-19 11:57 ` Dave Love
1998-06-21 21:43   ` Craig Burley
1998-06-21 23:07   ` Jeffrey A Law
1998-06-22  5:19     ` David S. Miller
1998-06-22 12:04       ` Dave Love
1998-06-22 13:45       ` Toon Moene
1998-06-22 22:29         ` Jeffrey A Law
1998-06-22 18:20       ` ix86 double alignment (was Re: egcs-1.1 release schedule) Craig Burley
1998-06-23  3:32         ` Jeffrey A Law
1998-06-23  5:13           ` Craig Burley
1998-06-23  3:32         ` David S. Miller
1998-06-23  6:30           ` Craig Burley [this message]
1998-06-22 12:04     ` ix86 `double' " Craig Burley
1998-06-23  3:32       ` Jeffrey A Law
1998-06-23  5:13         ` Craig Burley
1998-06-24  2:28           ` Jeffrey A Law
1998-06-24 14:50             ` Craig Burley
1998-06-25  0:25               ` Jeffrey A Law
1998-06-25  9:59                 ` Tim Hollebeek
1998-06-28 18:01                 ` Marc Lehmann
1998-06-22 12:04     ` egcs-1.1 release schedule Dave Love
1998-06-23  3:32       ` Jeffrey A Law
1998-06-23  9:29         ` H.J. Lu
1998-06-24 17:12           ` x86 double alignment (was egcs-1.1 release schedule) Marc Lehmann
1998-06-25  0:25             ` Jeffrey A Law
1998-06-28 18:02               ` Marc Lehmann
1998-06-25 12:33             ` PÃ¥l-Kristian Engstad
1998-06-28 18:02               ` Marc Lehmann
1998-06-25 21:48             ` Craig Burley
1998-06-25 18:53               ` Jeffrey A Law
1998-06-28 22:41               ` Marc Lehmann
1998-06-29  5:20                 ` Martin Kahlert
1998-06-29 11:08                   ` Jeffrey A Law
1998-06-29 19:43                   ` Craig Burley
1998-06-29 20:41                 ` Craig Burley
1998-06-30  0:42                   ` Jeffrey A Law
1998-06-30  8:19                     ` gcc2 merge H.J. Lu
1998-06-30 19:49                       ` Jeffrey A Law
1998-06-30  4:50                 ` x86 double alignment (was egcs-1.1 release schedule) Jeffrey A Law
1998-06-23  3:32       ` egcs-1.1 release schedule Craig Burley
1998-06-20  6:41 ` Gabriel Dos Reis
1998-06-20  9:22   ` Joe Buck
1998-06-20 15:36     ` Mark Mitchell
1998-06-21  0:07   ` Jeffrey A Law
1998-06-23  3:32 ix86 double alignment (was Re: egcs-1.1 release schedule) John Wehle
1998-06-23 15:06 ` Craig Burley
1998-06-23 22:55   ` Jeffrey A Law
1998-06-24 10:08   ` Dave Love
1998-06-24 21:23     ` Jeffrey A Law
1998-06-23 10:23 ix86 `double' " John Wehle
1998-06-23 14:56 ` Craig Burley
1998-06-23 22:55 ` Jeffrey A Law
1998-06-24 17:12 ix86 double " John Wehle
1998-06-24 21:23 ` 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=199806231317.JAA11446@melange.gnu.org \
    --to=burley@gnu.org \
    --cc=d.love@dl.ac.uk \
    --cc=davem@dm.cobaltmicro.com \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    --cc=toon@moene.indiv.nluug.nl \
    /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).