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: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 11/18] tcg/arm: add bswap ops
Date: Fri, 9 Apr 2010 00:32:04 +0100
User-agent: KMail/1.12.4 (Linux/2.6.33-2-amd64; KDE/4.3.4; x86_64; ; )

> +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

Paul





reply via email to

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