I have an old code need compiled with -m486
flag in GCC
.
But there is no that flag. Then I found -mtune=i486
and -arch=i486
I have read this page.
But still don't know which is the best one for -m486
?
The -march
option defines the list of instructions that may be used, the -mtune
option modifies the optimization process afterwards.
You would normally use -march
to specify the minimum requirements, and -mtune
to optimize for what the majority of users have.
For example, the IA32 architecture defines various instructions for string handling and repetition of instructions. On the 386 and 486, these are faster and smaller than explicit assembler code because the instruction fetch and decode stages can be skipped, while on newer models, these instructions clog up the instruction pipeline as each processing step is immediately dependent on the previous, so the CPU's parallel execution functionality goes to waste.
Linux distributions typically use -march=i486 -mtune=i686
to ensure that you can still install and run on a 486, but as the majority of users have modern CPUs, the focus is on making it run optimally for these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With