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().
FWIW, I like this. I can't approve it, but since I've read it, here's a
few nitpicky comments.
David Daney <ddaney@avtrex.com> writes:
> +/* Expand a call to __builtin___clear_cache. */
> +
> +static rtx
> +expand_builtin___clear_cache (tree exp ATTRIBUTE_UNUSED)
> +{
> +#ifndef HAVE_clear_cache
> +#ifdef CLEAR_INSN_CACHE
> + /* There is no "clear_cache" insn, and __clear_cache() in libgcc
> + does something. Just do the default expansion to a call to __clear_cache(). */
line > 80 characters
> + return NULL_RTX;
> +#else
> + /* There is no "clear_cache" insn, and __clear_cache() in libgcc
> + does nothing. There is no need to call it. Do nothing. */
> + return const0_rtx;
> +#endif /* CLEAR_INSN_CACHE */
> +#else
> + /* We have a "clear_cache" insn, and it will handle everything. */
"/* We"
> +@deftypefn {Built-in Function} void __builtin___clear_cache (char *@var{begin}, char *@var{end})
> +This functions is used to flush the processor's instruction cache for
"This function"
> +the region of memory between @var{begin} and @var{end}. Some
It might be worth saying that BEGIN is inclusive and END is exclusive.
You also need to add a "clear_cache" entry to the "Standard Names"
section of md.texi. The reason I noticed this is that the entry
should say that, if clear_cache is defined, HAVE_clear_cache can
only be false for targets that don't need a flush.
Richard