I hit the GCC bug forum in an attempt to find any known issues with mtune optimization logic for the amdfma10 processors. While nothing obvious jumped out, I did do some pretty extensive reading on a couple of general "optimization logic" bug threads:
1) Bug 81616 - Update -mtune=generic for the current Intel and AMD processors (
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616)
2) GCC buglist with "amdfam10" filter (
https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=amdfam10)
Also came across this decent post on the relationship between march and mtune =>
https://lemire.me/blog/2018/07/25/it-is-more-complicated-than-i-thought-mtune-march-in-gcc/, great info in the discussion section actually.
So here is the kicker, it would appear (juding by the performance tests these teams were running) that best performance results were obtained when using the mtune=K8 option on the amdfam10 architecture. Hmm....strange I thought, b/c K8 is an older architecture and the Phenom (in my case) really did not introduce new features, other than basically an updated memory controller and L3 cache (more than doubled – from 2MB to 6MB). Not sure if there are any actual instrution set differences.
Anyways, alright, so I'm already trying this out, why not give this new combo a whirl?
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 18130
Total time (secs): 18.130000
Iterations/Sec : 99282.956426
Iterations : 1800000
Compiler version : GCC9.2.0 20190812 (OS/2 RPM build 9.2.0-5.oc00)
Compiler flags : -O2 -DMULTITHREAD=6 -DUSE_PTHREAD -march=amdfam10 -mtune=k8 -DPERFORMANCE_RUN=1 -lpthread
Parallel PThreads : 6
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 99282.956426 / GCC9.2.0 20190812 (OS/2 RPM build 9.2.0-5.oc00) -O2 -DMULTITHREAD=6 -DUSE_PTHREAD -march=amdfam10 -mtune=k8 -DPERFORMANCE_RUN=1 -lpthread / Heap / 6:PThreads
Wow...so that's a pretty significant difference: 99282.956426 (mtune=k8) vs 84811.647466 (no mtune).
The differences narrow down significantly when looking at tuned results: 99282.956426 (mtune=k8) vs 98231.827112 (mtune=generic).