Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Stafford Horne
On Mon, Nov 05, 2018 at 10:10:22AM -0500, Rich Felker wrote: > On Mon, Nov 05, 2018 at 11:13:53AM +, Szabolcs Nagy wrote: > > On 04/11/18 09:05, Stafford Horne wrote: > > > On Mon, Oct 29, 2018 at 02:28:11PM +, Szabolcs Nagy wrote: > > >> On 27/10/18 05:37, Stafford Horne wrote: > > ... > >

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Stafford Horne
On Mon, Nov 05, 2018 at 11:13:53AM +, Szabolcs Nagy wrote: > On 04/11/18 09:05, Stafford Horne wrote: > > On Mon, Oct 29, 2018 at 02:28:11PM +, Szabolcs Nagy wrote: > >> On 27/10/18 05:37, Stafford Horne wrote: > ... > >>> +#undef LINK_SPEC > >>> +#define LINK_SPEC "%{h*} \

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Christophe Lyon
On Mon, 5 Nov 2018 at 20:46, Richard Henderson wrote: > > On 11/4/18 9:05 AM, Stafford Horne wrote: > > I have had some inqueries into helping > > bootstrap some linux nommu machines. > > For nommu, we'd need to implement an FDPIC ABI. > > Otherwise, code segments cannot be mapped separately > fro

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Richard Henderson
On 11/4/18 9:05 AM, Stafford Horne wrote: > I have had some inqueries into helping > bootstrap some linux nommu machines. For nommu, we'd need to implement an FDPIC ABI. Otherwise, code segments cannot be mapped separately from data segments. I believe that the arm (32bit) port has recently adde

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Rich Felker
On Mon, Nov 05, 2018 at 11:13:53AM +, Szabolcs Nagy wrote: > On 04/11/18 09:05, Stafford Horne wrote: > > On Mon, Oct 29, 2018 at 02:28:11PM +, Szabolcs Nagy wrote: > >> On 27/10/18 05:37, Stafford Horne wrote: > ... > >>> +#undef LINK_SPEC > >>> +#define LINK_SPEC "%{h*} \

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-05 Thread Szabolcs Nagy
On 04/11/18 09:05, Stafford Horne wrote: > On Mon, Oct 29, 2018 at 02:28:11PM +, Szabolcs Nagy wrote: >> On 27/10/18 05:37, Stafford Horne wrote: ... >>> +#undef LINK_SPEC >>> +#define LINK_SPEC "%{h*} \ >>> + %{static:-Bstatic} \ >>> + %{share

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-11-04 Thread Stafford Horne
On Mon, Oct 29, 2018 at 02:28:11PM +, Szabolcs Nagy wrote: > On 27/10/18 05:37, Stafford Horne wrote: > > +++ b/gcc/config/or1k/linux.h > > @@ -0,0 +1,44 @@ > > +/* Linux Definitions for OpenRISC. > > + Copyright (C) 2018 Free Software Foundation, Inc. > > + Contributed by Stafford Horne. >

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-31 Thread Jeff Law
On 10/30/18 4:35 PM, Stafford Horne wrote: > On Tue, Oct 30, 2018 at 10:49:53AM -0500, Segher Boessenkool wrote: >> On Tue, Oct 30, 2018 at 09:49:18PM +0900, Stafford Horne wrote: >>> Hello, >>> >>> On Sun, Oct 28, 2018 at 05:54:47PM -0500, Segher Boessenkool wrote: Yes, like that. It also ea

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Stafford Horne
On Tue, Oct 30, 2018 at 03:57:03PM +, Richard Henderson wrote: > On 10/30/18 12:18 PM, Stafford Horne wrote: > > OK, I was just being lazy allowing the spill. Do you think the split/expand > > would be an RTL using left shift / right shift? Can you think of something > > more clever? Since "

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Stafford Horne
On Tue, Oct 30, 2018 at 10:49:53AM -0500, Segher Boessenkool wrote: > On Tue, Oct 30, 2018 at 09:49:18PM +0900, Stafford Horne wrote: > > Hello, > > > > On Sun, Oct 28, 2018 at 05:54:47PM -0500, Segher Boessenkool wrote: > > > Yes, like that. It also easily can handle the other combos (those with

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Segher Boessenkool
On Tue, Oct 30, 2018 at 09:49:18PM +0900, Stafford Horne wrote: > Hello, > > On Sun, Oct 28, 2018 at 05:54:47PM -0500, Segher Boessenkool wrote: > > Yes, like that. It also easily can handle the other combos (those with > > STACK_POINTER), and it is easier if you have to switch FRAME_GROWS_DOWNWA

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Richard Henderson
On 10/30/18 12:18 PM, Stafford Horne wrote: > OK, I was just being lazy allowing the spill. Do you think the split/expand > would be an RTL using left shift / right shift? Can you think of something > more clever? Since "real" hardware does not usually support shifts with an > immediate we will

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Segher Boessenkool
On Tue, Oct 30, 2018 at 08:26:00PM +0900, Stafford Horne wrote: > On Mon, Oct 29, 2018 at 04:42:43PM +, Richard Henderson wrote: > > On 10/29/18 4:34 PM, Segher Boessenkool wrote: > > > Is there some better documentation available? This is what google found > > > for me. I would have like bet

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Stafford Horne
Hello, On Sun, Oct 28, 2018 at 05:54:47PM -0500, Segher Boessenkool wrote: > Hi! > > On Mon, Oct 29, 2018 at 06:47:23AM +0900, Stafford Horne wrote: > > On Sat, Oct 27, 2018 at 09:57:30PM -0500, Segher Boessenkool wrote: > > > > +/* Helper for defining INITIAL_ELIMINATION_OFFSET. > > > > + We a

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Stafford Horne
On Sun, Oct 28, 2018 at 01:56:29AM +, Richard Henderson wrote: > On 10/27/18 5:37 AM, Stafford Horne wrote: > > +(define_insn "zero_extendhisi2" > > + [(set (match_operand:SI 0 "register_operand""=r,r") > > + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-30 Thread Stafford Horne
On Mon, Oct 29, 2018 at 04:42:43PM +, Richard Henderson wrote: > On 10/29/18 4:34 PM, Segher Boessenkool wrote: > > Is there some better documentation available? This is what google found > > for me. I would have like better docs (more compact, etc.) Links to > > such would be great to have

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-29 Thread Richard Henderson
On 10/29/18 4:34 PM, Segher Boessenkool wrote: > Is there some better documentation available? This is what google found > for me. I would have like better docs (more compact, etc.) Links to > such would be great to have in readings.html :-) https://openrisc.io/architecture and especially the

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-29 Thread Segher Boessenkool
On Mon, Oct 29, 2018 at 10:34:25PM +0900, Stafford Horne wrote: > On Sun, Oct 28, 2018 at 11:16:13PM +, Richard Henderson wrote: > > On 10/28/18 2:57 AM, Segher Boessenkool wrote: > > > Is this correct? Should this be unsigned (u16 and K)? > > > > No, l.xori is signed. > > Right, sorry, I di

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-29 Thread Szabolcs Nagy
On 27/10/18 05:37, Stafford Horne wrote: > +++ b/gcc/config/or1k/linux.h > @@ -0,0 +1,44 @@ > +/* Linux Definitions for OpenRISC. > + Copyright (C) 2018 Free Software Foundation, Inc. > + Contributed by Stafford Horne. > + > + This file is part of GCC. > + > + GCC is free software; you can

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-29 Thread Stafford Horne
On Sun, Oct 28, 2018 at 11:16:13PM +, Richard Henderson wrote: > On 10/28/18 2:57 AM, Segher Boessenkool wrote: > >> +(define_insn "xorsi3" > >> + [(set (match_operand:SI 0 "register_operand" "=r,r") > >> +(xor:SI > >> + (match_operand:SI 1 "register_operand" "%r,r") > >> + (matc

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-28 Thread Segher Boessenkool
Hi! On Mon, Oct 29, 2018 at 06:47:23AM +0900, Stafford Horne wrote: > On Sat, Oct 27, 2018 at 09:57:30PM -0500, Segher Boessenkool wrote: > > > +/* Helper for defining INITIAL_ELIMINATION_OFFSET. > > > + We allow the following eliminiations: > > > + FP -> HARD_FP or SP > > > + AP -> HARD

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-28 Thread Richard Henderson
On 10/28/18 2:57 AM, Segher Boessenkool wrote: >> +(define_insn "xorsi3" >> + [(set (match_operand:SI 0 "register_operand" "=r,r") >> + (xor:SI >> + (match_operand:SI 1 "register_operand" "%r,r") >> + (match_operand:SI 2 "reg_or_s16_operand" " r,I")))] >> + "" >> + "@ >> + l.

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-28 Thread Stafford Horne
Hi Segher, Thank you for the review and thank you for all the help up until now. On Sat, Oct 27, 2018 at 09:57:30PM -0500, Segher Boessenkool wrote: > Hi Stafford, > > Some minor comments. I didn't read the atomics much, but I did look at > everything else, and it looks fine :-) > > On Sat, Oc

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-27 Thread Segher Boessenkool
Hi Stafford, Some minor comments. I didn't read the atomics much, but I did look at everything else, and it looks fine :-) On Sat, Oct 27, 2018 at 01:37:02PM +0900, Stafford Horne wrote: > +case ${target} in > +or1k*-*-linux*) > +tm_file="${tm_file} gnu-user.h lin

Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-27 Thread Richard Henderson
On 10/27/18 5:37 AM, Stafford Horne wrote: > +(define_insn "zero_extendhisi2" > + [(set (match_operand:SI 0 "register_operand""=r,r") > + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] > + "" > + "@ > + l.exthz\t%0, %1 > + l.lhz\t%0, %1" > + [(s

[PATCH v3 3/3] or1k: gcc: initial support for openrisc

2018-10-26 Thread Stafford Horne
-mm-dd Stafford Horne Richard Henderson Joel Sherrill gcc/ChangeLog: * common/config/or1k/or1k-common.c: New file. * config/or1k/*: New. * config.gcc (or1k*-*-*): New. * configure.ac (or1k*-*-*): New test for openrisc tls.