Re: MAD/ARM archeology..

Andre <[email protected]> Fri, 14 Apr 2006 02:58:20 +0100 (BST)
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
--- Nicolas Pitre <[email protected]> wrote:
> On Thu, 13 Apr 2006, john cooper wrote:
> > Hello,
> > 
> > With 0.13 libmad there seems to be some really
> > funky decode artifacts in libmad 0.13/ARM (but
> > not in 0.15.1) which I couldn't explain.  I
> > noticed a few ARM-specific changes in fixed.h
> > between 0.15.1 and 0.13 as well as what appear
> > to be some tweaks called out in the CHANGES file.
> > 
> > But the echo-like decode artifacts were so dramatic
> > I can't believe they would have gone unnoticed nor
> > unaddressed.  I suppose it could be some odd build
> > issue local to my work but that seems rather remote.
> > Anyone encounter any similar issue specific to ARM
> > in or around that vintage?
> 
> Pay attention to the inline asm register constraint.  There is
> probably a missing '&' somewhere in v0.13 if my memory is right.
> 

Yes - fixed sometime after v0.14.2
Here's the patch I sent to Rob on Feb 15th 2002:

diff -ruN mad-0.14.2b_original/libmad/fixed.h
mad-0.14.2b/libmad/fixed.h
--- mad-0.14.2b_original/libmad/fixed.h	Fri Nov  2 01:51:06 2001
+++ mad-0.14.2b/libmad/fixed.h	Fri Feb 15 22:56:15 2002
@@ -275,7 +275,7 @@
     ({ mad_fixed_t __result;  \
        asm ("movs	%0, %1, lsr %3\n\t"  \
 	    "adc	%0, %0, %2, lsl %4"  \
-	    : "=r" (__result)  \
+	    : "=&r" (__result)  \
 	    : "r" (lo), "r" (hi),  \
 	      "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS)  \
 	    : "cc");  \

Andre
--