From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 00/12] tcg: Factor hrev{32,64}_{i32,i64,tl} out
Date: Tue, 22 Aug 2023 08:37:21 -0700 [thread overview]
Message-ID: <6b2a9e7c-0a79-4a05-fdbd-0a6d4e23d454@linaro.org> (raw)
In-Reply-To: <20230822124042.54739-1-philmd@linaro.org>
On 8/22/23 05:40, Philippe Mathieu-Daudé wrote:
> This series factor the "byteswap each halfword within a
> 32/64-bit value" code duplication as generic helpers.
>
> Modulo the documentation added, there is a good negative
> diff-stat, so I believe this is a win from a maintainance
> point of view.
>
> I used "hrev" to follow the other bswap/hswap/rev helpers
> but it isn't very descriptive, so any better name suggestion
> is welcomed.
> (In particular because there are other patterns I'd like to
> factor out and then naming is getting worse, such 'wrev').'
I applaud the code factor, but the names are poor.
The "h" does not match the size of the elements being swapped, which is "b". The "32"
is... what, the total count of bits modified?
Naming is hard, and I'm not sure what's best.
We have bswap32_i32, bswap32_i64, bswap64_i64.
Perhaps bswap16x2_i32, bswap16x4_i64, bswap16xN_tl, to indicate that we're bswaping 16-bit
quantities, and "xN" to indicate that multiple 16-bit quantities are being swapped.
From your subjects, it would appear we don't need bswap16x2_i64, with the upper 32-bits
zero/signed/undefined. But if we did, we should provide a flags argument of TCG_BSWAP_*.
That then extends to hswap32x2_i64 to swap halfwords within multiple words for mips DSHW
et al.
r~
next prev parent reply other threads:[~2023-08-22 15:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 12:40 [PATCH 00/12] tcg: Factor hrev{32,64}_{i32,i64,tl} out Philippe Mathieu-Daudé
2023-08-22 12:40 ` [PATCH 01/12] tcg/tcg-op: Factor tcg_gen_hrev32_i32() out Philippe Mathieu-Daudé
2023-08-22 12:40 ` [PATCH 02/12] target/arm: Use generic hrev32_i32() in ARM REV16 and VREV16 opcodes Philippe Mathieu-Daudé
2023-08-22 12:40 ` [PATCH 03/12] target/cris: Use generic hrev32_i32() in SWAPB opcode Philippe Mathieu-Daudé
2023-08-22 13:27 ` Philippe Mathieu-Daudé
2023-08-22 12:40 ` [PATCH 04/12] target/rx: Use generic hrev32_i32() in REVW opcode Philippe Mathieu-Daudé
2023-08-22 12:40 ` [PATCH 05/12] tcg/tcg-op: Factor tcg_gen_hrev64_i64() out Philippe Mathieu-Daudé
2023-08-22 12:46 ` [PATCH 10/12] target/arm: Use generic hrev_i64() in Aarch64 REV16 opcode Philippe Mathieu-Daudé
2023-08-22 12:47 ` [PATCH 09/12] tcg/tcg-op: Add tcg_gen_hrev32_i64() and tcg_gen_hrev_i64() Philippe Mathieu-Daudé
2023-08-22 12:51 ` [PATCH 08/12] target/loongarch: Use generic hrev64_i64() in REVB.4H opcode Philippe Mathieu-Daudé
2023-08-22 13:28 ` Philippe Mathieu-Daudé
2023-08-22 14:02 ` Philippe Mathieu-Daudé
2023-08-22 12:52 ` [PATCH 11/12] target/loongarch: Use generic hrev64_i32() in REVB.2H opcode Philippe Mathieu-Daudé
2023-08-22 13:30 ` Philippe Mathieu-Daudé
2023-08-22 16:11 ` Philippe Mathieu-Daudé
2023-08-22 17:04 ` Richard Henderson
2023-08-22 12:53 ` [PATCH 07/12] target/ppc: Use generic hrev64_i64() in BRH / BSWAP16x8 opcodes Philippe Mathieu-Daudé
2023-08-22 19:35 ` Daniel Henrique Barboza
2023-08-25 7:38 ` Nicholas Piggin
2023-08-22 12:57 ` [PATCH 06/12] target/mips: Use generic hrev64_i64() in DSBH opcode Philippe Mathieu-Daudé
2023-08-22 12:57 ` [PATCH 12/12] target/mips: Use generic hrev32_tl() in WSBH opcode Philippe Mathieu-Daudé
2023-08-22 15:42 ` Richard Henderson
2023-08-22 16:59 ` Philippe Mathieu-Daudé
2023-08-22 15:37 ` Richard Henderson [this message]
2023-08-25 7:58 ` [PATCH 00/12] tcg: Factor hrev{32,64}_{i32,i64,tl} out Nicholas Piggin
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=6b2a9e7c-0a79-4a05-fdbd-0a6d4e23d454@linaro.org \
--to=richard.henderson@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.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).