Re: [PATCH] x86: Extend test_and_set_bit() test_and_clean_bit() to 64 bits in X86_64

From: Sheng Yang
Date: Wed May 13 2009 - 23:44:30 EST


On Wednesday 13 May 2009 16:38:29 Andi Kleen wrote:
> Sheng Yang <sheng@xxxxxxxxxxxxxxx> writes:
> > -static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
> > +static inline int test_and_set_bit(long int nr, volatile unsigned long
> > *addr) {
> > int oldbit;
> >
> > - asm volatile(LOCK_PREFIX "bts %2,%1\n\t"
> > + asm volatile(LOCK_PREFIX REX_X86 "bts %2,%1\n\t"
>
> Use btsq on 64bit, then you don't need the explicit rex prefix.

Hi Andi

Well, I just think lots of "#ifdef/#else" is a little annoying here, then use
REX...

--
regards
Yang, Sheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/