Fix msp430 port WRT fallthru

2016-10-26 Thread Jeff Law
This patch just tweaks a comment so that we no longer warn. Installing on the trunk. Jeff commit 7aa35b20124373889e039a054076dd8d5288c9e2 Author: law Date: Wed Oct 26 15:49:25 2016 + * config/msp430/msp430.c (msp430_legitimate_address_p): Adjust fallthru comment.

[PATCH] Fix undefined behaviour in msp430 port

2015-09-29 Thread Jeff Law
-0400 [PATCH] Fix undefined behaviour in msp430 port * config/msp430/msp430.c (msp430_legitimate_constant): Fix undefined left shift behaviour. * config/msp430/constraints.md ('L' constraint): Similarly. ('Ys' constraint): Si

Re: msp430 port

2013-08-23 Thread Jeff Law
On 08/23/2013 01:52 PM, DJ Delorie wrote: so... can I get an official "ok to commit with you and Nick as maintainers" then? Just need to clear it with the steering committee, which for this sort of thing has been pretty trivial. Basically it has to pass the technical review (which y'all have

Re: msp430 port

2013-08-23 Thread DJ Delorie
so... can I get an official "ok to commit with you and Nick as maintainers" then?

Re: msp430 port

2013-08-20 Thread Jeff Law
On 08/19/2013 07:04 PM, Mike Stump wrote: On Aug 19, 2013, at 1:54 PM, Jeff Law wrote: On 08/19/2013 02:49 PM, DJ Delorie wrote: I'd say it's not as simple as you make it out to be. You can't blindly combine operations on volatile memory. I'm not blindly combining them, I'm combining them w

Re: msp430 port

2013-08-19 Thread Mike Stump
On Aug 19, 2013, at 1:54 PM, Jeff Law wrote: > On 08/19/2013 02:49 PM, DJ Delorie wrote: >>> I'd say it's not as simple as you make it out to be. You can't blindly >>> combine operations on volatile memory. >> >> I'm not blindly combining them, I'm combining them when I know the >> hardware will

Re: msp430 port

2013-08-19 Thread Mike Stump
;& ! volatile_ok && MEM_VOLATILE_P (op)) return 0; /* Use the mem's mode, since it will be reloaded thus. */ So that others know exactly what I'm thinking about. Targets that fix their port to be clean with respect to volatile (you must not read or write in a manner other than is directly allowed if volatile is set) can turn it one and go on with life. So, does anyone have a concrete example of what will not work on the msp430 port, if this is done?

Re: msp430 port

2013-08-19 Thread Oleg Endo
On Mon, 2013-08-19 at 16:49 -0400, DJ Delorie wrote: > > I'd say it's not as simple as you make it out to be. You can't blindly > > combine operations on volatile memory. > > I'm not blindly combining them, I'm combining them when I know the > hardware will do the volatile-correct thing. > > >

Re: msp430 port

2013-08-19 Thread Richard Kenner
> register int a; > extern volatile int b; > > a = b; > a |= 0x54; > b = a; > > The ISO spec seems to allow gcc to perform those operations in a > single physical insn, as long as the operations on 'b' are all > performed, and in the correct sequence. And I believe

Re: msp430 port

2013-08-19 Thread DJ Delorie
> You're missing the point. If the programmer wrote two statements > which hit volatile memory and you've got some pattern which matches > those two statements, then with your change you'll end up combining > them, that's wrong. I see nothing in the ISO spec that says you can't combine a volatil

Re: msp430 port

2013-08-19 Thread Jeff Law
On 08/19/2013 02:49 PM, DJ Delorie wrote: I'd say it's not as simple as you make it out to be. You can't blindly combine operations on volatile memory. I'm not blindly combining them, I'm combining them when I know the hardware will do the volatile-correct thing. You're missing the point. If

Re: msp430 port

2013-08-19 Thread DJ Delorie
> I'd say it's not as simple as you make it out to be. You can't blindly > combine operations on volatile memory. I'm not blindly combining them, I'm combining them when I know the hardware will do the volatile-correct thing. > ie, the programmer may have written them as separate statements an

Re: msp430 port

