This is the mail archive of the
mailing list for the GCC project.
Re: clear_cache on Alpha architecture not implemented?
- From: Camm Maguire <camm at maguirefamily dot org>
- To: Richard Henderson <rth at redhat dot com>
- 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 09:39:54 -0400
- Subject: Re: clear_cache on Alpha architecture not implemented?
- References: <firstname.lastname@example.org> <20120501154228.GI26837@smp.if.uj.edu.pl> <email@example.com> <20120501205443.GJ26837@smp.if.uj.edu.pl> <firstname.lastname@example.org> <20120502153115.GK26837@smp.if.uj.edu.pl> <email@example.com> <20120502194308.GL26837@smp.if.uj.edu.pl> <firstname.lastname@example.org> <20120503172509.GM26837@smp.if.uj.edu.pl> <email@example.com> <4FA2CFBE.firstname.lastname@example.org>
Greetings, and thanks for this very helpful synopsis.
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?
Richard Henderson <email@example.com> writes:
> On 05/03/2012 10:51 AM, Camm Maguire wrote:
>> The goal was to exercise the very helpful gcc __builtin___clear_cache
>> support, and to avoid having to maintain our own assembler for all the
>> different cpus in this regard. Clearly, it is easy to revert this on a
>> per architecture basis if absolutely necessary. If gcc does or does not
>> plan on fixing this, please let me know so gcl can adjust as needed.
> While we can probably fix this, you should know that __builtin_clear_cache
> is highly tied to the implementation of trampolines for the target. Thus
> there are at least 3 targets that do not handle this "properly":
> For alpha, we emit imb directly during the trampoline_init target hook.
> For powerpc32, the libgcc routine __clear_cache is unimplemented, but the
> cache flushing for trampolines is inside the __trampoline_setup routine.
> For powerpc64 and ia64, the ABI for function calls allows trampolines to
> be implemented without emitting any insns, and thus the icache need not be
> flushed at all. And thus we never bothered implementing __builtin_clear_cache.
> So, the fact of the matter is that you can't reliably use this builtin for
> arbitrary targets for any gcc version up to 4.7. Feel free to submit an
> enhancement request via bugzilla so that we can remember to address this
> for gcc 4.8.
Camm Maguire firstname.lastname@example.org
"The earth is but one country, and mankind its citizens." -- Baha'u'llah