public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Bill Schmidt <wschmidt@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] rs6000: Add basic support for prefixed and PC-relative addresses
Date: Thu, 30 May 2019 19:26:00 -0000	[thread overview]
Message-ID: <20190530192039.GZ31586@gate.crashing.org> (raw)
In-Reply-To: <bed0c89d-3d0c-5500-d6e2-1db4de6685ec@linux.ibm.com>

On Wed, May 29, 2019 at 10:49:35PM -0500, Bill Schmidt wrote:
> 	* config/rs6000/predicates.md (pcrel_address): New
> 	define_predicate.

Please put that on one line?

> +      if (LABEL_REF_P (x))
> +	output_asm_label (x);
> +      else
> +	output_addr_const (file, x);

Why does LABEL_REF need separate handling here?

> +      if (offset)
> +	fprintf (file, "%s" HOST_WIDE_INT_PRINT_DEC, (offset > 0) ? "+" : "",
> +		 offset);

Maybe

      if (offset)
	fprintf (file, "%+" PRId64, offset);

(but there really should be a HOST_WIDE_INT_PRINT_DEC_PLUS or similar for
that then.  Oh well).

> +rs6000_prefixed_address (rtx addr, machine_mode mode)

> +  if (GET_CODE (addr) == PLUS)
> +    {
> +      HOST_WIDE_INT value, mask;

Please declare these where they are defined?

> +      /* DS instruction (bottom 2 bits must be 0).  For 32-bit integers, we
> +	 need to use DS instructions if we are sign-extending the value with
> +	 LWA.  For 32-bit floating point, we need DS instructions to load and
> +	 store values to the traditional Altivec registers.  */
> +      else if (GET_MODE_SIZE (mode) >= 4)
> +	mask = 3;

I don't much like penalising scalar single precision float like this.
But, this also hurts unaligned lwz...  Do we have statistics on that?
Offline, I guess :-)

> +      /* Return true if we must use a prefixed instruction.  */
> +      return ((value & ~mask) != value);

(value & mask) != 0


Okay with those things frobbed a little, or looked at.  Thanks!


Segher


Segher

  reply	other threads:[~2019-05-30 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30  3:52 Bill Schmidt
2019-05-30 19:26 ` Segher Boessenkool [this message]
2019-05-30 19:48   ` Bill Schmidt
2019-05-30 20:38     ` Segher Boessenkool
2019-05-30 23:28     ` Michael Meissner

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=20190530192039.GZ31586@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=wschmidt@linux.ibm.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).