public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Peppe CAVALLARO <peppe.cavallaro@st.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement
Date: Wed, 17 Nov 2010 08:51:37 +0000	[thread overview]
Message-ID: <4CE39799.8040009@st.com> (raw)
In-Reply-To: <1289976617-27704-1-git-send-email-peppe.cavallaro@st.com>

Hello Paul,

On 11/17/2010 9:17 AM, Paul Mundt wrote:
>
> On Wed, Nov 17, 2010 at 07:50:17AM +0100, Giuseppe CAVALLARO wrote:
> > GCC's __builtin_prefetch() was introduced a long time ago, all
> > supported GCC versions have it. So this patch is to use it for
> > implementing the prefetch on SH2A and SH4.
> >
> > The current  prefetch implementation is almost equivalent with
> > __builtin_prefetch.
> > The third parameter in the __builtin_prefetch is the locality
> > that it's not supported on SH architectures.  It has been set
> > to three and it should be verified if it's suitable for SH2A
> > as well. I didn't test on this architecture.
> >
> Do we actually require the third parameter at all here? If not, the
>
No we don't.
>
> easiest solution is to just kill off the ARCH_HAS_PREFETCH and
> ARCH_HAS_PREFETCHW bits entirely, as this will already fall back on
> __builtin_prefetch() through the generic code. include/linux/prefetch.h
> already does this:
>
> #ifndef ARCH_HAS_PREFETCH
> #define prefetch(x) __builtin_prefetch(x)
> #endif
>
> #ifndef ARCH_HAS_PREFETCHW
> #define prefetchw(x) __builtin_prefetch(x,1)
> #endif
>
I totally agree!
>
> This is probably a reasonable approach in general since we can leave the
> decision up to gcc, and we don't need to navigate SH ISA hell worrying
> about
> figuring out which CPUs support the instruction and which don't.
>
I'm reworking the patch and I send it to you.

Best Regards
Giuseppe

  parent reply	other threads:[~2010-11-17  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  6:50 [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement prefetch() Giuseppe CAVALLARO
2010-11-17  8:17 ` Paul Mundt
2010-11-17  8:51 ` Peppe CAVALLARO [this message]
2010-11-17  9:27 ` [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement prefetch (V2) Giuseppe CAVALLARO
2010-11-17  9:49 ` Paul Mundt
2010-11-17 11:01 ` [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement Peppe CAVALLARO
2010-11-18  6:09 ` [PATCH (sh-2.6)] sh: Use GCC __builtin_prefetch() to implement prefetch (V2) Paul Mundt

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=4CE39799.8040009@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=linux-sh@vger.kernel.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