This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: clear_cache on Alpha architecture not implemented?
- From: Richard Henderson <rth at redhat dot com>
- To: Camm Maguire <camm at maguirefamily dot org>
- Cc: Witold Baryluk <baryluk at smp dot if dot uj dot edu dot pl>, gcc at gcc dot gnu dot org, linux-alpha at vger dot kernel dot org, debian-alpha at lists dot debian dot org, gcl-devel at gnu dot org
- Date: Fri, 04 May 2012 10:39:29 -0700
- Subject: Re: clear_cache on Alpha architecture not implemented?
- References: <87y5pct1hv.fsf@maguirefamily.org> <20120501154228.GI26837@smp.if.uj.edu.pl> <87397jiur8.fsf@maguirefamily.org> <20120501205443.GJ26837@smp.if.uj.edu.pl> <87txzy7n8g.fsf@maguirefamily.org> <20120502153115.GK26837@smp.if.uj.edu.pl> <87havyiftj.fsf@maguirefamily.org> <20120502194308.GL26837@smp.if.uj.edu.pl> <87pqalz9k6.fsf@maguirefamily.org> <20120503172509.GM26837@smp.if.uj.edu.pl> <87ehr1noec.fsf@maguirefamily.org> <4FA2CFBE.1050102@redhat.com> <87zk9ohxp1.fsf@maguirefamily.org>
On 05/04/12 06:39, Camm Maguire wrote:
> I'm wondering if there is a simple configure time test to detect when
> this has been fixed. If I just aborted using __builtin___clear_cache if
> it is in fact a noop on alpha, ppc, ppc64, and ia64, would this suffice?
I can't think of any simple, portable test.
The only reliable test would be to actually attempt to flush a cache,
with some detectable way to see this didn't happen. This tends to get
highly target specific quickly...
A pattern that would at least apply to 32-bit insn word risc might be
int test_routine[2] = {
"mov 1, v0"
"ret"
};
#define call_test ((int (*)(void))test_routine)
int main()
{
call_test(); // make sure the routine is in icache
test_routine[0] = "mov 0, v0";
__builtin__clear_cache(test_routine, test_routine+2);
return call_test();
}
for target-dependent values of those instructions.
r~