This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] 1/3 Add new builtin __builtin_flush_icache().
David Daney wrote:
> Ok, I think I have come around to your way of thinking. I still have
> the new predicate __builtin_clear_cache_inline_p() for use in target
> CLEAR_INSN_CACHE definitions, but I leave __clear_cache unchanged.
I don't understand the need for the inline_p function. It seems to me
there are two scenarios:
1. The back-end has an inline definition of __builtin___clear_cache. In
that case, it does:
#define CLEAR_INSN_CACHE(BEG, END) __builtin___clear_cache(BEG, END);
2. The back-end does not have an inline definition of
__builtin_clear_cache. In that case, it does:
#define CLEAR_INSN_CACHE(BEG, END) \
/* Something not involving __builtin___clear_cache */
In both cases, the libgcc __clear_cache routine just does:
CLEAR_INSN_CACHE (beg, end);
And, in both cases, the user can write either __clear_cache (always an
out-of-line call), or __builtin_clear_cache (may be an out-of-line call,
or may be inline code).
Is your concern that in case (1) the back-end has to do two things:
define the builtin and define CLEAR_INSN_CACHE? That's a little lame,
but it doesn't seem worse than having to define two builtins.
Am I missing some intermediate case?
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713