Re: [PATCH RFC] add generic expansion for MULT_HIGHPART_EXP

2018-08-24 Thread Pekka Jääskeläinen
Hi, On Mon, Aug 20, 2018 at 1:46 PM Alexander Monakov wrote: > > So - how difficult is it to fix BRIG to not use MULT_HIGHPART_EXPR if > > not supported? > > Pekka, can you comment? I think you have fallback paths for vector types > only at the moment? I think it involves pretty much moving the

Re: [PATCH 8/8] [BRIGFE] Fix handling of NOPs

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259958. On Fri, May 4, 2018 at 5:02 PM, Pekka Jääskeläinen wrote: > --- > gcc/brig/brigfrontend/brig-basic-inst-handler.cc | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) >

Re: [PATCH 7/8] [BRIGFE] phsa-specific optimizations

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259957. On Fri, May 4, 2018 at 5:02 PM, Pekka Jääskeläinen wrote: > Add flag -fassume-phsa that is on by default. If -fno-assume-phsa > is given, these optimizations are disabled. > > With this flag, gccbrig can generate GENERIC that assumes we are > targeting a phs

Re: [PATCH 5/8] [BRIGFE] do not allow optimizations based on known C builtins

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259949. On Fri, May 4, 2018 at 5:00 PM, Pekka Jääskeläinen wrote: > This can break inputs that have similarly names functions. > --- > gcc/brig/brig-lang.c | 16 +++- > 1 file changed, 7 insertions(+), 9 deletions(-) >

Re: [PATCH 4/8] [BRIGFE] allow controlling strict aliasing from cmd line

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259948. On Fri, May 4, 2018 at 4:59 PM, Pekka Jääskeläinen wrote: > --- > gcc/brig/brig-lang.c | 12 +--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >

Re: [PATCH 3/8] [BRIGFE] The modulo in ID computation should not be needed.

2018-05-04 Thread Pekka Jääskeläinen
Commited in r259944. On Fri, May 4, 2018 at 4:58 PM, Pekka Jääskeläinen wrote: > The case where a dim is greater than the grid size doesn't seem > to be mentioned in the specs nor tested by PRM test suite. > --- > gcc/brig/brigfrontend/brig-code-entry-handler.cc | 10 +--

Re: [PATCH 2/8] [BRIGFE] Enable whole program optimizations

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259943. On Fri, May 4, 2018 at 4:57 PM, Pekka Jääskeläinen wrote: > HSA assumes all program scope HSAIL symbols can be queried from > the host runtime API, thus cannot be removed by the IPA. > > Getting some inlining happening in the finalized binary required: &g

Re: [PATCH 1/8] [BRIGFE] fix an alloca stack underflow

2018-05-04 Thread Pekka Jääskeläinen
Committed as r259942. On Fri, May 4, 2018 at 4:56 PM, Pekka Jääskeläinen wrote: > We didn't preserve additional space for the alloca frame pointers that > are needed to be saved in the alloca space.

[PATCH 7/8] [BRIGFE] phsa-specific optimizations

2018-05-04 Thread Pekka Jääskeläinen
Add flag -fassume-phsa that is on by default. If -fno-assume-phsa is given, these optimizations are disabled. With this flag, gccbrig can generate GENERIC that assumes we are targeting a phsa-runtime based implementation, which allows us to expose the work-item context accesses to retrieve WI IDs

[PATCH 8/8] [BRIGFE] Fix handling of NOPs

2018-05-04 Thread Pekka Jääskeläinen
--- gcc/brig/brigfrontend/brig-basic-inst-handler.cc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) >From fee48e53063309a58a9a3050df26395ae1615111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Thu, 12 Oct 2017 15:55:11 +0200 Subject: [PA

[PATCH 6/8] [BRIGFE] skip multiple forward declarations of the same function

2018-05-04 Thread Pekka Jääskeläinen
--- gcc/brig/brigfrontend/brig-function-handler.cc | 4 1 file changed, 4 insertions(+) >From 1c708e887073960b6142d716d3e85f3453d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Sat, 17 Feb 2018 08:59:25 +0200 Subject: [PATCH 6/8] [BRIGFE] skip mu

[PATCH 5/8] [BRIGFE] do not allow optimizations based on known C builtins

2018-05-04 Thread Pekka Jääskeläinen
This can break inputs that have similarly names functions. --- gcc/brig/brig-lang.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) >From 105277ee937482ee1a55265b1ec45637bc1e7a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Sat, 17

