From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1726 invoked by alias); 11 Feb 2003 10:07:01 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 1709 invoked from network); 11 Feb 2003 10:06:58 -0000 Received: from unknown (HELO mail.dark.lan) (213.121.98.76) by 172.16.49.205 with SMTP; 11 Feb 2003 10:06:58 -0000 Received: (qmail 13271 invoked from network); 11 Feb 2003 10:06:56 -0000 Received: from lemsip.dark.lan (192.168.0.20) by 0 with SMTP; 11 Feb 2003 10:06:56 -0000 Subject: Altivec + 16 byte alignment From: Gianni Tedesco To: gcc@gcc.gnu.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-sPG5zvLiA8ai6EGFt1va" Date: Tue, 11 Feb 2003 10:07:00 -0000 Message-Id: <1044958034.1117.67.camel@lemsip> Mime-Version: 1.0 X-SW-Source: 2003-02/txt/msg00624.txt.bz2 --=-sPG5zvLiA8ai6EGFt1va Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 1055 Hi, I'm currently working on a project which uses altivec (as inline assembly) to perform 3d affine transformations, and some other 3d vector functions. I have a problem in that altivec requires all inputs to be 16 byte aligned, so I am placing my vectors in a structure like this: struct vector { float x,y,z,w; }__attribute__((aligned(16))); 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? gcc version 2.95.4 20010319 (prerelease/franzo/20011204) PS. Is there any documentation about the vector support directly in C? I hear gcc3 has that feature. Thanks. PS. Please CC replies, im not a list subscriber. --=20 // Gianni Tedesco (gianni at scaramanga dot co dot uk) lynx --source www.scaramanga.co.uk/gianni-at-ecsc.asc | gpg --import 8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D --=-sPG5zvLiA8ai6EGFt1va Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA+SMtRkbV2aYZGvn0RApZ3AJoD64xFAMj48KIVF9I9AC9/PbhcmgCdGkWN HvBD1mFdq86onfH9fR+t1eQ= =K+lI -----END PGP SIGNATURE----- --=-sPG5zvLiA8ai6EGFt1va--