Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-19 Thread Prathamesh Kulkarni via Gcc
On Wed, 18 Aug 2021 at 20:10, Martin Sebor wrote: > > On 8/18/21 12:52 AM, Prathamesh Kulkarni wrote: > > On Fri, 13 Aug 2021 at 22:44, Martin Sebor wrote: > >> > >> On 8/12/21 2:32 AM, Prathamesh Kulkarni wrote: > >>> On Sat, 7 Aug 2021 at 02:09, Martin Sebor wrote: > > On 8/6/21 4:51

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-18 Thread Martin Sebor via Gcc
On 8/18/21 12:52 AM, Prathamesh Kulkarni wrote: On Fri, 13 Aug 2021 at 22:44, Martin Sebor wrote: On 8/12/21 2:32 AM, Prathamesh Kulkarni wrote: On Sat, 7 Aug 2021 at 02:09, Martin Sebor wrote: On 8/6/21 4:51 AM, Richard Earnshaw wrote: On 06/08/2021 01:06, Martin Sebor via Gcc wrote:

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-17 Thread Prathamesh Kulkarni via Gcc
On Fri, 13 Aug 2021 at 22:44, Martin Sebor wrote: > > On 8/12/21 2:32 AM, Prathamesh Kulkarni wrote: > > On Sat, 7 Aug 2021 at 02:09, Martin Sebor wrote: > >> > >> On 8/6/21 4:51 AM, Richard Earnshaw wrote: > >>> > >>> > >>> On 06/08/2021 01:06, Martin Sebor via Gcc wrote: > On 8/4/21 3:46 A

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-13 Thread Martin Sebor via Gcc
On 8/12/21 2:32 AM, Prathamesh Kulkarni wrote: On Sat, 7 Aug 2021 at 02:09, Martin Sebor wrote: On 8/6/21 4:51 AM, Richard Earnshaw wrote: On 06/08/2021 01:06, Martin Sebor via Gcc wrote: On 8/4/21 3:46 AM, Richard Earnshaw wrote: On 03/08/2021 18:44, Martin Sebor wrote: On 8/3/21 4:11

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-12 Thread Prathamesh Kulkarni via Gcc
On Sat, 7 Aug 2021 at 02:09, Martin Sebor wrote: > > On 8/6/21 4:51 AM, Richard Earnshaw wrote: > > > > > > On 06/08/2021 01:06, Martin Sebor via Gcc wrote: > >> On 8/4/21 3:46 AM, Richard Earnshaw wrote: > >>> > >>> > >>> On 03/08/2021 18:44, Martin Sebor wrote: > On 8/3/21 4:11 AM, Prathame

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-06 Thread Martin Sebor via Gcc
On 8/6/21 4:51 AM, Richard Earnshaw wrote: On 06/08/2021 01:06, Martin Sebor via Gcc wrote: On 8/4/21 3:46 AM, Richard Earnshaw wrote: On 03/08/2021 18:44, Martin Sebor wrote: On 8/3/21 4:11 AM, Prathamesh Kulkarni via Gcc wrote: On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: On M

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-06 Thread Martin Uecker via Gcc
> On Wed, 4 Aug 2021 at 03:27, Segher Boessenkool > wrote: > > > > Hi! > > > > On Fri, Jul 23, 2021 at 04:23:42PM +0530, Prathamesh Kulkarni via Gcc wrote: > > > The constraint here is that, vshl_n intrinsics require that the > > > second arg (__b), > > > should be an immediate value. > > > > Some

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-06 Thread Richard Earnshaw via Gcc
On 06/08/2021 01:06, Martin Sebor via Gcc wrote: On 8/4/21 3:46 AM, Richard Earnshaw wrote: On 03/08/2021 18:44, Martin Sebor wrote: On 8/3/21 4:11 AM, Prathamesh Kulkarni via Gcc wrote: On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kul

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-05 Thread Martin Sebor via Gcc
On 8/4/21 3:46 AM, Richard Earnshaw wrote: On 03/08/2021 18:44, Martin Sebor wrote: On 8/3/21 4:11 AM, Prathamesh Kulkarni via Gcc wrote: On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc wrote: On Fri, 23 Jul 2021 at 23:29,

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-05 Thread Segher Boessenkool
On Thu, Aug 05, 2021 at 02:31:02PM +0530, Prathamesh Kulkarni wrote: > On Wed, 4 Aug 2021 at 18:30, Richard Earnshaw > wrote: > > We don't want to have to resort to macros. Not least because at some > > point we want to replace the content of arm_neon.h with a single #pragma > > directive to remo

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-05 Thread Richard Earnshaw via Gcc
On 04/08/2021 18:59, Segher Boessenkool wrote: > On Wed, Aug 04, 2021 at 07:08:08PM +0200, Florian Weimer wrote: >> * Segher Boessenkool: >> >>> On Wed, Aug 04, 2021 at 03:27:00PM +0100, Richard Earnshaw wrote: On 04/08/2021 14:40, Segher Boessenkool wrote: > On Wed, Aug 04, 2021 at 02:00:

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-05 Thread Prathamesh Kulkarni via Gcc
On Wed, 4 Aug 2021 at 18:30, Richard Earnshaw wrote: > > On 04/08/2021 13:46, Segher Boessenkool wrote: > > On Wed, Aug 04, 2021 at 05:20:58PM +0530, Prathamesh Kulkarni wrote: > >> On Wed, 4 Aug 2021 at 15:49, Segher Boessenkool > >> wrote: > >>> Both __builtin_constant_p and __is_constexpr will

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Segher Boessenkool
On Wed, Aug 04, 2021 at 07:08:08PM +0200, Florian Weimer wrote: > * Segher Boessenkool: > > > On Wed, Aug 04, 2021 at 03:27:00PM +0100, Richard Earnshaw wrote: > >> On 04/08/2021 14:40, Segher Boessenkool wrote: > >> >On Wed, Aug 04, 2021 at 02:00:42PM +0100, Richard Earnshaw wrote: > >> >>We don'

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Florian Weimer via Gcc
* Segher Boessenkool: > On Wed, Aug 04, 2021 at 03:27:00PM +0100, Richard Earnshaw wrote: >> On 04/08/2021 14:40, Segher Boessenkool wrote: >> >On Wed, Aug 04, 2021 at 02:00:42PM +0100, Richard Earnshaw wrote: >> >>We don't want to have to resort to macros. Not least because at some >> >>point we

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Segher Boessenkool
On Wed, Aug 04, 2021 at 03:27:00PM +0100, Richard Earnshaw wrote: > On 04/08/2021 14:40, Segher Boessenkool wrote: > >On Wed, Aug 04, 2021 at 02:00:42PM +0100, Richard Earnshaw wrote: > >>We don't want to have to resort to macros. Not least because at some > >>point we want to replace the content

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Richard Earnshaw via Gcc
On 04/08/2021 14:40, Segher Boessenkool wrote: On Wed, Aug 04, 2021 at 02:00:42PM +0100, Richard Earnshaw wrote: We don't want to have to resort to macros. Not least because at some point we want to replace the content of arm_neon.h with a single #pragma directive to remove all the parsing o

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Segher Boessenkool
On Wed, Aug 04, 2021 at 02:00:42PM +0100, Richard Earnshaw wrote: > We don't want to have to resort to macros. Not least because at some > point we want to replace the content of arm_neon.h with a single #pragma > directive to remove all the parsing of the header that's needed. What's > more, if

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Richard Earnshaw via Gcc
On 04/08/2021 13:46, Segher Boessenkool wrote: > On Wed, Aug 04, 2021 at 05:20:58PM +0530, Prathamesh Kulkarni wrote: >> On Wed, 4 Aug 2021 at 15:49, Segher Boessenkool >> wrote: >>> Both __builtin_constant_p and __is_constexpr will not work in your use >>> case (since a function argument is not a

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Segher Boessenkool
On Wed, Aug 04, 2021 at 05:20:58PM +0530, Prathamesh Kulkarni wrote: > On Wed, 4 Aug 2021 at 15:49, Segher Boessenkool > wrote: > > Both __builtin_constant_p and __is_constexpr will not work in your use > > case (since a function argument is not a constant, let alone an ICE). > > It only becomes a

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Prathamesh Kulkarni via Gcc
On Wed, 4 Aug 2021 at 15:49, Segher Boessenkool wrote: > > On Wed, Aug 04, 2021 at 03:20:45PM +0530, Prathamesh Kulkarni wrote: > > On Wed, 4 Aug 2021 at 03:27, Segher Boessenkool > > wrote: > > > The Linux kernel has a macro __is_constexpr to test if something is an > > > integer constant expres

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Segher Boessenkool
On Wed, Aug 04, 2021 at 03:20:45PM +0530, Prathamesh Kulkarni wrote: > On Wed, 4 Aug 2021 at 03:27, Segher Boessenkool > wrote: > > The Linux kernel has a macro __is_constexpr to test if something is an > > integer constant expression, see . That is a much > > better idea imo. There could be a

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Prathamesh Kulkarni via Gcc
On Wed, 4 Aug 2021 at 03:27, Segher Boessenkool wrote: > > Hi! > > On Fri, Jul 23, 2021 at 04:23:42PM +0530, Prathamesh Kulkarni via Gcc wrote: > > The constraint here is that, vshl_n intrinsics require that the > > second arg (__b), > > should be an immediate value. > > Something that matches the

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-04 Thread Richard Earnshaw via Gcc
On 03/08/2021 18:44, Martin Sebor wrote: On 8/3/21 4:11 AM, Prathamesh Kulkarni via Gcc wrote: On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc wrote: On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: On Fri, Jul 23, 20

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-03 Thread Segher Boessenkool
Hi! On Fri, Jul 23, 2021 at 04:23:42PM +0530, Prathamesh Kulkarni via Gcc wrote: > The constraint here is that, vshl_n intrinsics require that the > second arg (__b), > should be an immediate value. Something that matches the "n" constraint, not necessarily a literal, but stricter than just "imme

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-03 Thread Martin Sebor via Gcc
On 8/3/21 4:11 AM, Prathamesh Kulkarni via Gcc wrote: On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc wrote: On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: On Fri, Jul 23, 2021 at 3:55 AM Prathamesh Kulkarni via Gcc wr

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-03 Thread Prathamesh Kulkarni via Gcc
On Tue, 3 Aug 2021 at 15:41, Prathamesh Kulkarni wrote: > > On Tue, 27 Jul 2021 at 13:49, Richard Biener > wrote: > > > > On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc > > wrote: > > > > > > On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: > > > > > > > > On Fri, Jul 23, 2021

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-08-03 Thread Prathamesh Kulkarni via Gcc
On Tue, 27 Jul 2021 at 13:49, Richard Biener wrote: > > On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc > wrote: > > > > On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: > > > > > > On Fri, Jul 23, 2021 at 3:55 AM Prathamesh Kulkarni via Gcc > > > wrote: > > > > > > > > Hi, > > >

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-07-27 Thread Richard Biener via Gcc
On Mon, Jul 26, 2021 at 11:06 AM Prathamesh Kulkarni via Gcc wrote: > > On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: > > > > On Fri, Jul 23, 2021 at 3:55 AM Prathamesh Kulkarni via Gcc > > wrote: > > > > > > Hi, > > > Continuing from this thread, > > > https://gcc.gnu.org/pipermail/gcc-pat

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-07-26 Thread Prathamesh Kulkarni via Gcc
On Fri, 23 Jul 2021 at 23:29, Andrew Pinski wrote: > > On Fri, Jul 23, 2021 at 3:55 AM Prathamesh Kulkarni via Gcc > wrote: > > > > Hi, > > Continuing from this thread, > > https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575920.html > > The proposal is to provide a mechanism to mark a paramet

Re: [RFC] Adding a new attribute to function param to mark it as constant

2021-07-23 Thread Andrew Pinski via Gcc
On Fri, Jul 23, 2021 at 3:55 AM Prathamesh Kulkarni via Gcc wrote: > > Hi, > Continuing from this thread, > https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575920.html > The proposal is to provide a mechanism to mark a parameter in a > function as a literal constant. > > Motivation: > Consider

[RFC] Adding a new attribute to function param to mark it as constant

2021-07-23 Thread Prathamesh Kulkarni via Gcc
Hi, Continuing from this thread, https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575920.html The proposal is to provide a mechanism to mark a parameter in a function as a literal constant. Motivation: Consider the following intrinsic vshl_n_s32 from arrm/arm_neon.h: __extension__ extern __inl