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

PICCA Frédéric-Emmanuel frederic-emmanuel.picca@synchrotron-soleil.fr
Sat Aug 22 00:17:00 GMT 2009



> Ah, I see.  You need to rewrite references to global variables to go
> through a register.

> movl    _128mm@GOTPCREL(%rip),%rax
> psubw     mm2,(%rax)

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"
    ...

to replace

    ...
    "psubw     mm2, _128mm       \n"
    "psubw     mm3, _128mm       \n"
    ...

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


Frederic



More information about the Gcc-help mailing list