qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 0/7] tcg: Document *swap/deposit helpers
Date: Tue, 22 Aug 2023 14:42:04 +0100	[thread overview]
Message-ID: <87zg2jgphi.fsf@linaro.org> (raw)
In-Reply-To: <20230822093712.38922-1-philmd@linaro.org>


Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> While reviewing a recent patch from Richard optimizing
> deposit() [*] I ended looking at the *swap friends, taking
> some notes, which then evolved to proper documentation.
>
> [*]
> https://lore.kernel.org/qemu-devel/20230816145547.477974-3-richard.henderson@linaro.org/

We already have some documentation in tcg.rst:

   * - bswap16_i32/i64 *t0*, *t1*, *flags*

     - | 16 bit byte swap on the low bits of a 32/64 bit input.
       |
       | If *flags* & ``TCG_BSWAP_IZ``, then *t1* is known to be zero-extended from bit 15.
       | If *flags* & ``TCG_BSWAP_OZ``, then *t0* will be zero-extended from bit 15.
       | If *flags* & ``TCG_BSWAP_OS``, then *t0* will be sign-extended from bit 15.
       |
       | If neither ``TCG_BSWAP_OZ`` nor ``TCG_BSWAP_OS`` are set, then the bits of *t0* above bit 15 may contain any value.

   * - bswap32_i64 *t0*, *t1*, *flags*

     - | 32 bit byte swap on a 64-bit value.  The flags are the same as for bswap16,
         except they apply from bit 31 instead of bit 15.

   * - bswap32_i32 *t0*, *t1*, *flags*

       bswap64_i64 *t0*, *t1*, *flags*

     - | 32/64 bit byte swap. The flags are ignored, but still present
         for consistency with the other bswap opcodes.

In an ideal world we could generate kdoc from the source file and
include it in the rest of the tcg docs. I'm not sure if it worth the
churn though? Richard?

https://qemu.readthedocs.io/en/master/devel/tcg-ops.html

>
> Philippe Mathieu-Daudé (7):
>   tcg/tcg-op: Document bswap16() byte pattern
>   tcg/tcg-op: Document bswap32() byte pattern
>   tcg/tcg-op: Document bswap64() byte pattern
>   tcg/tcg-op: Document hswap() byte pattern
>   tcg/tcg-op: Document wswap() byte pattern
>   tcg/tcg-op: Document deposit_z()
>   target/cris: Fix a typo in gen_swapr()
>
>  docs/devel/tcg-ops.rst  | 12 ++++++
>  target/cris/translate.c | 20 +++++----
>  tcg/tcg-op.c            | 96 +++++++++++++++++++++++++++++++----------
>  3 files changed, 96 insertions(+), 32 deletions(-)


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  parent reply	other threads:[~2023-08-22 13:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  9:37 [PATCH 0/7] tcg: Document *swap/deposit helpers Philippe Mathieu-Daudé
2023-08-22  9:37 ` [PATCH 1/7] tcg/tcg-op: Document bswap16() byte pattern Philippe Mathieu-Daudé
2023-08-22 15:58   ` Richard Henderson
2023-08-22 17:22     ` Philippe Mathieu-Daudé
2023-08-22 17:29       ` Richard Henderson
2023-08-22 22:04         ` Philippe Mathieu-Daudé
2023-08-22  9:37 ` [PATCH 2/7] tcg/tcg-op: Document bswap32() " Philippe Mathieu-Daudé
2023-08-22 16:00   ` Richard Henderson
2023-08-23 13:14     ` Philippe Mathieu-Daudé
2023-08-23 15:54       ` Richard Henderson
2023-08-22  9:37 ` [PATCH 3/7] tcg/tcg-op: Document bswap64() " Philippe Mathieu-Daudé
2023-08-22 16:00   ` Richard Henderson
2023-08-22  9:37 ` [PATCH 4/7] tcg/tcg-op: Document hswap() " Philippe Mathieu-Daudé
2023-08-22 16:02   ` Richard Henderson
2023-08-22 16:04   ` Richard Henderson
2023-08-22  9:37 ` [PATCH 5/7] tcg/tcg-op: Document wswap() " Philippe Mathieu-Daudé
2023-08-22 16:03   ` Richard Henderson
2023-08-22  9:37 ` [PATCH 6/7] tcg/tcg-op: Document deposit_z() Philippe Mathieu-Daudé
2023-08-22 16:05   ` Richard Henderson
2023-08-22  9:37 ` [PATCH 7/7] target/cris: Fix a typo in gen_swapr() Philippe Mathieu-Daudé
2023-08-22 13:42 ` Alex Bennée [this message]
2023-08-22 13:58   ` [PATCH 0/7] tcg: Document *swap/deposit helpers Peter Maydell
2023-08-22 14:43   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg2jgphi.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).