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

ICC inline assembly jump labels support feature request

Marián__VooDooMan__M
New Contributor II
314 Views

Greetings,

With ICC 14 not 15 when in my 3rd party library I have optimized coded for AVX-2 (I'm on Haswell) compiler errors by saying jump labels are not supported. Though, I know it's "#ifdef"'s counterpart written in C/++ will be not so fast as it were coded in inline assembly. Those inline assemblies are perfectly optimized to my Haswell (AVX-2), so I don't believe ICC can little mathematical loop optimize better as it were written in inline assembly.

Take please this as feature request, and:

1. don't forget some assemble depending on prologue are in AT&T syntax

2. don't forget some assemble depending on prologue are in Intel syntax

3. /Qipo IL generation should be easily implemented by flag "do not touch and optimize this at all, it is inline assembly!" (like GCC has attribute volatile to "asm" blocks.

TIA!

0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
314 Views

I haven't used labels with ATT syntax. With Intel this works:

...
$1:
   push dword ptr [eax+ecx*4+4]
   dec ecx
   jne $1
...

Maybe the $n format will work with ATT too??

In the above: Loop: and jne Loop was inalid, the $someNumberHere, worked fine.

Jim Dempsey

0 Kudos
Marián__VooDooMan__M
New Contributor II
314 Views

@jimdempseyatthecove

the problem is, 3rd party opensource libraries under GNU (i.e. compiled should be be done with GCC) are using AT&A syntax as GCC (sadly) is using it.

0 Kudos
Marián__VooDooMan__M
New Contributor II
314 Views

...even on Windows...

0 Kudos
Amanda_S_Intel
Employee
314 Views

For items 1 and 2, it's correct that only integer labels with b (backwards) and f (forwards) flags are supported. We do not intend to implement support for this. Our policy is that any gnu-style inline assembly code supported on Windows must have the same behavior as on Linux. However, I do understand the challenge when working with a third-party library and I am checking into item 3. Can you tell me which open source libraries you are referring to and how you are compiling (options, etc.) so we can better understand the context? Please send me a private message if needed.

0 Kudos
Marián__VooDooMan__M
New Contributor II
314 Views

Greetings,

I was speaking of FFTW library. Now I have upgraded it to version 3.3.4 which have full AVX support (I'm on Haswell architecture).

I am sorry to decrease signal-to-noise ration on forum, I have just found this new version of library have "#ifdef" dispatchers for particular compilers. Also, it seems they removed jump labels from assembler blocks. As an example, there is a snippet from library's code:

static inline int cpuid_ecx(int op)
{
#    ifdef _MSC_VER
#    ifdef __INTEL_COMPILER
     int result;
     _asm {
	  push rbx
          mov eax,op
          cpuid
          mov result,ecx
          pop rbx
     }
     return result;
#    else
     int cpu_info[4];
     __cpuid(cpu_info,op);
     return cpu_info[2];
#    endif
#    else
     int eax, ecx, edx;

     __asm__("pushq %%rbx\n\tcpuid\n\tpopq %%rbx"
	     : "=a" (eax), "=c" (ecx), "=d" (edx)
	     : "a" (op));
     return ecx;
#    endif
}

But it would be nice if ICC were accepting both "_asm" and "__asm__" keywords and syntax on all platforms and accepting jump labels.

Sorry for the noise.

0 Kudos
Reply