Definition of _ALIGNBYTES

Matt Sealey matt at genesi-usa.com
Mon Jul 31 09:14:40 UTC 2006


Does FreeBSD support AltiVec usage in the kernel? 

If so _ALIGNBYTES may as well be 15, otherwise you would spend all your
life realigning vector data if you ever wanted to use it :)

Actually in all seriousness, 3 is right. If you longword align all your
data, any misalignment is handled in hardware (fairly fast too). If you
are trying to get some serious performance out of things you would
probably want to 8-byte align your floating point values, and 16-byte
align your vector values, and you can do this manually at the time
you need it. Otherwise, aligning everything to a 4-byte boundary is
just fine and dandy.

-- 
Matt Sealey <matt at genesi-usa.com>
Manager, Genesi, Developer Relations


> -----Original Message-----
> From: owner-freebsd-ppc at freebsd.org 
> [mailto:owner-freebsd-ppc at freebsd.org] On Behalf Of Marcel Moolenaar
> Sent: Saturday, July 29, 2006 10:10 PM
> To: ppc at FreeBSD.org
> Subject: Definition of _ALIGNBYTES
> 
> All,
> 
> In /usr/include/sys/param.h (or 
> src/sys/powerpc/include/param.h), _ALIGNBYTES is defined as 
> (sizeof(int) - 1), or 3. It is supposed to represent the mask 
> used by ALIGN() to yield an alignment suitable for all types. 
> The alignment of the double, long long, and long double types 
> is 8, which would imply that _ALIGNBYTES should be 7. All 
> platforms, except i386, have this "right".
> 
> I don't know how vital this definition is, but I do know that 
> increasing it yields an ABI breakage (I noticed that ssh(1) 
> stopped working). The ABI breakage is not severe enough that 
> you cannot increase and decrease it without being able to do 
> a buildworld.
> 
> My question: should we bump it up while powerpc is still tier 2?
> 
> -- 
>   Marcel Moolenaar         USPA: A-39004          marcel at xcllnt.net
> 
> 
> _______________________________________________
> freebsd-ppc at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ppc
> To unsubscribe, send any mail to "freebsd-ppc-unsubscribe at freebsd.org"
> 



More information about the freebsd-ppc mailing list