[PATCH 4/8] [BRIGFE] allow controlling strict aliasing from cmd line

2018-05-04 Thread Pekka Jääskeläinen
--- gcc/brig/brig-lang.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) >From c8a86773e877949fb9308d2dd448ea013be22c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Mon, 12 Feb 2018 11:34:58 +0200 Subject: [PATCH 4/8] [BRIGFE] allow c

[PATCH 3/8] [BRIGFE] The modulo in ID computation should not be needed.

2018-05-04 Thread Pekka Jääskeläinen
The case where a dim is greater than the grid size doesn't seem to be mentioned in the specs nor tested by PRM test suite. --- gcc/brig/brigfrontend/brig-code-entry-handler.cc | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) >From 99303afff584518c1fd17e3c6ebe965043dd58f0 Mon Sep 1

[PATCH 2/8] [BRIGFE] Enable whole program optimizations

2018-05-04 Thread Pekka Jääskeläinen
HSA assumes all program scope HSAIL symbols can be queried from the host runtime API, thus cannot be removed by the IPA. Getting some inlining happening in the finalized binary required: * explicitly marking the 'prog' scope functions and the launcher function "externally_visible" to avoid the in

[PATCH 1/8] [BRIGFE] fix an alloca stack underflow

2018-05-04 Thread Pekka Jääskeläinen
We didn't preserve additional space for the alloca frame pointers that are needed to be saved in the alloca space. Fixes libgomp.c++/target-6.C execution test. --- libhsail-rt/rt/workitems.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libhsail-rt/rt/worki

[PATCH 0/8] [BRIGFE] various fixes and optimizations

2018-05-04 Thread Pekka Jääskeläinen
Hi, I'm posting a series of patches that I will shortly commit to trunk as a maintainer of the BRIG frontend. All of them are build tested, the last one also with a bootstrap build. Best regards, -- Pekka

Re: [PATCH] [BRIGFE] Reduce the number of type conversions due to the untyped HSAIL regs

2017-11-17 Thread Pekka Jääskeläinen
Hi Rainer, On Fri, Nov 17, 2017 at 1:32 PM, Rainer Orth wrote: > Please fix. Fixed in r254870. BR, Pekka

[PATCH] [BRIGFE] Reduce the number of type conversions due to the untyped HSAIL regs

2017-11-16 Thread Pekka Jääskeläinen
ds the register variables as a type + used in tree expressions at most. This gives better chance to + optimize CONVERT_VIEW_EXPRs away. + * brigfrontend/brig-code-entry-handler.cc: Add analysis method for + register type usage. Handle any-typed register variables. + * brigfrontend/brig-code-en

Re: [PATCH] BRIG frontend: request for a global review

2017-11-16 Thread Pekka Jääskeläinen
piler for BRIG/HSAIL finalization +@end direntry +@end format + +@insertcopying +@end ifinfo + +@titlepage +@title The GNU BRIG (HSAIL) Compiler +@versionsubtitle +@author Pekka Jääskeläinen + +@page +@vskip 0pt plus 1filll +Published by the Free Software Foundation @* +51 Franklin Street, Fifth Floor@* +B

Re: [081/nnn] poly_int: brig vector elements

2017-10-23 Thread Pekka Jääskeläinen
Hi Richard, Indeed, HSAIL doesn't so far support variable length vectors. If it ever will, there will be wider changes needed anyways. So, this patch LGTM. Pekka, A HSA/BRIG maintainer On Mon, Oct 23, 2017 at 7:32 PM, Richard Sandiford wrote: > This patch adds a brig-specific wrapper around T

Re: [PATCH] -fftz-math: assume that denorms _must_ be flushed to zero optimizations

2017-08-22 Thread Pekka Jääskeläinen
Hi Richard and Joseph, Replies for both inline: I wrote: >> Both the inputs and outputs must be flushed to zero in the HSAIL’s >> ‘ftz’ semantics. >> FTZ operations were previously always “explicit” in the BRIG FE output, like >> you >> propose here; there were builtin calls injected for all inp

Re: [PATCH] -fftz-math: assume that denorms _must_ be flushed to zero optimizations

