We'd like to deploy our product on two different HW platforms, an i5 (typically i5-7500, but older CPUs back to 4100 must be supported) and an Atom (E3845)
Supporting Atom is new. Running the current binaries on the E3845 don't work - "Illegal instruction". Disassembling in gdb doesn't show me exactly which instruction, it only says "(bad)".
Since both are x86 I'd like to deploy a single set of binaries but, other than exhaustive trial and error, I don't know how to find which combination gcc flags will generate code compatible with both CPUs.
P Brady's gcccpuopt.sh
script looked promising but it doesn't support my CPUs
Looking at /proc/cpuinfo
here's the difference:
CPU Atom E3845 i3-4160
Family 6 6
Model 55 60
3dnowprefetch
epb IA32_ENERGY_PERF_BIAS support
abm Advanced Bit Manipulation
avx Advanced Vector Extensions
avx2 Advanced Vector Extensions
bmi1 Bit Manipulation Instructions
bmi2 Bit Manipulation Instructions
eagerfpu ???
f16c 16-bit floating point conversions
fma 4 operands MAC instructions for fused multiply–add
fsgsbase ????
invpcid Invalidate Processor Context ID
pcid Process Context Identifiers
pdpe1gb One GB pages (allows hugepagesz=1G)
pln Intel Power Limit Notification
pts Intel Package Thermal Status
xsave Save Processor Extended States: also provides XGETBY,XRSTOR,XSETBY
xsaveopt Optimized XSAVE
I don't really know what all of those mean... Would I just disable (if possible) generation of everything in the i5 column? Or is there a better procedure for finding the settings?
Target environment is 32-bit Centos6 with 3.10 kernel. GCC 4.9. Code is mostly C++ with some C.