qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 0/4] qemu/bswap: Let cpu_to_endian() functions handle constant ex


From: Philippe Mathieu-Daudé
Subject: [PATCH 0/4] qemu/bswap: Let cpu_to_endian() functions handle constant expressions
Date: Thu, 17 Sep 2020 18:31:02 +0200

Stefan Hajnoczi suggested we can use __builtin_constant_p()
in the cpu_to_ENDIAN()/ENDIAN_to_cpu() functions to check if
expression is constant, and if so use the const_ENDIAN() macros.

This series modifies cpu_to_ENDIAN() to use const_ENDIAN() when
possible.

Philippe Mathieu-Daudé (4):
  qemu/bswap: Move const_le() definitions around
  qemu/bswap: add const_be16() and const_be32()
  qemu/bswap: Add const_le64() and const_be64()
  qemu/bswap: Let cpu_to_endian() functions handle constant expressions

 include/qemu/bswap.h | 75 +++++++++++++++++++++++++++++++-------------
 1 file changed, 54 insertions(+), 21 deletions(-)

-- 
2.26.2




reply via email to

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