This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] 4/3 i386 target support for __builtin___clear_cache()


David Daney <ddaney@avtrex.com> writes:

> This patch adds support for __builtin___clear_cache() to the i386 (and
> x86_64) target.
> 
> There is not much to see here.  All I do is define the
> TARGET_BUILTIN_CLEAR_CACHE_INLINE_P target hook to always return
> false.  This causes __builtin___clear_cache() to be a nop for this
> target.
> 
> Tested with bootstrap and make -k check with no regressions on
> x86_64-unknown-linux-gnu.
> 
> OK to commit if the target independent portion of the patch is approved?

Newer x86 actually has a clear cache instruction (CLFLUSH) and it sometimes
improves performance to use it over explicit snooping
(and in a few cases it can also work around bugs with self modifying code) 

It would seem confusing to have that builtin and not let it generate 
CLFLUSH when SSE is enabled.

-Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]