This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: swap (a, b) - test
- To: egcs at cygnus dot com
- Subject: Re: swap (a, b) - test
- From: Michael Meissner <meissner at cygnus dot com>
- Date: 05 Jan 1998 16:42:08 -0500
- Newsgroups: cygnus.egcs
- Organization: Cygnus Solutions
- References: <19980103181123.28803@sparrow.vgernet.net>
ak@muc.de (Andi Kleen) writes:
> __asm__("xchg %1,%0" ...); might be faster on x86 too.
Only if both operands are in registers. Xchg with a memory operand, sets the
LOCK prefix which can slow down the reference.
--
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com, 617-354-5416 (office), 617-354-7161 (fax)