mbox series

[v3,0/6] qemu/bswap: Use compiler __builtin_bswap()

Message ID 20230111163147.71761-1-philmd@linaro.org
Headers show
Series qemu/bswap: Use compiler __builtin_bswap() | expand

Message

Philippe Mathieu-Daudé Jan. 11, 2023, 4:31 p.m. UTC
Implement Richard's suggestion to use __builtin_bswap().

Convert to __builtin_bswap() one patch per OS to simplify
maintainers review.

Since v2:
- Rebased adapting ./configure changes to meson

Since v1:
- Remove the Haiku/BSD ifdef'ry (Peter)
- Include the Haiku VM image from Alexander

Philippe Mathieu-Daudé (6):
  qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
  qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
  qemu/bswap: Remove <byteswap.h> dependency
  qemu/bswap: Use compiler __builtin_bswap() on Haiku
  qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
  qemu/bswap: Use compiler __builtin_bswap() on NetBSD

 include/qemu/bswap.h | 83 ++++++++------------------------------------
 meson.build          |  6 ----
 2 files changed, 15 insertions(+), 74 deletions(-)

Comments

Richard Henderson Jan. 13, 2023, 1:05 a.m. UTC | #1
On 1/11/23 08:31, Philippe Mathieu-Daudé wrote:
> Implement Richard's suggestion to use __builtin_bswap().
> 
> Convert to __builtin_bswap() one patch per OS to simplify
> maintainers review.
> 
> Since v2:
> - Rebased adapting ./configure changes to meson
> 
> Since v1:
> - Remove the Haiku/BSD ifdef'ry (Peter)
> - Include the Haiku VM image from Alexander
> 
> Philippe Mathieu-Daudé (6):
>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>    qemu/bswap: Remove <byteswap.h> dependency
>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD

If this passes on all the odd OS's, great.
Failure on some oddball is what blocked my patch set years ago.


r~
Philippe Mathieu-Daudé Jan. 13, 2023, 7:05 a.m. UTC | #2
On 13/1/23 02:05, Richard Henderson wrote:
> On 1/11/23 08:31, Philippe Mathieu-Daudé wrote:
>> Implement Richard's suggestion to use __builtin_bswap().
>>
>> Convert to __builtin_bswap() one patch per OS to simplify
>> maintainers review.
>>
>> Since v2:
>> - Rebased adapting ./configure changes to meson
>>
>> Since v1:
>> - Remove the Haiku/BSD ifdef'ry (Peter)
>> - Include the Haiku VM image from Alexander
>>
>> Philippe Mathieu-Daudé (6):
>>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>>    qemu/bswap: Remove <byteswap.h> dependency
>>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD
> 
> If this passes on all the odd OS's, great.
> Failure on some oddball is what blocked my patch set years ago.

OK I'll double-check.
Thomas Huth Jan. 13, 2023, 7:20 a.m. UTC | #3
On 13/01/2023 08.05, Philippe Mathieu-Daudé wrote:
> On 13/1/23 02:05, Richard Henderson wrote:
>> On 1/11/23 08:31, Philippe Mathieu-Daudé wrote:
>>> Implement Richard's suggestion to use __builtin_bswap().
>>>
>>> Convert to __builtin_bswap() one patch per OS to simplify
>>> maintainers review.
>>>
>>> Since v2:
>>> - Rebased adapting ./configure changes to meson
>>>
>>> Since v1:
>>> - Remove the Haiku/BSD ifdef'ry (Peter)
>>> - Include the Haiku VM image from Alexander
>>>
>>> Philippe Mathieu-Daudé (6):
>>>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>>>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>>>    qemu/bswap: Remove <byteswap.h> dependency
>>>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>>>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>>>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD
>>
>> If this passes on all the odd OS's, great.
>> Failure on some oddball is what blocked my patch set years ago.
> 
> OK I'll double-check.

Please note that "make vm-build-haiku.x86_64" is currently broken - we need 
an update to Beta 4 from Alexander first.

  Thomas
