public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: Richard Earnshaw <rearnsha@arm.com>
Cc: Richard Guenther <richard.guenther@gmail.com>,
	 gcc-patches@gcc.gnu.org,  nickc@redhat.com,
	 paul@codesourcery.com,  ramana.radhakrishnan@arm.com
Subject: Re: Add an array_mode_supported_p target hook
Date: Fri, 06 May 2011 10:44:00 -0000	[thread overview]
Message-ID: <g4zkn06rr8.fsf@linaro.org> (raw)
In-Reply-To: <1304677314.5165.10.camel@e102346-lin.cambridge.arm.com> (Richard	Earnshaw's message of "Fri, 06 May 2011 11:21:54 +0100")

Richard Earnshaw <rearnsha@arm.com> writes:
>> +/* Implements target hook array_mode_supported_p.  */
>> +
>> +static bool
>> +arm_array_mode_supported_p (enum machine_mode mode,
>> +			    unsigned HOST_WIDE_INT nelems)
>> +{
>> +  if (TARGET_NEON
>> +      && (VALID_NEON_DREG_MODE (mode) || VALID_NEON_QREG_MODE (mode))
>> +      && (nelems >= 2 && nelems <= 4))
>> +    return true;
>> +
>> +  return false;
>> +}
>
> I'm not sure I understand why this is limited to 4 or fewer elements. A
> Q reg of chars would surely be 16 elements.

The mode here is the mode of the array element, which for the cases
we're interested in would be something like V4HI (D) or V4SI (Q).
nelems says how many of those (in our case, vector) elements there
are in the array.

The element range we want is 1-4 because that matches the number
of vectors that can be loaded by the vld1-vld4 instructions.
We don't include 1 because arrays of one element are already
treated as having the same mode as their element.

Richard

  reply	other threads:[~2011-05-06 10:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 13:43 Richard Sandiford
2011-03-31 13:56 ` Richard Guenther
2011-03-31 14:56   ` Richard Sandiford
2011-04-21 10:43     ` Richard Sandiford
2011-04-21 11:28       ` Richard Guenther
2011-05-06 10:29       ` Richard Earnshaw
2011-05-06 10:44         ` Richard Sandiford [this message]
2011-05-06 10:51           ` 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=g4zkn06rr8.fsf@linaro.org \
    --to=richard.sandiford@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nickc@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=ramana.radhakrishnan@arm.com \
    --cc=rearnsha@arm.com \
    --cc=richard.guenther@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).