[sdiy] GCC vs Clang for Audio DSP
mbryant at futurehorizons.com
Fri May 6 01:08:18 CEST 2022
From: Synth-diy [mailto:synth-diy-bounces at synth-diy.org] On Behalf Of jslee via Synth-diy
> Legacy? Typically that term refers to things that are bringing the good money in… but are also rarely touched, possibly even actively avoided because all the people that understood it have left the party, or because there are no testsuites
I use Blender and GIMP for one of my hobbies with some stuff going back over 15 years. Definitely not money-making but I'd regard a lot of it as legacy. Definitely old anyway.
The UI and file formats on both tools seem to change regularly so you have to remember which version was used for which files if I want to update them.
I never use KiCad as I have a professional PCB system, but I do contribute to other forums and seem to see far too often recently why people's Kicad files suddenly have problems in PCB manufacture/SMD loading.
> When you say clang/llvm gives better results than GCC/binutils, are you referring to a 100% open-source (OSI tick) toolchain? Or an “open core” model with proprietary, non-free appendages/modifications vital to get the superior results claimed? It sounds like the latter?
I'll summarize so as to clarify (hopefully once and for all) :
For embedded use on the 32 bit ARM M series processors the totally free version of Clang usually gives faster code results than gcc, albeit often with slightly higher memory usage. So my recommendation is for most people to use clang, but always write the code so that you can also check with gcc as just occasionally gcc can be faster.
If you use the ARM A series in 64 bit mode then the free version of clang will always be significantly faster than gcc so no need to keep compatibility.
For Apple products, the official LLVM based compiler is proprietary but is included at no cost, and is the best tool for the job.
For embedded or Android use where you need the absolutely fastest code for high-volume commercial use, then the proprietary ARMcompiler version will usually always give improvements over clang (although Eric has found this isn’t the case on low end M series processors where clang and ARMcompiler are possibly very similar/identical - possibly due to the limited Thumb ISA used on M0+ not really allowing any further optimisations by ARM).
But obviously you have to do a cost analysis on the project to see if the cost can be justified. I generally find it is but the stuff I design for OEMs is usually decent volumes.
More information about the Synth-diy