Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

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

alex_b_1
Beginner
398 Views

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" );

}

0 Kudos
4 Replies
alex_b_1
Beginner
398 Views

Sorry, the error is:

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

0 Kudos
TimP
Honored Contributor III
398 Views

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?

0 Kudos
alex_b_1
Beginner
398 Views

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?

0 Kudos
KitturGanesh
Employee
398 Views

Hi Alex,

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

_Kittur

0 Kudos
Reply