qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/7] tcg/tcg-op: Document bswap32() byte pattern


From: Richard Henderson
Subject: Re: [PATCH 2/7] tcg/tcg-op: Document bswap32() byte pattern
Date: Wed, 23 Aug 2023 08:54:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 8/23/23 06:14, Philippe Mathieu-Daudé wrote:
On 22/8/23 18:00, Richard Henderson wrote:
On 8/22/23 02:37, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  tcg/tcg-op.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)


+/*
+ * bswap32_i64: 32-bit byte swap on the low bits of a 64-bit value.
+ *
+ * Byte pattern:  bswap32_i64(xxxxabcd) -> ....dcba     (TCG_BSWAP_OZ)
+ *                bswap32_i64(xxxxabcd) -> ssssdcba     (TCG_BSWAP_OS)
+ *                bswap32_i64(xxxxabcd) -> xxxxdcba
+ */

Again, TCG_BSWAP_IZ.

Whether TCG_BSWAP_IZ is set or not doesn't change the result, at the
end we have:

   bswap32_i64(xxxxabcd) -> ....dcba     (TCG_BSWAP_OS not set)
   bswap32_i64(xxxxabcd) -> ssssdcba     (TCG_BSWAP_OS set)

It changes the input: not 'x' but '.'.


r~



reply via email to

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