[Ffmpeg-devel] Mac OS X Intel last part: balign directives

Rich Felker dalias
Fri Aug 18 19:05:50 CEST 2006


On Fri, Aug 11, 2006 at 04:00:14PM +1000, John Dalgliesh wrote:
> 
> Hi,
> 
> On Thu, 10 Aug 2006, Luca Abeni wrote:
> >
> >I think Rich Felker described the correct solution:
> >---
> >The solution is to make a test in configure to test the behavior of
> >align. First try assembling a file with .balign or .p2align. If one
> >fails try the other. If both fail, first try .align 3. This will fail
> >if .align takes its argument in bytes rather than as the number of low
> >bits that must be zero; if it does try .align 8. If they all fail,
> >disable alignment altogether and hope it's not needed. :) Then include
> >a definition of BALIGN_8 and BALIGN_16 in config.h.
> >---
> >
> >So, configure should write the right "#define ASMALIGN8  ..." and
> >"#define ASMALIGN16 ..." in config.h
> 
> Thanks, patch attached: balign-generalise.patch.
> Determines whether .align's arg is power-of-two or not, then defines 
> ASMALIGN appropriately in config.h. Changes all .baligns to ASMALIGNs.
> 
> Notes:
> - doesn't bother with .balign or .p2align; may as well use the standard 
> .align directive (once we know what it does) if we're going to the trouble 
> of testing for stuff.
> - ASMALIGN's arg is ZEROBITS, i.e. num of low bits in addr to make zero. I 
> wanted a general ASMALIGN macro, and 1<< is easier than log2/cntlzw/bsr.

I like this approach a lot!

Rich





More information about the ffmpeg-devel mailing list