2013-08-19 Thread Jeff Law
On 08/14/2013 02:55 PM, DJ Delorie wrote: +#endif /* GCC_MSP430_PROTOS_H */ Index: gcc/config/msp430/predicates.md === --- gcc/config/msp430/predicates.md (revision 0) +++ gcc/config/msp430/predicates.md (revision 0) + +(def

Re: msp430 port

2013-08-19 Thread Jeff Law
On 08/19/2013 02:32 PM, Jeff Law wrote: Ok, I think I got it all covered... ended up copying most of the pushm/popm from rx, added "return" but not "simple_return", and merged added a peephole for and->bic. [ ... ignore ... hit send in the wrong window ]

Re: msp430 port

2013-08-19 Thread Jeff Law
On 07/30/2013 09:24 PM, DJ Delorie wrote: [nickc added for comments about the bits he wrote] ... define these as (define_predicate "msp_general_operand" (match_code "mem,reg,subreg,const_int,const,symbol_ref,label_ref" { int save_volatile_ok = volatile_ok; volatile_ok = 1; int ret

Re: msp430 port

2013-08-05 Thread DJ Delorie
comma comma comma comma comma comma got it ;-)

Re: msp430 port

2013-08-04 Thread Gerald Pfeifer
On Tue, 23 Jul 2013, DJ Delorie wrote: > Ok, I think I covered everything... ...except one comma. ;-) > Index: gcc/doc/contrib.texi > === > -Nick Clifton for arm, mcore, fr30, v850, m32r, rx work, > +Nick Clifton for arm, mcore, fr30

Re: msp430 port

2013-08-01 Thread DJ Delorie
> > What I really need is an int20_t type in the core of gcc, so I can set > > Pmode to *that*, to avoid the SImode stuff completely. But that's a > > core change, not a target change. > > Sometimes you have to make core changes for a new port. This sounds > like something that really should be

Re: msp430 port

2013-08-01 Thread Bernd Schmidt
On 07/20/2013 01:32 AM, DJ Delorie wrote: >> Every pattern that is using (subreg:SI (thing:PSI)) needs to be >> explained on this list and given an explicit clearance. It really looks >> like you're just papering over problems elsewhere. > > Most of them are just optimizations, but the problem

Re: msp430 port

2013-07-31 Thread Richard Henderson
On 07/31/2013 07:08 AM, DJ Delorie wrote: >>> The first doesn't have a clobber, though... >> >> Hmm. Missed that. So the only reason you'd care to include the bic >> in the regular and pattern is if it were a smaller encoding than the >> regular r/0/i alternative. > > It is, but the separate pat

Re: msp430 port

2013-07-31 Thread Mike Stump
On Jul 30, 2013, at 8:24 PM, DJ Delorie wrote: > [nickc added for comments about the bits he wrote] > >> ... define these as >> >> (define_predicate "msp_general_operand" >> (match_code "mem,reg,subreg,const_int,const,symbol_ref,label_ref" >> { >> int save_volatile_ok = volatile_ok; >> volati

Re: msp430 port

2013-07-31 Thread DJ Delorie
> > The first doesn't have a clobber, though... > > Hmm. Missed that. So the only reason you'd care to include the bic > in the regular and pattern is if it were a smaller encoding than the > regular r/0/i alternative. It is, but the separate pattern picks that out just fine. > You need to im

Re: msp430 port

2013-07-31 Thread Richard Henderson
On 07/30/2013 05:24 PM, DJ Delorie wrote: > Fixed. Perhaps gen* could error on those? I know they're ignored, I > just keep forgetting that splits are special. > > (alternately, why can't they be included in the matching logic?) (Because pre-reload, pseudos don't have register classes, mostly)

Re: msp430 port

2013-07-31 Thread nick clifton
Hi DJ, Hi Richard, +;; The next two patterns are here to support a "feature" of how GCC implements +;; varargs. When a function uses varargs and the *second* to last named +;; argument is split between argument registers and the stack, gcc expects the +;; callee to allocate space on the stack t

Re: msp430 port

2013-07-30 Thread DJ Delorie
[nickc added for comments about the bits he wrote] > ... define these as > > (define_predicate "msp_general_operand" > (match_code "mem,reg,subreg,const_int,const,symbol_ref,label_ref" > { > int save_volatile_ok = volatile_ok; > volatile_ok = 1; > int ret = general_operand (op, mode); >

Re: msp430 port

2013-07-30 Thread Jeff Law
On 07/30/2013 12:51 PM, DJ Delorie wrote: First, if you can handle ASHIFT directly in PSImode, that's advantageous for address calculations. Yup, I have patterns for 1 and 2 bit shifts, which are all that really happen. They look remarkably like your patterns, but use a subreg on 0 instead o

Re: msp430 port

2013-07-30 Thread Jeff Law
On 07/30/2013 12:47 PM, DJ Delorie wrote: +; Note: using POPM.A #1 is two bytes smaller than using POPX.A + +(define_insn "movsipsi2" + [(set (match_operand:PSI0 "register_operand" "=r") + (subreg:PSI (match_operand:SI 1 "register_operand" "r") 0))] + "TARGET_LARGE" + "

Re: msp430 port

2013-07-30 Thread Richard Henderson
On 07/23/2013 12:08 PM, DJ Delorie wrote: > === > --- gcc/simplify-rtx.c(revision 201184) > +++ gcc/simplify-rtx.c(working copy) > @@ -5884,12 +5884,23 @@ simplify_immed_subreg (enum machine_mode > /* Simplify SUBREG:O

Re: msp430 port

2013-07-30 Thread DJ Delorie
> So it's a little unclear to me which patterns you removed. Your message > has two patterns attached with comments they were to work around reload > issues. Are these the patterns you removed? Yes. I was unable to reproduce the reload problems to which those comments referred. > First, if

Re: msp430 port

2013-07-30 Thread DJ Delorie
> > Index: gcc/cfgexpand.c > > === > > --- gcc/cfgexpand.c (revision 201184) > > +++ gcc/cfgexpand.c (working copy) > I thought I already approved this. Go ahead and install it. Sorry, I forgot to split out those three patches when

Re: msp430 port

2013-07-30 Thread Jeff Law
On 07/23/2013 04:08 PM, DJ Delorie wrote: Index: gcc/cfgexpand.c === --- gcc/cfgexpand.c (revision 201184) +++ gcc/cfgexpand.c (working copy) I thought I already approved this. Go ahead and install it. Index: gcc/simplif

Re: msp430 port

2013-07-30 Thread Jeff Law
On 07/25/2013 05:36 PM, DJ Delorie wrote: I tried to reproduce the original bugs that led to these patterns, but was unable. Testsuite results are the same with and without, and eembc code size doesn't change. So, I'm removing these patterns from the port. The remaining (subreg...) patterns ar

Re: msp430 port

2013-07-25 Thread DJ Delorie
I tried to reproduce the original bugs that led to these patterns, but was unable. Testsuite results are the same with and without, and eembc code size doesn't change. So, I'm removing these patterns from the port. The remaining (subreg...) patterns are just optimizations. ; This pattern is i

Re: msp430 port

2013-07-24 Thread Jeff Law
On 07/19/2013 05:32 PM, DJ Delorie wrote: Every pattern that is using (subreg:SI (thing:PSI)) needs to be explained on this list and given an explicit clearance. It really looks like you're just papering over problems elsewhere. Most of them are just optimizations, but the problem with reload

Re: msp430 port

2013-07-19 Thread DJ Delorie
> Every pattern that is using (subreg:SI (thing:PSI)) needs to be > explained on this list and given an explicit clearance. It really looks > like you're just papering over problems elsewhere. Most of them are just optimizations, but the problem with reload is that an SImode register *can't* h

Re: msp430 port

2013-07-19 Thread DJ Delorie
> GPL + exception seems like the way to go, except in those cases where > the code is coming from a 3rd party. Already pointed out and fixed, but I'll double check that they're all GPL+E. > I'm assuming you documented all the MSP430 options. I didn't check them > closely. I'm also assuming t

msp430 port

2013-07-17 Thread Jeff Law
Might as well clarify copyright status on *all* the msp430 files in libgcc. While one might claim some are so trivially small and thus not suitable for copyright protection, I'd rather not rely on that for anything in libgcc since those bits get included into user code and lawyers look at them