This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adding Leon processor to the SPARC list of processors
- From: Konrad Eisele <konrad at gaisler dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, iant at google dot com, Luís Vitório Cargnini <lvcargnini at gmail dot com>, Daniel Hellstrom <daniel at gaisler dot com>, Jiri Gaisler <jiri at gaisler dot com>, Jose Ruiz <ruiz at adacore dot com>
- Date: Thu, 18 Nov 2010 14:29:42 +0100
- Subject: Re: Adding Leon processor to the SPARC list of processors
- References: <4CE515CB.7080706@gaisler.com> <201011181416.05997.ebotcazou@adacore.com>
Eric Botcazou wrote:
>> 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.
Which repository can I use to generate patches against. Is there a
git repository that I can use?
>
> The patch doesn't contain a config/sparc/leon.h file, so it will use whatever
> default configuration it inherits; is that really intended?
Maybe I shuould change that. Up to now I was using --with-cpu=xxx to configure
to select the default cpu. I'll wait for AdaCore patches and see how you did it.
>
> 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.
I could add a multilib version. The BCC toolchain from the Gaisler homepage
is multilibbed and uses -mv8/-mcpu=v8 -msoft-float to select which config to use.
However I also want a singlelib version to be able to compile. When createing
a glibc crosscompiler, compiling 4 version of glibc makes it inpracticable.
And crosscompiling user space apps I dont want the need to supply the extra
switches explicitly all the time.
Maybe there is a simple way to achieve both multilib and singlelib?
>
> 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.
>
Ok, I'll wait.
-- Greetings Konrad