qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 11/18] tcg/arm: add bswap ops


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 11/18] tcg/arm: add bswap ops
Date: Fri, 9 Apr 2010 19:11:32 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Apr 09, 2010 at 12:32:04AM +0100, Paul Brook wrote:
> > +static inline void tcg_out_bswap32(TCGContext *s, int cond, int rd, int rn)
> > +#else
> > +    /* This code only uses one temporary register. There is probably
> > +       a faster way to do that with more temporary registers. */
> 
> You can do better even without a temporary:
> 
>   eor r8, rn, rn, ror #16
>   bic r8, r8, #0x00ff0000
>   mov  rd, rn, ror #8
>   eor rd, rd, r8, lsr #8
> 

That's indeed much better, though it's still use one temporary (r8).
I'll use that in the next version. Thanks.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]