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

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

Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top