How to prevent GCC from generating x86_64 kmov instructions?

217 Views Asked by At

I am using a third party x86_64 assembler that do not recognise kmov instructions (it only supports a subset of the x86_64 instruction set).

The assembler is fed assembly files generated by GCC 5.1 (I can't change the version), then it parses and assembles the code to generate ELF object files. It can compile fairly large code bases.

I am trying to compile a very simple plain C code base, but GCC keeps generating kmov instructions. I searched a little bit and it looks like they are AVX512 extensions but I am not sure about it!

I am looking for a way to tell GCC not to generate those instructions. I used those GCC options:

-mno-avx -mno-sse -mno-sse2 -mno-mmx -mno-fma

But it is still generating them! So what are those kmov instructions? And how can I tell GCC 5.1 to not generate them?

1

There are 1 best solutions below

0
Karim Manaouil On

As @Peter Cordes pointed out, specifying -mno-avx -mno-sse should be sufficient to tell GCC not to generate kmov instructions. The only way for kmov to be present in the asm output with those options would be from an inline asm().