2017-08-14 Thread Pekka Jääskeläinen
Hi Richard, The base idea of the patch is to optimize for the (common) situation where FTZ/DAZ is controlled by a CPU-wide flag and we then need to only avoid compile-time optimizations that assume semantics where denorm handling is on to support the ‘forced FTZ/DAZ semantics’. > This suggests on

[PATCH] -fftz-math: assume that denorms _must_ be flushed to zero optimizations

2017-08-10 Thread Pekka Jääskeläinen
Hi, The attached patch adds a new switch -fftz-math which makes certain optimizations assume that "flush to zero" behavior of denormal inputs and outputs is not an optimization hint, but required behavior for semantical correctness. The need for this was initiated by HSAIL (BRIG). With HSAIL, flu

BRIG FE: fix for lda and private arrays

2017-05-13 Thread Pekka Jääskeläinen
Hi, I committed in r248006 the attached fix for an assertion when doing an 'lda' of a private array offset. BR, -- Pekka Jääskeläinen Parmance Index: gcc/brig/ChangeLog === --- gcc/brig/ChangeLog (revision 248005) ++

Misc. BRIG/HSAIL FE updates

2017-05-03 Thread Pekka Jääskeläinen
--- gcc/brig/ChangeLog (revision 247575) +++ gcc/brig/ChangeLog (revision 247576) @@ -1,3 +1,11 @@ +2017-05-03 Pekka Jääskeläinen + + * brigfrontend/brig-code-entry-handler.cc + (brig_code_entry_handler::build_address_operand): Fix a bug + with reg+offset addressing on 32b segments. In l

Re: [PATCH] Actually fix libhsail-rt build on x86_64/i?86 32-bit (take 2)

2017-01-31 Thread Pekka Jääskeläinen
Hi Jakub, Thanks for the fix. I've tested this patch with the HSA PRM suite and no bri{ck,g}ing, so please go ahead and commit. BR, Pekka On Mon, Jan 30, 2017 at 10:17 PM, Jakub Jelinek wrote: > On Mon, Jan 30, 2017 at 08:53:18PM +0100, Bernhard Reutner-Fischer wrote: >> As this will likely b

Re: [PATCH] BRIG frontend: request for a global review

2017-01-27 Thread Pekka Jääskeläinen
ontend. >> + >> +The library contains both the code required to run kernels on the agent >> +and also functions implementing more complex HSAIL instructions. >> + >> +rt/workitems.c contains the runtime entry function that manages multiple >> +work-item execution using

Re: [PATCH] BRIG frontend: request for a global review

2017-01-26 Thread Pekka Jääskeläinen
ekka On Thu, Jan 26, 2017 at 10:28 AM, Jakub Jelinek wrote: > On Thu, Jan 26, 2017 at 09:38:23AM +0200, Pekka Jääskeläinen wrote: >> > I suppose that also contrib/update-copyright.py need to be updated? (I >> > never looked into that, so don't know.) >> >>

Re: [PATCH] BRIG frontend: request for a global review

2017-01-25 Thread Pekka Jääskeläinen
On Wed, Jan 25, 2017 at 6:07 PM, Thomas Schwinge wrote: > Hi! > > On Wed, 25 Jan 2017 13:21:13 +0100, Jakub Jelinek wrote: >> On Wed, Jan 25, 2017 at 11:00:50AM +0100, Thomas Schwinge wrote: >> > On Tue, 24 Jan 2017 13:52:10 +0100, Martin Jambor wrote: >> > > [BRIG front end] > > $ git grep

Re: [PATCH 1/4] BRIG (HSAIL) frontend: configuration file changes and misc

2017-01-24 Thread Pekka Jääskeläinen
Hi, On Tue, Jan 24, 2017 at 7:26 PM, Joseph Myers wrote: > Since front ends can't be enabled or disabled on a per-multilib basis, if > you want to support any x86/x86_64 GNU/Linux configuration you need to > support all of them here (and possibly disable runtime libraries for > particular multili

Re: [PATCH] BRIG frontend: request for a global review

2017-01-19 Thread Pekka Jääskeläinen
Hi Jakub and Richard, Attached is an updated BRIG FE patch which adds the HSAIL related builtins only internally in the BRIG FE. I didn't add LTO support as I believe it's not useful for BRIG FE due to it always inputting fully linked BRIGs and not mixing with other frontends. BR, Pekka On Mon

Re: [PATCH] BRIG frontend: request for a global review

2017-01-16 Thread Pekka Jääskeläinen
OK, I'll see into adapting the Jakub's idea and also check if some of the simplest builtins are better expanded directly to tree nodes instead. I'm not sure if lto support is needed though as the assumption now is to have fully linked input to this FE (all necessary BRIG modules fed in at build t

Re: [PATCH] BRIG frontend: request for a global review

2017-01-14 Thread Pekka Jääskeläinen
On Fri, Jan 13, 2017 at 11:36 PM, Richard Biener wrote: > Ah, with fibers fixed there's only the fp16.c part left. Presumably LGPL > overall is OK as well (but I'm not a lawyer either). Seems fp16.c has the GPL3 runtime exception in place, so I believe we are good here license-wise: "Under Sec