Philippe Mathieu-Daudé Jan. 17, 2023, 8:24 a.m. UTC | #4
On 13/1/23 08:05, Philippe Mathieu-Daudé wrote:
> On 13/1/23 02:05, Richard Henderson wrote:
>> On 1/11/23 08:31, Philippe Mathieu-Daudé wrote:
>>> Implement Richard's suggestion to use __builtin_bswap().
>>>
>>> Convert to __builtin_bswap() one patch per OS to simplify
>>> maintainers review.
>>>
>>> Since v2:
>>> - Rebased adapting ./configure changes to meson
>>>
>>> Since v1:
>>> - Remove the Haiku/BSD ifdef'ry (Peter)
>>> - Include the Haiku VM image from Alexander
>>>
>>> Philippe Mathieu-Daudé (6):
>>>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>>>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>>>    qemu/bswap: Remove <byteswap.h> dependency
>>>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>>>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>>>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD
>>
>> If this passes on all the odd OS's, great.
>> Failure on some oddball is what blocked my patch set years ago.
> 
> OK I'll double-check.

Tested successfully on:

- QEMU GitLab CI
- Darwin 22.2
- FreeBSD 12.4
- NetBSD 9.3
- OpenBSD 7.2
- Haiku r1beta4
Richard Henderson Jan. 18, 2023, 2:17 a.m. UTC | #5
On 1/16/23 22:24, Philippe Mathieu-Daudé wrote:
> On 13/1/23 08:05, Philippe Mathieu-Daudé wrote:
>> On 13/1/23 02:05, Richard Henderson wrote:
>>> On 1/11/23 08:31, Philippe Mathieu-Daudé wrote:
>>>> Implement Richard's suggestion to use __builtin_bswap().
>>>>
>>>> Convert to __builtin_bswap() one patch per OS to simplify
>>>> maintainers review.
>>>>
>>>> Since v2:
>>>> - Rebased adapting ./configure changes to meson
>>>>
>>>> Since v1:
>>>> - Remove the Haiku/BSD ifdef'ry (Peter)
>>>> - Include the Haiku VM image from Alexander
>>>>
>>>> Philippe Mathieu-Daudé (6):
>>>>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>>>>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>>>>    qemu/bswap: Remove <byteswap.h> dependency
>>>>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>>>>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>>>>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD
>>>
>>> If this passes on all the odd OS's, great.
>>> Failure on some oddball is what blocked my patch set years ago.
>>
>> OK I'll double-check.
> 
> Tested successfully on:
> 
> - QEMU GitLab CI
> - Darwin 22.2
> - FreeBSD 12.4
> - NetBSD 9.3
> - OpenBSD 7.2
> - Haiku r1beta4

Great.  Just in case I missed an individual patch, series:
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Thomas Huth Jan. 26, 2023, 12:47 p.m. UTC | #6
On 11/01/2023 17.31, Philippe Mathieu-Daudé wrote:
> Implement Richard's suggestion to use __builtin_bswap().
> 
> Convert to __builtin_bswap() one patch per OS to simplify
> maintainers review.
> 
> Since v2:
> - Rebased adapting ./configure changes to meson
> 
> Since v1:
> - Remove the Haiku/BSD ifdef'ry (Peter)
> - Include the Haiku VM image from Alexander
> 
> Philippe Mathieu-Daudé (6):
>    qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
>    qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
>    qemu/bswap: Remove <byteswap.h> dependency
>    qemu/bswap: Use compiler __builtin_bswap() on Haiku
>    qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
>    qemu/bswap: Use compiler __builtin_bswap() on NetBSD
> 
>   include/qemu/bswap.h | 83 ++++++++------------------------------------
>   meson.build          |  6 ----
>   2 files changed, 15 insertions(+), 74 deletions(-)

Since nobody else picked this up yet, I'll take it for my next pull request. 
Queued to my staging branch now:

  https://gitlab.com/thuth/qemu/-/commits/staging

   Thomas