> Jiri Gaisler has now signed the FSF copyleft (it took quite long to get > through the procedure) and I was said that I could post the patches > now.
Thanks for your perseverance. > The patches are straightforward I think. > 1. Adds machine description gcc-4.4.2/gcc/config/sparc/leon.md > 2. gcc-4.4.2.ori/gcc/config/sparc/sparc.c: > + adds leon_costs struct. > + 4 target CPUs are added: > sparchfleon : hard float v7 > sparchfleonv8: hard float v8 > sparcsfleon : soft float v7 > sparcsfleonv8: soft float v8 > + 1 cpu type: PROCESSOR_LEON > that is called "leon" in sparc.md > 3. gcc-4.4.2.ori/gcc/config/sparc/sparc.h: > add the 4 target cpu defines > 4. gcc-4.4.2.ori/gcc/config/sparc/sparc.md: > define cpu "leon" and include "leon.md" > 5. gcc-4.4.2/gcc/config/sparc/t-leon: > makefile template for leon > 6. gcc-4.4.2/gcc/config.gcc: > include t-leon for sparc[sf|hf]leon[v8]. > > They dont interfere with current code. If I should change something, > please let me know or maybe here is something I didnt think of... The patches would need to be ported to the mainline tree as they will be merged there; we generally don't add support for new processors to branches. The patch doesn't contain a config/sparc/leon.h file, so it will use whatever default configuration it inherits; is that really intended? I think we want sparc-leon to be a stand-alone target, with multiple libraries for V7/V8/soft-float/hard-float, so that a single compiler can generate code for all the variants. That is to say, you configure --target=sparc-leon-elf and you pass -mcpu=v7/-/mcpu=v8/-mhard-float/-msoft-float to the resulting compiler to select the right variant. --with-cpu isn't appropriate for this. It turns out that we have ported GNAT (the GNU Ada compiler) to embedded LEON targets at AdaCore so we also have some material, mostly orthogonal to yours. Give me a few days to port your 4.4 patches and dig out ours, and I'll post a combined patch to serve as a basis for further discussions. -- Eric Botcazou