This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
inline code generation vs libs
- From: Mihai Daniel OPREA <mihai dot oprea at cti dot pub dot ro>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 20 Jun 2012 07:55:14 +0000
- Subject: inline code generation vs libs
Hello,
I am working with the m68hc11 / m68hc12 gcc port for a school project. I have noticed that the vast majority of 32 bit operations (this is a 16 bit architecture) are implemented inline, via define_insn / define_expand / define_split instead of being implemented as libcalls.
How much does GCC actually benefit from this implementation? I am aware that providing patterns with a wide range of alternatives might help the compiler, especially in such a register-starved architecture. But considering that the simplest 32 bit left shift consists of the 7 byte sequence: asld xgdx rolb rola xgdx makes me wonder whether a library based implementation would have been better.
Or is this simply a question of trading off -Os performance for -O3 performance?