RE : RE : problem of non-pic code due to asm code.

Ian Lance Taylor iant@google.com
Sat Aug 22 00:31:00 GMT 2009


PICCA Frédéric-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
writes:

> so I have written
>
> ALIGN8 short  _128mm[]  = { 128,128,128,128 };
>
>
>     ...
>     "movl      _128mm@GOTPCREL(%rip),%rax \n"
>     "psubw     mm2,(%rax)      \n"
>
>     "psubw     mm3,(%rax)      \n"
>     ...

Note that you're going to need to tell gcc that you're clobbering %rax,
as described in the extended asm documentation.

> but now I have this compilation error
>
> jpeg_color_mmx.cpp: In function ‘void jpeg_yh2v2_to_rgb32_mmx(unsigned char*, long int, unsigned char*)’:
> jpeg_color_mmx.cpp:474: error: invalid 'asm': operand number missing after %-letter
> jpeg_color_mmx.cpp:474: error: invalid 'asm': operand number missing after %-letter
> jpeg_color_mmx.cpp:474: error: invalid 'asm': operand number missing after %-letter
> jpeg_color_mmx.cpp:474: error: invalid 'asm': operand number missing after %-letter

Use %%rax.

Ian



More information about the Gcc-help mailing list