Re: [PATCH, RFC] fortran [was Re: #pragma GCC unroll support]

2015-11-02 Thread Bernhard Reutner-Fischer
On May 28, 2015 2:03:08 PM GMT+02:00, Mike Stump wrote: >On May 28, 2015, at 2:02 AM, Bernhard Reutner-Fischer > wrote: >> >> Does anybody have a better suggestion? >> >> directive not at the start of a loop at %C >> directive not followed by a loop at %C > >I prefer either of these. I have a s

Re: [PATCH, RFC] fortran [was Re: #pragma GCC unroll support]

2015-05-28 Thread Mike Stump
On May 28, 2015, at 2:02 AM, Bernhard Reutner-Fischer wrote: > > Does anybody have a better suggestion? > > directive not at the start of a loop at %C > directive not followed by a loop at %C I prefer either of these. I have a slight preference for the first. > Mike, did you tweak the one or

Re: [PATCH, RFC] fortran [was Re: #pragma GCC unroll support]

2015-05-28 Thread Bernhard Reutner-Fischer
On 3 February 2015 at 01:07, Mike Stump wrote: > On Feb 2, 2015, at 3:22 PM, Bernhard Reutner-Fischer > wrote: >> Untested draft patch > > I looked it over, seems to slot in nicely. > > > + gfc_error ("% directive does not commence a loop at %C”); > > So, don’t like commence here. Does an

Re: #pragma GCC unroll support

2015-03-06 Thread Joseph Myers
On Thu, 5 Mar 2015, Mike Stump wrote: > On Jan 30, 2015, at 8:27 AM, Mike Stump wrote: > > On Jan 30, 2015, at 7:49 AM, Joseph Myers wrote: > >> Use error_at, and %u directly in the format. > > > > Done. > > Ping? I don't see any sign of

Re: #pragma GCC unroll support

2015-03-06 Thread Bernhard Reutner-Fischer
On 6 March 2015 at 02:31, Sandra Loosemore wrote: > On 03/05/2015 04:12 PM, Mike Stump wrote: >> >> >> Ping? >> > > Just commenting on the documentation part: [] and a few coding style nits: +++ b/gcc/c-family/c-pragma.c @@ -1459,6 +1459,10 @@ init_pragma (void) cpp_register_deferred_pragma

Re: #pragma GCC unroll support

2015-03-05 Thread Sandra Loosemore
On 03/05/2015 04:12 PM, Mike Stump wrote: Ping? Just commenting on the documentation part: Index: doc/extend.texi === --- doc/extend.texi (revision 220084) +++ doc/extend.texi (working copy) @@ -17881,6 +17881,18 @@ voi

Re: #pragma GCC unroll support

2015-03-05 Thread Mike Stump
On Jan 30, 2015, at 8:27 AM, Mike Stump wrote: > On Jan 30, 2015, at 7:49 AM, Joseph Myers wrote: >> Use error_at, and %u directly in the format. > > Done. Ping? Index: ada/gcc-interface/trans.c === --- ada/gcc-interface/trans.c

Re: [PATCH, RFC] fortran [was Re: #pragma GCC unroll support]

2015-02-02 Thread Mike Stump
On Feb 2, 2015, at 3:22 PM, Bernhard Reutner-Fischer wrote: > Untested draft patch I looked it over, seems to slot in nicely. + gfc_error ("% directive does not commence a loop at %C”); So, don’t like commence here.

[PATCH, RFC] fortran [was Re: #pragma GCC unroll support]

2015-02-02 Thread Bernhard Reutner-Fischer
Hi, Some compilers IIRC use !DIR$ unroll, if memory serves me right then the DEC compiler had !DEC$ unroll. We could support one or the other three-letter keyword or maybe not. I think a combination of unroll and ivdep directives is allowed (at least in some compilers); TODO. Not sure what other

Re: #pragma GCC unroll support

2015-01-30 Thread Bernhard Reutner-Fischer
On January 30, 2015 5:36:16 PM GMT+01:00, Marek Polacek wrote: >On Fri, Jan 30, 2015 at 08:27:06AM -0800, Mike Stump wrote: >> > >> +static bool >> +c_parse_pragma_ivdep (c_parser *parser) >> +{ >> + c_parser_consume_pragma (parser); >> + c_parser_skip_to_pragma_eol (parser); >> + return tru

Re: #pragma GCC unroll support

2015-01-30 Thread Mike Stump
On Jan 30, 2015, at 12:52 PM, Bernhard Reutner-Fischer wrote: > This last test is still puzzling me. As it is to me. The reason it seems like they were going for in the code was due to wrapping, but wrapping should only happen at something relating to the bit size of the induction variable.

Re: #pragma GCC unroll support

2015-01-30 Thread Marek Polacek
On Fri, Jan 30, 2015 at 08:27:06AM -0800, Mike Stump wrote: > > +static bool > +c_parse_pragma_ivdep (c_parser *parser) > +{ > + c_parser_consume_pragma (parser); > + c_parser_skip_to_pragma_eol (parser); > + return true; > +} > + > +static unsigned short > +c_parser_pragma_unroll (c_parser *

Re: #pragma GCC unroll support

2015-01-30 Thread Mike Stump
On Jan 30, 2015, at 7:49 AM, Joseph Myers wrote: > Use error_at, and %u directly in the format. Done. Index: ada/gcc-interface/trans.c === --- ada/gcc-interface/trans.c (revision 220084) +++ ada/gcc-interface/trans.c (working co

Re: #pragma GCC unroll support

2015-01-30 Thread Joseph Myers
On Thu, 29 Jan 2015, Mike Stump wrote: > @@ -5587,6 +5600,12 @@ c_parser_for_statement (c_parser *parser > "% pragma"); > cond = error_mark_node; > } > + else if (unroll) > + { > + c_parser_error (par

Re: #pragma GCC unroll support

2015-01-29 Thread Mike Stump
On Jan 29, 2015, at 3:12 PM, Joseph Myers wrote: > On Mon, 26 Jan 2015, Mike Stump wrote: > >> + if (!INTEGRAL_TYPE_P (TREE_TYPE (expr)) >> + || TREE_CODE (expr) != INTEGER_CST >> + || (lunroll = tree_to_shwi (expr)) < 0 >> + || lunroll > USHRT_MAX) >> +{ >> + c_parser_er

Re: #pragma GCC unroll support

2015-01-29 Thread Mike Stump
On Jan 29, 2015, at 3:06 PM, Joseph Myers wrote: > On Mon, 26 Jan 2015, Mike Stump wrote: > >> +@item #pragma GCC unroll @var{"n"} >> +@cindex pragma GCC unroll @var{"n"} > > @var contains the name of a metasyntactic variable; it doesn't make sense > for quotes to be included in that name. And

Re: #pragma GCC unroll support

2015-01-29 Thread Joseph Myers
On Mon, 26 Jan 2015, Mike Stump wrote: > + if (!INTEGRAL_TYPE_P (TREE_TYPE (expr)) > + || TREE_CODE (expr) != INTEGER_CST > + || (lunroll = tree_to_shwi (expr)) < 0 > + || lunroll > USHRT_MAX) > +{ > + c_parser_error (parser, "%<#pragma GCC unroll%> requires a > non-negat

Re: #pragma GCC unroll support

2015-01-29 Thread Joseph Myers
On Mon, 26 Jan 2015, Mike Stump wrote: > +@item #pragma GCC unroll @var{"n"} > +@cindex pragma GCC unroll @var{"n"} @var contains the name of a metasyntactic variable; it doesn't make sense for quotes to be included in that name. And as far as I can tell, the quotes aren't part of the syntax e

Re: #pragma GCC unroll support

2015-01-26 Thread Mike Stump
I missed including the documentation patch in the last set. :-( Here it is: Index: extend.texi === --- extend.texi (revision 220084) +++ extend.texi (working copy) @@ -17881,6 +17881,17 @@ void ignore_vec_dep (int *a, int k, int @}

Re: #pragma GCC unroll support

2015-01-26 Thread Mike Stump
Jason, Joseph, this is stage 1 material (unless someone else wants to try and make an argument for it sooner), if you could review the parser (frontend) bits, that would be wonderful. The mid-end, and back-end bits Richard was reviewing. On Jan 8, 2015, at 4:45 AM, Richard Biener wrote: > But

Re: #pragma GCC unroll support

2015-01-08 Thread Richard Biener
On Mon, Dec 22, 2014 at 10:13 PM, Mike Stump wrote: > So, I have a rough cut of a new feature to add pragma GCC unroll support to > gcc. It is safe wrt the test suite and code-gen, but there are some corners > that I need help or suggestions on how to round off nicely. > >

Re: #pragma GCC unroll support

2014-12-23 Thread Andi Kleen
Mike Stump writes: Thanks for doing that. I missed this pragma several times. > I didn’t engineer ivdeps and unroll together. Does it sound > reasonable to allow both to be used at the same time on the same loop? > If so, I can add the two other cases, presently I just handle one of > them then

#pragma GCC unroll support

2014-12-22 Thread Mike Stump
So, I have a rough cut of a new feature to add pragma GCC unroll support to gcc. It is safe wrt the test suite and code-gen, but there are some corners that I need help or suggestions on how to round off nicely. Things to think about, can we put this in even if we have TODO support for C