do better than GCC
in my case, in case i will code such a things, it will be "better" than gcc only about two things
1)
the way it well be written for the C only support, ANSI C, portable everywhere without all the issues of gcc sources, as i told, i simply hate gcc sources, and you should admit that … gcc's sources are not exactly written in ANSI C as they are not exactly portable, as they are not exactly "easy going", or not ?
2)
an extremely simplified machine code gen, much more easy to be modified for a new architecture (you should love it especially if you want to toy with HDL), or just to add features to the Soft Core ISA, which, in my case, is a mesh up between MIPS1 and MIPS32, something that the actual gcc-mips is simply
not able to support (without dirty tricks), i mean, the actual profile is gcc-mips1, so i am loosing a lot of the improvement i have grabbed from MIPS32 (see the diagram, not the differences about "legacy" and "modern") and i can't use gcc-mips32 because the soft core is not full MIPS32 compliant, also it has custom instructions about fixed point.
gcc will ever be better about
1) the languages it supports, e.g. {C++, ADA, objC, ..}
2) optimizations space/time/architecture/..
3) many and many other features i am not interested about
what i want is a nice piece of code, well written, with the less complexity inside, much more useful for experimental branch about codgen (new architecture features, toying with HDL in soft cores), and much more portable than gcc.
that's all, i am not aiming to change the world as it is written in the GNU manifest
4) (Optionally, you can add an) optimizer engine ... i to not need it
well, i have put an interactive integer calculator, written in C, on my soft core. I compiled it with gcc-mips in three different profiles, {O0, O1, O2}, then i compared the results. I can assure you that for MIPS1 the real difference between OO and O2 is related to the pipeline optimization, that means the result binaries ratio Otwo : OZero is 1:3 in size, that's a good job done by gcc's optimizer, and you can more improve this result if you profile for MIPS32 instead
You need to pass the right "CFlgag", and gcc will show you how better it can go with an higher code density! The optimization is performed using the know led of the full MIPS32 ISA instead of a few poor instructions from the tiny MIPS1 ISA, that happens because MIPS32 has many more instructions to be used to save space/time, and the gcc's optimizer knows how to use them.
So gcc-mips, about that, seems cool, it still sucks about other things, but it is/will still be superior, btw concerning this discussion there are to more considerations
1) the optimization level is
strongly related to implementation, in this case to a 5 level pipelined with an hw delay slot, and … my soft core has no pipeline, my friend's (buggy) implementation has a pipeline, while my soft core is multi cycle without any branch delay slot but with an extremely improved ISA and also with the idea to include a debug processor, something like jtag TAP (see my other thread), i am grabbing the idea from the ZPU.TAP. In short, at the same frequency of my friend's one (@50Mhz), my soft core is offering 1/4 (1:5 stages + stall penalties ~ 1/4) of the performances with more prettiness in the assembly level and a very easygoing behavior about the debug interface, two things i want to be focused on about my hobby purpose!
2) I am not interested about the
code-desity and the
code size, i have 96Kbyte of BRAM in my fpga, they are fine with my assembly monitor and this "mini mon" is already fine to bootstrap and to load things from uart, so about "application", i will be fine with an added 64Mbyte chunk of dram. Fortunately my new Avnet Board already has 64Mbyte of DRAM, so I think i'm fine enough.
3) the real problem is doing debugging, at the host side ! The O2 optimization is making things warped and understanding the assembly level (like SPIM, if you have ever used it) is much more complex, which is a not-wanted point in this project!
for at least such a tree reasons i do not need & want any optimization!