Re: [PATCH] BRIG frontend: request for a global review

2017-01-13 Thread Pekka Jääskeläinen
On Fri, Jan 13, 2017 at 2:34 PM, Richard Biener wrote: > On Thu, Jan 12, 2017 at 3:55 PM, Pekka Jääskeläinen > wrote: >> Hi, >> >> A gentle ping... > > Looking at 002/ > > What's the reason of having brig-builtins.def? I do not see any > middle-end s

Re: [PATCH] BRIG frontend: request for a global review

2017-01-13 Thread Pekka Jääskeläinen
Hi Richard, Thanks for the review! Replies/questions inline. On Fri, Jan 13, 2017 at 2:28 PM, Richard Biener wrote: > On Thu, Jan 12, 2017 at 3:55 PM, Pekka Jääskeläinen > wrote: >> Hi, >> >> A gentle ping... > > diff --git a/gcc/configure.ac b/gcc/configure.ac &

Re: [PATCH] BRIG frontend: request for a global review

2017-01-12 Thread Pekka Jääskeläinen
Hi, A gentle ping... On Wed, Dec 14, 2016 at 7:15 PM, Pekka Jääskeläinen wrote: > Hi, > > I'm calling for a global review for the BRIG frontend for inclusion in > upstream. > The copyright transfer has been taken care of. > > The patch set has been approved by Mart

Re: [PATCH 2/4] BRIG (HSAIL) frontend: The FE itself.

2016-11-09 Thread Pekka Jääskeläinen
Hi Martin, On Fri, Nov 4, 2016 at 4:58 PM, Martin Jambor wrote: > I personally primarily want this for debugging purposes, and we should > try to eventually report errors in a more comprehensible way than > HSAILasm. But more generally, and more importantly, if the input, > whether human readabl

Re: [PATCH 3/4] BRIG (HSAIL) frontend: libhsail-rt

2016-08-30 Thread Pekka Jääskeläinen
Updated patch attached. This one was updated with a new ultra simple fiber implementation that calls ucontext.h API directly instead of requiring Pth in between. Plus cleanups. On Mon, Aug 15, 2016 at 4:22 PM, Pekka Jääskeläinen wrote: > Updated patch attached. > Mostly comment cleanu

Re: [PATCH 4/4] BRIG (HSAIL) frontend: smoke test suite

2016-08-15 Thread Pekka Jääskeläinen
Updated the test suite by refreshing the test strings to match the new output + added a new regression test case. On Mon, May 16, 2016 at 8:26 PM, Pekka Jääskeläinen wrote: > A smoke test suite. The patch has been tested more thoroughly with the > proprietary HSA PRM conformance

Re: [PATCH 2/4] BRIG (HSAIL) frontend: The FE itself.

2016-08-15 Thread Pekka Jääskeläinen
Thanks a lot for the review Martin, Responses inline: On Mon, Aug 1, 2016 at 7:37 PM, Martin Jambor wrote: > > - I would definitely appreciate more comments. All but the most > trivial functions should have one that describes what the function > does, what are its arguments and what i

Re: [PATCH 1/4] BRIG (HSAIL) frontend: configuration file changes and misc

2016-08-15 Thread Pekka Jääskeläinen
Updated patch attached. On Wed, May 18, 2016 at 7:58 PM, Pekka Jääskeläinen wrote: > Hi, > > Attached an updated patch (rebased + added .texi docs). > > On Mon, May 16, 2016 at 8:25 PM, Pekka Jääskeläinen > wrote: >> The configuration file changes and misc. updates

Re: [PATCH 0/4] BRIG (HSAIL) frontend

