On Fri, 9 Jan 2026, Philippe Mathieu-Daudé wrote:
On 9/1/26 14:48, BALATON Zoltan wrote:
On Fri, 9 Jan 2026, Philippe Mathieu-Daudé wrote:
Rename the API methods using the explicit 'unaligned'
description instead of 'he' which stands for 'host
endianness'.
I still think it would be easier to add a comment somewhere (or in
documentation) that host endian stands for no swap just use what the host
uses (that also explains what be|le will swap relative to) and then not
rename any of these. The le|be variants are also based he so do you rename
those to lduw_le_unaligned_p too? This gets unwieldy. If you want to get
rid of he at any rate then maybe just drop it and make the host endian
variants lduw_p without any endian notation but I see no problem
lduw_p() implicitly uses *guest* endianness... If we remove it first,
then w can have lduw_unaligned_p() become it. Quite some churn rework,
but I'm OK to pay the price if the community is willing to go in this
direction and we eventually get a clearer API.
So then we could just leave it as "he" and document it better what it
means, that seems to be the least churn to me. Adding unaligned only to
the "he" variant does not seem to be improving naming as the others handle
unaligned too so it's still unclear and renaming everyting would both be
too long and too much churn. But if others think this improves it and is
worth to do this rename for these he variants then I won't raise this
again as I've explained my point sufficiently already. If nobody else
cares then it's up to you.
Regards,
BALATON Zoltan
Inspired-by: Paolo Bonzini <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
---
docs/devel/loads-stores.rst | 19 +++++++++----------
include/qemu/bswap.h | 34 +++++++++++++++++-----------------
include/qemu/ldst_unaligned.h | 16 ++++++++--------
accel/tcg/translator.c | 6 +++---
hw/display/ati_2d.c | 2 +-
hw/display/sm501.c | 19 +++++++++++--------
hw/remote/vfio-user-obj.c | 4 ++--
hw/vmapple/virtio-blk.c | 2 +-
net/checksum.c | 6 +++---
system/memory.c | 4 ++--
system/physmem.c | 8 ++++----
ui/vnc-enc-tight.c | 2 +-
util/bufferiszero.c | 6 +++---
accel/tcg/ldst_atomicity.c.inc | 10 +++++-----
14 files changed, 70 insertions(+), 68 deletions(-)