public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: "Gopalasubramanian, Ganesh" <Ganesh.Gopalasubramanian@amd.com>,
	       Marcus Shawcroft <marcus.shawcroft@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, aarch64] Add prefetch support
Date: Mon, 17 Nov 2014 13:31:00 -0000	[thread overview]
Message-ID: <5469EABD.30703@redhat.com> (raw)
In-Reply-To: <EB4625145972F94C9680D8CADD65161578EB5F87@SATLEXDAG02.amd.com>

On 11/14/2014 09:11 PM, Gopalasubramanian, Ganesh wrote:
> +    const char * pftype[2][10]
> +      = { {"PLDL1STRM", "PLDL3KEEP", "PLDL2KEEP", "PLDL1KEEP"},
> +	  {"PSTL1STRM", "PSTL3KEEP", "PSTL2KEEP", "PSTL1KEEP"},
> +	};

The array should be

  static const char * const pftype[2][4]

I've no idea where you got that "10" from, espectially since...

> +    gcc_assert (IN_RANGE (locality, 0, 3));

... you've constrained it right here.

> +    sprintf (pattern, "prfm\\t%s, %%a0",
> +	     pftype[INTVAL(operands[1])][locality]);

There's no point in the buffer or the sprintf.
The text is short enough to repeat whole pattern in the array:

  static const char * const pftype[2][4] = {
    {
      "prfm\\tPLDL1STRM, %a0",
      ...
    },
    {
      "prfm\\tPSTL1STRM, %a0",
      ...
    }
  };

  ...
  return pftype[INTVAL(operands[1])][INTVAL(operands[2])];


r~

  reply	other threads:[~2014-11-17 12:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  9:00 Gopalasubramanian, Ganesh
2014-11-11 14:48 ` Marcus Shawcroft
2014-11-14 20:45   ` Gopalasubramanian, Ganesh
2014-11-17 13:31     ` Richard Henderson [this message]
2014-12-01  6:13       ` Gopalasubramanian, Ganesh
2014-12-01  7:49       ` Gopalasubramanian, Ganesh
2014-12-02  0:09         ` Richard Henderson
2014-12-03 13:49         ` Marcus Shawcroft
2015-01-11  8:53   ` Andrew Pinski
2015-01-13 14:31     ` Marcus Shawcroft
2015-01-13 14:32       ` Andrew Pinski
2015-01-13 14:58         ` Dr. Philipp Tomsich
  -- strict thread matches above, loose matches on Subject: below --
2014-07-04 10:57 Gopalasubramanian, Ganesh
2014-07-05 20:42 ` Gopalasubramanian, Ganesh
2014-07-09  8:54 ` Richard Earnshaw

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=5469EABD.30703@redhat.com \
    --to=rth@redhat.com \
    --cc=Ganesh.Gopalasubramanian@amd.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcus.shawcroft@gmail.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).