Basile Starynkevitch <bas...@starynkevitch.net> writes:
>
> Perhaps the doc might explain why is it necessary to have a builtin for
> two independent roles: first, the full compiler memory barrier (which
> probably means to spill all the registers on the stack - definitely a
> task for a compiler); second, to "pause" the processor (which might
> also mean to flush or invalidate some data caches). In particular, I
> would naively imagine that we might have a more generic builtin for the
> compiler memory barrier (which probably could be independent of the
> particular ia32 target), and in that case which can't we just implement
> the pause ia32 builtin as builtin_compiler_barrier(); asm ("pause")?

Because a pause() which can be freely moved around is pretty much
useless. Think about it. And a memory barrier is the standard
way to prevent moving around in relation to other code.

You would always need to combine those too.

-Andi

-- 
a...@linux.intel.com -- Speaking for myself only

Reply via email to