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

Nigel Pearson nigel
Mon Aug 7 02:33:31 CEST 2006

On 04/08/2006, at 8:44 PM, Michael Niedermayer wrote:
> On Fri, Aug 04, 2006 at 11:42:09AM +1000, Nigel Pearson wrote:
>> 	I have spent a lot of time testing various combinations.
> thats sad, you should have read the c pre processor manual instead

	RTFM? You know that's a last resort!

> > \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

	I guess so. As an aside, what is the reason for having
\n\t on the previous source line? It would seem more sensible
to split on the newline and have lines starting with the tab?

"\tpmaddwd %%mm3, %%mm5   \n" /* C7R7+C5R5      C7r7+C5r5 */\
"\t" #rounder ", %%mm0    \n"\
"\tpaddd %%mm0, %%mm1     \n" /* A1             a1 */\

> the following example shows how to do it, its completely trivial
> #define idct(oppcode) \
>     oppcode " arg1 arg2\n\t"
> #define NOP " # nop"
> idct(NOP)

	Yes, that works, but the macro currently uses #oppcode.
If you try this:

#define idct(a,rounder) \
	"movq " #a ", %%mm0\n"\
	#rounder ", %%mm4\n"
#define NOP " # nop"

cpp behaves in the ways I stated
(i.e. differently on Linux vs OS X)
and thus will not work.

	I assumed you wanted to keep the ability
to pass in an opcode to do rounding?

(which I am guessing would be something
  like mptr[address_in_rounding_table])

	If modifying the macro to remove the rounding ability
is OK, then this all becomes easy - just comment it out:

-        #rounder ", %%mm4               \n\t"\
+        /* #rounder ", %%mm4            \n\t" Add a rounding constant 

Nigel Pearson, nigel at ind.tansu.com.au|"Things  you  own
Telstra Net. Eng., Sydney, Australia | end up owning you"
Office: 9202 3900    Fax:  9261 3912 |      Tyler,
Mobile: 0408 664435  Home: 9792 6998 |    Fight Club

More information about the ffmpeg-devel mailing list