public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: Greg McGary <greg@mcgary.org>
Cc: gcc@gcc.gnu.org
Subject: Re: How to deal with 48-bit pointers and 32-bit integers
Date: Thu, 13 Aug 2009 14:42:00 -0000	[thread overview]
Message-ID: <4A8413CE.5070906@gnu.org> (raw)
In-Reply-To: <4A833BB8.2090209@mcgary.org>


> I chose to define Pmode as PDImode, and write PDI patterns for pointer
> moves & arithmetic. POINTER_SIZE is 64 bits, UNITS_PER_WORD is 4.
> FUNCTION_ARG_ADVANCE arranges for both SImode and PDImode values to
> occupy a single register. I have the port mostly working (passes 90% of
> execution tests), but find myself painted into a corner in some cases.
> What currently vexes me is when GCC wants to promote a PDImode register
> (say r1) to DImode, then needs to truncate down to SImode for some kind
> of ALU op, say pointer subtraction. The desired quantity is the
> low-order 32 bits of r1, but GCC thinks the promotion to DImode implies
> a pair of 32-bit regs (r1, r2) and since this is a big-endian machine,
> it wants to deliver the low-order bits as the subreg r2.

Maybe you can define TRULY_NOOP_TRUNCATION to be zero for source PDImode 
and destination SImode, and define a truncatepdisi2 pattern that just 
throws away the segment.  I'm not sure however whether GCC will go 
through DImode anyway.

Alternatively, maybe you can define extendpdidi2 so that it will put the 
segment in r1 and the low-order bits in r2.

Paolo

      reply	other threads:[~2009-08-13 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 22:26 Greg McGary
2009-08-13 14:42 ` Paolo Bonzini [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=4A8413CE.5070906@gnu.org \
    --to=bonzini@gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=greg@mcgary.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).