public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Stubbs, Andrew" <andrew.stubbs@siemens.com>
To: Tobias Burnus <tobias@codesourcery.com>,
	Andrew Stubbs <ams@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch] gcn: Add __builtin_gcn_{get_stack_limit,first_call_this_thread_p}
Date: Mon, 21 Nov 2022 14:58:59 +0000	[thread overview]
Message-ID: <b401988e-c431-c7cb-0729-9150ea3936f9@siemens.com> (raw)
In-Reply-To: <2249a729-d961-3939-bc63-8c7564e03dd0@codesourcery.com>

On 21/11/2022 13:41, Tobias Burnus wrote:
> On 19.11.22 11:46, Tobias Burnus wrote:
>>> +       stacklimit = stackbase + seg_size*64;
>> (this should be '*seg_size' not 'seg_size' and the name should be
>> s/seg_size/seg_size_ptr/.)
> I have updated the comment and ...
>> (Reading it, I think it should be '..._MEM(SImode,' and
>> '..._MULT(SImode' instead of DImode.)
> Additionally, there was a problem of bytes vs. bits in:
>> My understanding is that
>> dispatch_ptr->private_segment_size == *((char*)dispatch_ptr + 192)
> 
> which is wrong - its 192 bits but only 24 bytes!
> 
> Finally, in the first_call_this_thread_p() call, I mixed up EQ vs. NE at 
> one place.
> 
> BTW: It seems as if there is no problem with zero extension, if I look 
> at the assembler result.
> 
> Updated version. Consists of: GCC patch adding the builtins,
> the newlib patch using those (unchanged; used for testing + to be 
> submitted), and
> a 'test.c' using the builtins and its dump produced with amdgcn's
> 'cc1 -O2' to show the resulting assembly.
> 
> Tested with libgomp on gfx908 offloading and getting only the known fails:
> (libgomp.c-c++-common/teams-2.c, libgomp.fortran/async_io_*.f90,
> libgomp.oacc-c-c++-common/{deep-copy-10.c,static-variable-1.c,vprop.c})
> 
> OK for mainline?

OK, provided it has been tested in both stand-alone and offload modes, 
and the newlib tests too.

Andrew

      reply	other threads:[~2022-11-21 14:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 17:20 Tobias Burnus
2022-11-18 17:49 ` Andrew Stubbs
2022-11-19 10:46   ` Tobias Burnus
2022-11-20  0:23     ` Andrew Stubbs
2022-11-21 13:41     ` Tobias Burnus
2022-11-21 14:58       ` Stubbs, Andrew [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b401988e-c431-c7cb-0729-9150ea3936f9@siemens.com \
    --to=andrew.stubbs@siemens.com \
    --cc=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).