SUSE Developers Publish Radeon GCN Backend Code For GCC Compiler
Written by Michael Larabel in SUSE on 16 March 2017 at 02:31 PM EDT. 6 Comments
While the AMDGPU "GCN" compiler support in LLVM is quite mature now, the GNU Compiler Collection (GCC) hasn't yet received a full-fledged GCN compiler back-end for AMD GPUs. SUSE developers have been working on that for AMD and today they have published their code branch. This GCN back-end for GCC is primarily focused on compute capabilities rather than compiling graphics shaders.

Martin Jambor and Jan Hubicka are among the developers working on the GCN back-end for GCC that's now been made public. Jambor commented on the GCN back-ends current capabilities, "At this point, the back-end can compile small kernels open-coded in C with target-specific attributes, built-ins and address spaces to make use of the various special characteristics of the architecture. Eventually, it should of course provide for high-level programming models, most notably OpenMP, but the list of steps we need to take before we get there is very long."

So far this GCC GCN support has just been tested with AMD APUs and not yet any discrete graphics cards. With this current code you also need to use the AMDGPU LLVM assembler. Other requirements on using this GCC back-end code is a ROCK kernel, ROCT thunk library, ROCR run-time library, amdphdrs utility, and other code not yet readily available on most Linux distributions.

Once you have obtained their GCC GCN code and all of the code requirements, you can compile the basic kernels into Assembly, feed that Assembly into the llvm-mc AMDGCN assembler, and then use the amdphdrs utility to convert that into AMD HSA object code, which can then be loaded and executed by the ROCR run-time.

The basic details for now can be found via this GCC announcement. They will be working on more documentations / guide shortly for those interested. Hopefully we'll see the code mature to the point where it will be found in next year's GCC 8 release.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week