This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add pause intrinsic
On Thu, May 26, 2011 at 06:46:39PM +0200, Jakub Jelinek wrote:
> On Thu, May 26, 2011 at 09:10:32AM -0700, Andi Kleen wrote:
> > Richard Guenther <richard.guenther@gmail.com> writes:
> > As for why having a builtin: one reason would be portability.
>
> You mean portability to other compilers (I think reasonable amount
> of them support gcc-ish inline asm), or to other architectures?
Both.
> __builtin_ia32_pause () doesn't look like a builtin you would
> want to use on PPC.
That's true, it should probably have a different name.
__builtin_pause()?
The Linux kernel calls it cpu_relax() on all architectures.
The following architectures implement it: ia64, powerpc, x86
On others it just acts like a barrier.
I suppose most CPUs that implement SMT will have some equivalent.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.