When a gcc application is compiled in release mode (O3) what instruction set extensions are used?

StackOverflow https://stackoverflow.com/questions/18616902

Pergunta

When a GNU C / C++ application is compiled in vanilla release mode (O3) what instruction set extensions are used?

How do the extended instruction set come into play? Are multiple code blocks included in the resulting executable and then used if available?

Foi útil?

Solução

O3 will only use instructions that are specified when compiling (default specified when building toolchain, if none of switches explained here is specified). It will just try to optimize more aggresively (as specified here). Most optimizations are actually done in compiler "middle" end before code is even converted into target machine specific form.

So you can combine any -O with any instruction set extension by using those two groups of switches.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top