public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: <tm_gccmail@mail.kloo.net>
To: Gianni Mariani <gmariani@chaincast.com>
Cc: Gianni Tedesco <gianni@scaramanga.co.uk>, gcc@gcc.gnu.org
Subject: Re: Altivec + 16 byte alignment
Date: Tue, 11 Feb 2003 19:26:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.21.0302111117210.26750-100000@mail.kloo.net> (raw)
In-Reply-To: <3E49061A.4020608@chaincast.com>

On Tue, 11 Feb 2003, Gianni Mariani wrote:

> Gianni Tedesco wrote:
> 
> >Hi,
> >
...
> >This seems to work for global variables, but when allocated on the
> >stack, my structures end up mis-aligned (on to 8-byte boundaries) which
> >totally screws up the results of the altivec computation.
> >
> >Is this a compiler problem, or can't the compiler be expected to
> >guarantee alignments that large?
> >
> 
> This is a problem with the malloc implementation.
> 
> Most malloc's support 8 byte alignment.  You could specifically tune one 
> of the
> many malloc packages out there to be 16 byte aligned and hence this 
> would solve
> your problem.

malloc is not responsible for allocating stack space, and therefore cannot
be implicated as the culprit for the set of circumstances he is
describing.

The basic problem is the compiler does not know the alignment of the
staack when the function is entered, so it doesn't know the amount of
offset required to align the stack to a particular boundary.

The only way to solve this is to example the stack pointer at runtime and
mask off bits in it to align the stack, which isn't currently supported
as an option in gcc.

Toshi


  parent reply	other threads:[~2003-02-11 19:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-11 10:07 Gianni Tedesco
2003-02-11 14:18 ` Gianni Mariani
2003-02-11 14:49   ` Gianni Mariani
2003-02-11 14:57     ` Gianni Tedesco
2003-02-11 19:26   ` tm_gccmail [this message]
2003-02-11 14:32 ` Michael S. Zick
2003-02-11 14:49   ` Gianni Tedesco
2003-02-11 23:58 ` Daniel Egger
2003-02-14  2:41 ` Segher Boessenkool
2003-02-14 16:07   ` Michael S. Zick
2003-02-11 17:25 John David Anglin
2003-02-11 18:29 ` Franz Sirl
2003-02-11 18:32   ` David Edelsohn
2003-02-11 18:57     ` Franz Sirl
2003-02-11 22:35       ` Spundun Bhatt
     [not found]         ` <1045070773.1118.140.camel@lemsip>
2003-02-12 18:06           ` Spundun Bhatt
2003-02-12  0:42   ` Richard Henderson
2003-02-12 21:17     ` Franz Sirl
2003-02-12 21:46       ` Richard Henderson
2003-02-12 22:31         ` Franz Sirl
2003-02-13  0:04           ` Gabriel Paubert
2003-02-12 22:47         ` John David Anglin
2003-02-13  0:40           ` Richard Henderson
2003-02-13  6:31             ` John David Anglin
2003-02-13  8:59               ` Richard Henderson
2003-02-13 18:06                 ` John David Anglin
2003-02-11 18:34 Richard Kenner
2003-02-11 18:59 ` Geoff Keating
2003-02-11 19:03 Richard Kenner
2003-02-11 19:11 ` Mike Stump
2003-02-11 19:26 ` Geoff Keating
2003-02-11 19:40   ` David Edelsohn
2003-02-11 20:29   ` Neil Booth
2003-02-11 20:45     ` Geoff Keating
2003-02-11 22:03       ` Neil Booth
2003-02-11 22:07         ` Neil Booth
2003-02-11 20:01 ` Geert Bosch
2003-02-11 19:18 Richard Kenner
2003-02-11 19:43 Richard Kenner
2003-02-11 20:02 ` Geoff Keating
2003-02-12  0:52   ` Richard Henderson
2003-02-11 19:44 Richard Kenner
     [not found] <no.id>
2003-02-11 19:59 ` John David Anglin
2003-02-11 21:02   ` Mike Stump
2003-02-12  5:55     ` Fergus Henderson
2003-02-12 16:39       ` John David Anglin
2003-02-11 20:33 Richard Kenner
2003-02-11 20:34 ` Neil Booth
2003-02-11 20:36 Richard Kenner
2003-02-11 20:39 ` Neil Booth
2003-02-11 20:46 ` tm_gccmail
2003-02-11 21:10 Richard Kenner
2003-02-11 22:05 Richard Kenner
2003-02-11 22:09 ` Neil Booth
2003-02-11 22:10 Richard Kenner
2003-02-11 22:15 ` Neil Booth
2003-02-11 22:18 Richard Kenner
2003-02-11 22:25 ` Neil Booth
2003-02-11 22:27 Robert Dewar
2003-02-11 22:28 Richard Kenner
2003-02-12 14:15 Richard Kenner

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.LNX.4.21.0302111117210.26750-100000@mail.kloo.net \
    --to=tm_gccmail@mail.kloo.net \
    --cc=gcc@gcc.gnu.org \
    --cc=gianni@scaramanga.co.uk \
    --cc=gmariani@chaincast.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).