What is the difference between -mtune = i486 and -arch = i486

I have old code compiled with the -m486 flag in GCC . But this flag is not. Then I found -mtune=i486 and -arch=i486
I read this page. But still don't know which one is better for -m486 ?

+4
source share
1 answer

The -march option defines a list of instructions that can be used, the -mtune parameter subsequently changes the optimization process.

Typically, you should use -march to specify minimum requirements and -mtune to optimize what most users have.

For example, the IA32 architecture defines various instructions for processing strings and repeating instructions. At 386 and 486, they are faster and smaller than the explicit assembler code, since the steps of extracting and decoding instructions can be skipped, and on newer models these instructions clog the instruction pipeline, since each processing step immediately depends on the previous one, therefore the functionality of parallel execution of the CPU is wasted.

Linux distributions typically use -march=i486 -mtune=i686 to make sure you can still install and run on 486, but since most users have modern processors, the focus is on ensuring optimal performance for them.

+9
source

Source: https://habr.com/ru/post/1440227/


All Articles