Using imm8 through inline assembler

Etienne via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 28 14:05:13 PDT 2014


I'm trying to write (in DMD) the assembler that handles the function :

__m256i _mm256_permute4x64_epi64(__m256i a, in int M);

This translates to vpermq

The closest thing I could find in DMD assembly is VPERMILPS, which is 
called with:

asm { vpermilps YMM0, YMM1, IMM8; }

However, I cannot find out how to make IMM8 with `in int M`. I can 
convert int -> short[4] -> ubyte, but I can't move it into imm8

asm { mov imm8, ub; } <-- Fails.


Does anyone have an idea of what this is and how to define it?

Thanks in advance.


More information about the Digitalmars-d-learn mailing list