GCC 15 Lands New Optimization For AMD Zen 4 & Zen 5 CPUs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • linsword13
    replied
    Originally posted by erniv2 View Post

    Another myth it´s exactly the other way around mtune optimizes for a cpu without breaking older archs ie. making systems unbootable, march builds code for the specified arch outputing code for that exact cpu, and if you ever read any gcc patches you would know that march also defines mtune.

    march is the higer compiler option it uses mtune it is implied
    This is true if a concrete "cpu-type" is specified for march, but not necessarily if "native" is used, especially when an older GCC does not recognize the newer arch it runs on. This is a good article on that subtlety: https://lemire.me/blog/2018/07/25/it...-march-in-gcc/.

    Leave a comment:


  • EphemeralEft
    replied
    Originally posted by erniv2 View Post
    Another myth it´s exactly the other way around mtune optimizes for a cpu without breaking older archs ie. making systems unbootable, march builds code for the specified arch outputing code for that exact cpu
    You don’t need to be rude. Just on this particular point: “arch” determines the instructions available to the compiler, while tuning determines which of those instructions is used to satisfy the source code; if your arch includes SSE, AVX2, and AVX512 (like x86-64-v4), then whether the compiler uses AVX2+SSE or AVX512 is entirely determined by the tuner.

    Leave a comment:


  • coder
    replied
    Originally posted by erniv2 View Post
    march is the higer compiler option it uses mtune it is implied
    Weirdly, this turns out to be architecture-specific. On ARM, -march didn't imply -mtune, although I think there was some recent change in behavior, there.

    Leave a comment:


  • erniv2
    replied
    Originally posted by EphemeralEft View Post

    You might also need -mtune=native
    Another myth it´s exactly the other way around mtune optimizes for a cpu without breaking older archs ie. making systems unbootable, march builds code for the specified arch outputing code for that exact cpu, and if you ever read any gcc patches you would know that march also defines mtune.

    march is the higer compiler option it uses mtune it is implied

    Leave a comment:


  • EphemeralEft
    replied
    Originally posted by Kjell View Post
    Does GCC automatically enable this flag with march=native when the build host uses Zen4?
    You might also need -mtune=native

    Leave a comment:


  • Kjell
    replied
    Does GCC automatically enable this flag with march=native when the build host uses Zen4?

    Leave a comment:


  • coder
    replied
    I'm not sure why they'd need either AVX2 or SSE loop epilogues, TBH. AVX-512 can use 256-bit and 128-bit operands. So, if you merely wanted to avoid an AVX-512 vectorized loop having an unvectorized epilogue, maybe a better idea would be to teach the compiler how to use smaller operands with it?

    Inside the CPU, it's using the same pipelines for all families of vector instructions. Some CPUs might have increased throughput of narrower operands, but you shouldn't have to switch instruction families to get that benefit.

    Leave a comment:


  • phoronix
    started a topic GCC 15 Lands New Optimization For AMD Zen 4 & Zen 5 CPUs

    GCC 15 Lands New Optimization For AMD Zen 4 & Zen 5 CPUs

    Phoronix: GCC 15 Lands New Optimization For AMD Zen 4 & Zen 5 CPUs

    Merged today for the upcoming GCC 15 stable release is a new "X86_TUNE_AVX512_TWO_EPILOGUES" tuning optimization that is enabled by default for AMD Zen 4 and Zen 5 processors...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
Working...
X