[Ffmpeg-devel] [PATCH] '/nop' illegal for old versions of GAS

Michael Niedermayer michaelni
Fri Aug 4 12:44:15 CEST 2006


Hi

On Fri, Aug 04, 2006 at 11:42:09AM +1000, Nigel Pearson wrote:
[...]

> >>	nop is is not a numeric expression, but to be
> >>perfect, the line should be something like " # nop"?
> >>Sadly, that requires re-writing of the macros.
> >
> >if you do that, use #define NOP " # nop" and then use NOP
> 
> 	I wish I could. On an Intel Mac, that results in:
> 
> "pmaddwd %%mm6, %%mm1           \n\t"      # " # nop   " ", %%mm4       
>         \n\t"        "movq %%mm4, %%mm6              \n\t"         
> "movq 48(%2), %%mm7             \n\t"         # " # nop   " ", %%mm0    
>            \n\t"
> 
> 	and on a Linux GCC 3.3.5 toolset, it does:
> 
> "pmaddwd %%mm6, %%mm1           \n\t" "NOP" ", %%mm4               \n\t"
> "movq %%mm4, %%mm6              \n\t" "movq 48(%2), %%mm7             
> \n\t"
> "NOP" ", %%mm0               \n\t"
> 
> 	Either way, gas doesn't like it:
> 
> {standard input}:410:invalid character ',' in opcode
> 	or
> /tmp/ccjWdbJ8.s: Assembler messages:
> /tmp/ccjWdbJ8.s:460: Error: invalid character ',' in mnemonic
> 
> 
> 
> 	I have spent a lot of time testing various combinations.

thats sad, you should have read the c pre processor manual instead


[...]
> 	The original patch, which replaced /nop with #nop,
> expands to this on both Linux GCC 3.3.5, and the Intel
> Mac's GCC 4.0.1/GAS 1.3.8:
> 
> "pmaddwd %%mm6, %%mm1           \n\t" "#nop" ", %%mm4               
> \n\t"
> "movq %%mm4, %%mm6              \n\t" "movq 48(%2), %%mm7             
> \n\t"
> "#nop" ", %%mm0               \n\t"
> 
> which I think is legal asm comment in two ways:
> 1) The line starts with whitespace (\t)

it does so only if the previous line ends in a \t thats a insanely
ugly hack


> 2) The symbol after the comment (#) is non-numeric,
>    so it will not be interpreted as a line jump
> 
> 
> 
> 
> 	Can we have that one committed? Please?

of course not

the following example shows how to do it, its completely trivial

#define idct(oppcode) \
    oppcode " arg1 arg2\n\t"

#define NOP " # nop"

idct(NOP)



[...]
-- 
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