2016-08-15 Thread Pekka Jääskeläinen
43437 insertions(+), 3 deletions(-) On Wed, May 18, 2016 at 3:17 AM, Joseph Myers wrote: > On Mon, 16 May 2016, Pekka Jääskeläinen wrote: > >> The diffstat is as follows: > > I don't see any .texi files in this diffstat. New front ends need all > relevant documenta

Re: [PATCH 0/4] BRIG (HSAIL) frontend

2016-06-09 Thread Pekka Jääskeläinen
Ping: Any further comments to the patch set? Thanks, Pekka On Wed, May 18, 2016 at 8:01 PM, Pekka Jääskeläinen wrote: > Hi Joseph, > > Updated diffstat below: > Makefile.def | 3 + > Makefile.in

Re: [PATCH 1/4] BRIG (HSAIL) frontend: configuration file changes and misc

2016-05-19 Thread Pekka Jääskeläinen
On Wed, May 18, 2016 at 7:58 PM, Pekka Jääskeläinen wrote: > Attached an updated patch (rebased + added .texi docs). Trying again. The file got somehow corrupted in the process. Sorry, Pekka The configuration file changes, documentation updates and other updates. Also, added include/

Re: [PATCH 2/4] BRIG (HSAIL) frontend: The FE itself.

2016-05-19 Thread Pekka Jääskeläinen
On Wed, May 18, 2016 at 9:36 PM, David Malcolm wrote: > On Wed, 2016-05-18 at 19:59 +0300, Pekka Jääskeläinen wrote: >> Hi Joseph, >> >> Thanks for the comments. Updated&rebased patch attached. Hopefully I >> didn't miss any diags. > > It looks like th

Re: [PATCH 0/4] BRIG (HSAIL) frontend

2016-05-18 Thread Pekka Jääskeläinen
| 928 + 88 files changed, 42773 insertions(+), 1 deletion(-) On Wed, May 18, 2016 at 3:17 AM, Joseph Myers wrote: > On Mon, 16 May 2016, Pekka Jääskeläinen wrote: > >> The diffstat is as follows: > > I don't see any .texi files in this diffstat.

Re: [PATCH 2/4] BRIG (HSAIL) frontend: The FE itself.

2016-05-18 Thread Pekka Jääskeläinen
Hi Joseph, Thanks for the comments. Updated&rebased patch attached. Hopefully I didn't miss any diags. On Wed, May 18, 2016 at 3:20 AM, Joseph Myers wrote: > This patch has many improperly formatted diagnostic messages (e.g. > starting with capital letters, ending with '.' or failing to use %q

Re: [PATCH 1/4] BRIG (HSAIL) frontend: configuration file changes and misc

2016-05-18 Thread Pekka Jääskeläinen
Hi, Attached an updated patch (rebased + added .texi docs). On Mon, May 16, 2016 at 8:25 PM, Pekka Jääskeläinen wrote: > The configuration file changes and misc. updates required > by the BRIG frontend. > > Also, added include/hsa-interface.h which is hsa.h taken from libgomp &

[PATCH 4/4] BRIG (HSAIL) frontend: smoke test suite

2016-05-16 Thread Pekka Jääskeläinen
A smoke test suite. The patch has been tested more thoroughly with the proprietary HSA PRM conformance suite. Requires the HSAILasm tool to first compile the .hsail to .brig. -- Pekka Jääskeläinen Parmance A smoke test suite. The patch has been tested more thoroughly with the proprietary HSA

[PATCH 2/4] BRIG (HSAIL) frontend: The FE itself.

2016-05-16 Thread Pekka Jääskeläinen
The BRIG frontend itself. -- Pekka Jääskeläinen Parmance 002-brig-fe-new-files.patch.gz Description: application/gzip

[PATCH 1/4] BRIG (HSAIL) frontend: configuration file changes and misc

2016-05-16 Thread Pekka Jääskeläinen
The configuration file changes and misc. updates required by the BRIG frontend. Also, added include/hsa-interface.h which is hsa.h taken from libgomp and will be shared by it (agreed with Martin Liška / SUSE). -- Pekka Jääskeläinen Parmance The configuration file changes and misc. updates

[PATCH 0/4] BRIG (HSAIL) frontend

2016-05-16 Thread Pekka Jääskeläinen
ent.c |57 + libhsail-rt/rt/workitems.c| 928 + 85 files changed, 42754 insertions(+) BR, -- Pekka Jääskeläinen Parmance