public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Egger <degger@fhm.edu>
To: Gianni Tedesco <gianni@scaramanga.co.uk>
Cc: gcc@gcc.gnu.org
Subject: Re: Altivec + 16 byte alignment
Date: Tue, 11 Feb 2003 23:58:00 -0000	[thread overview]
Message-ID: <1045011290.463.7.camel@alex> (raw)
In-Reply-To: <1044958034.1117.67.camel@lemsip>

On Tue, 2003-02-11 at 11:07, Gianni Tedesco wrote:

> gcc version 2.95.4 20010319 (prerelease/franzo/20011204)

Please do yourself a favour and ditch that Motorola crap. Gcc supports
AltiVec natively since 3.1 and does a much better job at things similar
to your problem.

Your problem is fixed by supplying the -mabi=altivec switch to gcc 3.1
or later as demonstrated by the following dump program:

struct vector {
  float x,y,z,w;
}__attribute__((aligned(16)));
                                                                                
int main (void)
{
  short a = 0;
  struct vector b = {1, 2, 3};
  int c = 4;
  struct vector d = {4, 5, 6};
  printf ("address: %p\n", &a);
  printf ("address: %p\n", &b);
  printf ("address: %p\n", &c);
  printf ("address: %p\n", &d);
}


egger@sonja:~$ gcc  -o test test.c
egger@sonja:~$ ./test
address: 0x7ffff9a8
address: 0x7ffff9b0
address: 0x7ffff9c0
address: 0x7ffff9c8

egger@sonja:~$ gcc  -mabi=altivec -o test test.c
egger@sonja:~$ ./test
address: 0x7ffff9a8
address: 0x7ffff9b0
address: 0x7ffff9c0
address: 0x7ffff9d0

> PS. Is there any documentation about the vector support directly in C? I
> hear gcc3 has that feature.

Check back with altivec.h in gcc 3.1 or later. The C implementation is
horrible though compared to the C++ one realized with overloading.

--
Servus,
       Daniel

  parent reply	other threads:[~2003-02-11 23:58 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
2003-02-11 14:32 ` Michael S. Zick
2003-02-11 14:49   ` Gianni Tedesco
2003-02-11 23:58 ` Daniel Egger [this message]
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=1045011290.463.7.camel@alex \
    --to=degger@fhm.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=gianni@scaramanga.co.uk \
    /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).