Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vector Alignment and AltiVec



> Message: 1
> To: email@hidden, email@hidden
> From: Kyros Yakinthos <email@hidden>
> Subject: Vector Alignment and AltiVec
> Date: Thu, 8 Apr 2004 10:38:42 +0300
> 
> Hello again,
> 
> I am still waiting my 2 duals G5 Xserve and Xcluster and I have started
> working on AltiVec (reading documents, trying to link AltiVec C
> instructions with FORTRAN etc into my PBG4..)
> I have a simple question:
> Vector Alignment: when I use a standard FORTRAN or C compiler (xlf or
> gcc 3.x)
> should I always align my vectors or is this done by default by the
> compiler?
> I am asking this because I have found some documents where it is
> written that
> I must align my vectors and documents where it is written that when a
> compiler
> is used there is no problem and no need for alignment...
> 
> Thank you in advance,
> 
> Kyros

If you use malloc with f77 or allocate with f90, you will automatically be
aligned on at least a 16-byte boundary, and everything will work
wonderfully.  I did encounter some strange and bizarre results in my early
days of programming with AltiVec and FORTRAN, which were due to
misalignment.  While troubleshooting, I rediscovered the fact that dynamic
memory aligns to certain boundaries (usually larger than but a multiple of
16-byte).

Craig


-- 
Dr. Craig Hunter
NASA Langley Research Center
AAAC/Configuration Aerodynamics Branch
email@hidden  (new!!)
(757) 864-3020
(Dual G4 - OS X)
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.