Skip to content

GCC 13 Unveils Improved AMD Zen 4 Support Ahead of Release

The upcoming GNU Compiler Collection (GCC) version 13 is set to receive improved support for AMD’s Zen 4 CPU architecture. SUSE compiler engineer Jan Hubicka has added more code specifically targeted at the “znver4” CPU, continuing the work that has been done on the compiler in preparation for its release.

paul pon raj

This is in contrast to the support shown for the Zen 3 architecture, which was considered to be mediocre at best. Additionally, new processor ISA extensions will be used for the latest architecture, according to Michael Larabel, analyst, and editor of the Linux hardware website Phoronix.

Yesterday, Hubicka added the newest updates for GCC 13, which include new tunes for AVX512 scatter instructions, disabling the use of gather for zen4, and disabling a pass to avoid FMA chains for znver4. In micro-benchmarks, these changes appear to result in consistent losses compared to open-coded code.

Larabel notes that GCC 13 and AMD’s proprietary AOCC 4.0 compiler will need to be tested to see which performs better “as a downstream of LLVM/Clang.” AMD recently added the beginning enablement of the Zen 4 architecture into LLVM/Clang early last month, but it has not been touched since. The hope is that we will see more work on this in the coming weeks.

In the meantime, developers wishing to optimize their code for the AMD Ryzen 7000 series and AMD EPYC 9004 series processors can use the “-march=znver4” flag. The Phoronix editor also mentions that lately, AMD appears to have focused heavily on the AMDGPU work for DRM-Next, as was reported yesterday.

Several targets were initially not supported, and it is pleasant to see that work is now added to upcoming patches within the various open-source projects to prepare for Q1 releases.

Read In Detail