This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: SH4 ic_cache_invalidate code broken
- To: Alexandre Oliva <aoliva at redhat dot com>, Toshi Morita <tm2 at best dot com>,gcc-patches at gcc dot gnu dot org
- Subject: Re: SH4 ic_cache_invalidate code broken
- From: tm <tm at kloo dot net>
- Date: Sat, 04 Jan 1997 06:01:06 -0800
- References: <200106042011.NAA20055@shell14.ba.best.com> <oru1zyiv50.fsf@guarana.lsd.ic.unicamp.br> <3B6190ED.7ECC9D90@kloo.net>
tm wrote:
>
> Alexandre Oliva wrote:
> >
> > On Jun 4, 2001, Toshi Morita <tm2@best.com> wrote:
> >
> > > I just thought of another failure mode for this code chunk.
> > > It assumes that both ic_invalidate and the target thunk are
> > > in the cacheable area.
> >
> > > If ic_invalidate is in the noncacheable area, then it will NOT
> > > clear any cache lines.
> >
> > > I think, at the very minimum, these assumptions need to be
> > > documented in comments so people will be less likely to trip
> > > over them.
> >
> > Indeed. Will you please post a patch to that effect.
>
> Okay, will try to do sometime this weekend.
A little late, but here it is; unfortunately this emailer can't
insert a file, so it's an attachment.
I think we should also rename ic_invalidate to
ic_invalidate_single_line...
the current name implies the entire instruction cache is invalidated,
which is incorrect. It only invalidates a single line.
Toshi
Mon Jul 30 14:31:37 PDT 2001 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
* config/sh/lib1funcs.asm (ic_invalidate): Clarify operating assumptions
*** lib1funcs.asm.bak Mon Jul 30 13:47:33 2001
--- lib1funcs.asm Mon Jul 30 13:54:15 2001
***************
*** 1212,1217 ****
--- 1212,1221 ----
#endif /* L_set_fpscr */
#ifdef L_ic_invalidate
#if defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
+
+ ! Note: This function does not work if placed in a noncacheable area,
+ ! e.g. in the P2 or P4 areas. It must be in either the P1 or P3 areas.
+
.global GLOBAL(ic_invalidate)
GLOBAL(ic_invalidate):
ocbwb @r4