[MPlayer-users] Impossible operand error compiling for strongarm

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Feb 3 17:05:14 CET 2009


On Tue, Feb 03, 2009 at 08:55:39AM -0600, Christopher L wrote:
> > On Mon, Feb 02, 2009 at 10:22:55PM -0600, Christopher L wrote:
> >> So I go over to the offending line in arm/mathops.h.  After reading a few tutorials on assembly, I have found the following.
> >> 1)  The "+" modifier isn't allowed by gcc in inline assembly.
> > 
> > What gave you that idea?
> 
> http://www.ethernut.de/en/documents/arm-inline-asm.html
> 
> ARM GCC Inline Assembler Cookbook
> +
>                     
>                     Read-write operand (not supported by inline assembler)
>                     
> 
> I have seen it mentioned elsewhere also.

Well, it contradicts the official documentation:
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Modifiers.html#Modifiers
I have not been able to find any other document claiming '+' does not
work on ARM (and I know it works on x86 since at least 2.95), only lots
of copies of that very same page.

> >> 2)  gcc uses "AT&T" syntax which is "operation source destination"
> > 
> > "AT&T-syntax" only exists for x86, so it sure can't use that for ARM. It
> > uses whatever the gnu assembler uses, searching for "GNU assembler ARM"
> > should find enough tutorials.
> 
> http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s3
> 
> GCC, the GNU C Compiler for Linux, uses AT&T/UNIX assembly syntax.
> ...
> The  direction  of the operands in AT&T syntax is opposite to that of Intel. In Intel syntax the first operand is the  destination, and the second operand is the source whereas in AT&T syntax the first operand is the sourceand the second operand is the destination. ie, 

That is only about x86 and has no relevance for ARM. ARM does not have
Intel or AT&T syntax, it has ARM syntax. The fact that above description
is complete nonsense for 3-operand instructions that are common on ARM
should be a hint it does not apply to it.

> >>         : "=&r"(m), "+r"(a)
> >>         : "r"(b), "r"(c));
> 
> I'd be surprised if it were the number of registers because I also read somewhere that you really don't run into issues unless you approach 10.

You run into issues exactly when your compiler is too stupid to get it
right, that does not always depend on how many register you use.
I'd strongly suggest just trying a different compiler version before
spending too much time on it.



More information about the MPlayer-users mailing list