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.

keeping he and save the curn. Probably you only want to get rid of target endian or native endian and could leave the rest?

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(-)


Reply via email to