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

Michael Niedermayer michaelni
Fri Aug 11 19:52:36 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.
> Tested on linux and OS X, no regressions broken, .o's are identical. On 
> linux despite indications I could see in gas source, .align is NPOT. On OS 
> X it is POT.
> Comments?

iam ok with the patch but i have the feeling that the configure part will
need amendment as old gas had the habit of assembling anything no matter
if the instructions existed or not, so i wouldnt be surprised if some gas
versions would accept .align 3 even though they arent using 3 as exponent

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list