Inline assembly (at&t format w/extended) issue

Inline assembly (at&t format w/extended) issue

I have a piece of code that does an register dereference to an in-memory array "offset(base, index, scale)", the intel compiler says it supports at&t syntax so maybe I'm going about this the wrong way or require some intel-specific provisions in order to acheive this - in gcc this works fine (mingw and gcc native) but when trying with the intel compiler (via VS2010) it gives errors and refuses to compile, "error : expected an expression".

      movq T0(,%%rdi,8), %%mm1


Maybe somebody can tell me if there's a better way to achieve this or why the intel compiler doesn't work on this particular AS which works fine in gcc?  

T0 declaration:

__declspec(align(16)) static const u64 T0[256] =  {...}

asm declaration:

void asmfunc(u64 *x) {
       __asm__ volatile(
        : /*no output, only memory is modified */
        : "r"(x)
       : "%rax", "%rbx", "%rcx", "%rdx", "%rdi", "%rsi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory" , "%mm0", "%mm1", "%mm2" , "%mm3" , "%mm4" , "%mm5" , "%mm6" , "%mm7" );


5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Sorry, the error is:

error: symbol reference in movq is currently unsupported.  Access symbols through the asm interface.

According to the doc which comes with the compiler, -masm=att should switch it from default (defaults are opposite between Windows and linux).  Are you reporting that it doesn't work as documented?

Yes, that is specified in the compile options.  Th issue appears to be a lack of compatability in the intel compiler for at&t valid syntax.  Perhaps there is a different (more compatible) way to work around this particular call that achieves the same goal?

Hi Alex,

Can you attach a small reproducer (preferably a preprocessed .i file) and also give the command line options you used?


Leave a Comment

Please sign in to add a comment. Not a member? Join today