Software Archive
Read-only legacy content
17060 Discussions

Assembler support for the MIC when porting compilers

Paul_C_7
Beginner
416 Views

I am about to port the Vector Pascal compiler to target the MIC. Whilst it should be easy to do a quick port supporting automatic multi-core parallelism, support for the SIMD instructions is harder. I need to know if the gnu assembler distributed with the system has been extended to recognise the SIMD opcodes for the new instructionset. If that is not the case I will need to go through the much more laborious but still feasible process of generating the new instructions as assembler macros. I get my system later this week. Before it arrives does anyone have any information on assembler support for the MIC?

0 Kudos
7 Replies
Frances_R_Intel
Employee
416 Views

As far as I have been able to find out, the answer at this time is no.

0 Kudos
Ravi_N_Intel
Employee
416 Views

The assembler shipped with the MPSS supports MIC instruction set.

0 Kudos
Paul_C_7
Beginner
416 Views

Well in some way it obviously does in that I can get the gcc compiler to output code with MIC instructions like this in it

movl $1, %eax
kmov %eax, %k2
vpackstorelps %zmm0, -20(%rbp){%k2}

but if I invoke the assembler directly on the .s file produced by gcc or write any MIC instructions myself it says 

hello.s:20: Error: `kmov' is not supported on `x86_64'
hello.s:21: Error: `vpackstorelps' is not supported on `x86_64'
hello.s:27: Error: bad register name `%zmm0'
hello.s:49: Error: bad register name `%zmm0'

So there is obviously some flag you need to pass to the assembler to tell it to recognise the MIC opcodes.

What is this flag?

0 Kudos
Ravi_N_Intel
Employee
416 Views

try adding

    -march=k1om

0 Kudos
James_C_Intel2
Employee
416 Views

You also need to make sure you're using the right assembler, the MPSS install doesn't change the one in /usr/bin.

You need the one from /usr/linux-k1om-4.7/bin which is where all the tools that run on X86_64 but handle k1om ELF files live.

0 Kudos
Paul_C_7
Beginner
416 Views

Thanks, I was already using the right assembler but had not got the arch flag set. What does k1om stand for -- not evident, the other options like SSE and AVX are more transparent

0 Kudos
James_C_Intel2
Employee
416 Views

I don't think k1om stands for anything, it's simply a name for the Knights Corner architecture (to distiguish it from X86_64, SPARC, MIPS, ARM, ...) in the ELF binary format. So a binary with the magic number for k1om will execute on a KNC.

("Why are pirates called pirates?" "I don't know" "They just AARRRR" :-))

0 Kudos
Reply