public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gary Funck <gary@intrepid.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Gcc Patches <gcc-patches@gcc.gnu.org>,
	       Andrew MacLeod <amacleod@redhat.com>,
	       Eric Botcazou <ebotcazou@libertysurf.fr>,
	       Steven Bosscher <steven@gcc.gnu.org>,
	       Nenad Vukicevic <nenad@intrepid.com>
Subject: Re: [UPC 15/22] RTL changes
Date: Wed, 02 Dec 2015 23:34:00 -0000	[thread overview]
Message-ID: <20151202233435.GB17538@intrepid.com> (raw)
In-Reply-To: <CAFiYyc2BxBgL3Ujca5hAds+20QcjEYNhT4LiJkgGNjQFGdJLFQ@mail.gmail.com>

On 12/02/15 13:10:44, Richard Guenther wrote:
> On Tue, Dec 1, 2015 at 7:02 AM, Gary Funck <gary@intrepid.com> wrote:
> > UPC pointers-to-shared have an internal representation which is
> > defined as a 'struct' with three fields.  Special logic is
> > needed in promote_mode() to handle this case.
> 
> Errr - but how are 'struct's ever REFERENCE_TYPE or POINTER_TYPE?

UPC pointers-to-shared types are pointer types, but they typically
have a mode that is 2x the size of the normal pointer mode.

Currently, 'upc_pts_type_node' is a global tree mode that
describes the internal representation of a UPC pointer-to-shared.

The code shown below takes the mode of 'upc_pts_type_node'
(TIMode, typically on 64 bit targets) and returns that.
As noted in an earlier reply, this mode could be saved in
a global somewhere (similar to pointer_mode) which could
be used to avoid the reference to 'upc_pts_type_node' below.

> > +++ gcc/explow.c        (.../branches/gupc)     (revision 231080)
> > @@ -794,6 +794,8 @@ promote_mode (const_tree type ATTRIBUTE_
> >      case REFERENCE_TYPE:
> >      case POINTER_TYPE:
> >        *punsignedp = POINTERS_EXTEND_UNSIGNED;
> > +      if (SHARED_TYPE_P (TREE_TYPE (type)))
> > +        return TYPE_MODE (upc_pts_type_node);
> >        return targetm.addr_space.address_mode
> >                (TYPE_ADDR_SPACE (TREE_TYPE (type)));
> >        break;

Asked in previous email: Can an address space be used
for UPC pointers-to-shared?  Yes, if TIMode were allowed,
for example (on 64-bit targets), and that was the mode
associated with th special UPC reserved address space number,
it would take care of returning the proper mode for
UPC pointers-to-shared types.

Address spaces are insufficient however to handle the
situations where the semantics of pointer arithmetic for UPC
pointers-to-shared differs from those of regular "C" pointers,
or for conversions, and situations where optimizations of operations
involving "C" pointers do not apply to "UPC" shared pointers.

So, we can't just dedicate an address space for UPC pointers-to-shared
and be done with it.

thanks,
- Gary

      parent reply	other threads:[~2015-12-02 23:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  6:02 Gary Funck
2015-12-02 12:10 ` Richard Biener
2015-12-02 12:24   ` Jakub Jelinek
2015-12-02 23:34   ` Gary Funck [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=20151202233435.GB17538@intrepid.com \
    --to=gary@intrepid.com \
    --cc=amacleod@redhat.com \
    --cc=ebotcazou@libertysurf.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nenad@intrepid.com \
    --cc=richard.guenther@gmail.com \
    --cc=steven@gcc.gnu.org \
    /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).