* Tell me why 8 continuos ocbp ins's exist in sh4_flush_purge_region().
@ 2012-06-27 2:52 MASAO TAKAHASHI
2012-06-27 12:34 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: MASAO TAKAHASHI @ 2012-06-27 2:52 UTC (permalink / raw)
To: linux-sh
Hi everybody.
Please tell me why 8 continuos "ocbp" instructions exist
in sh4_flush_purge_region() as follows.
--------------------------------------------------
while (cnt >= 8) {
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
__ocbp(v); v += L1_CACHE_BYTES;
cnt -= 8;
}
-----------------------------------------------------
The previous version was like this.
-------------------------------------------------------
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
asm volatile("ocbp %0"
: /* no output */
: "m" (__m(v)));
}
--------------------------------------------------------
----------------------------------------------
MASAO TAKAHASHI <masao-takahashi@kanno.co.jp>
TEL 093-436-2330
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Tell me why 8 continuos ocbp ins's exist in sh4_flush_purge_region().
2012-06-27 2:52 Tell me why 8 continuos ocbp ins's exist in sh4_flush_purge_region() MASAO TAKAHASHI
@ 2012-06-27 12:34 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2012-06-27 12:34 UTC (permalink / raw)
To: linux-sh
On Wed, Jun 27, 2012 at 11:52:55AM +0900, MASAO TAKAHASHI wrote:
> Hi everybody.
>
> Please tell me why 8 continuos "ocbp" instructions exist
> in sh4_flush_purge_region() as follows.
> --------------------------------------------------
> while (cnt >= 8) {
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> __ocbp(v); v += L1_CACHE_BYTES;
> cnt -= 8;
> }
> -----------------------------------------------------
>
> The previous version was like this.
> -------------------------------------------------------
> for (v = begin; v < end; v+=L1_CACHE_BYTES) {
> asm volatile("ocbp %0"
> : /* no output */
> : "m" (__m(v)));
> }
> --------------------------------------------------------
>
We unroll the loop for better performance. The same applies for the wback
and invalidate cases, too. If you're passing in a small size then the >8 case is surpassed and you go to line-at-a-time obcp as before.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-27 12:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27 2:52 Tell me why 8 continuos ocbp ins's exist in sh4_flush_purge_region() MASAO TAKAHASHI
2012-06-27 12:34 ` Paul Mundt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.