[PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync

Richard Henderson posted 4 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221024232435.3334600-1-richard.henderson@linaro.org
include/qemu/atomic.h    | 16 ++++++++--------
include/qemu/atomic128.h |  8 +-------
include/qemu/osdep.h     |  8 ++++++++
include/qemu/thread.h    |  8 ++++----
meson.build              |  3 ++-
5 files changed, 23 insertions(+), 20 deletions(-)
[PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync
Posted by Richard Henderson 1 year, 6 months ago
The current use of _Static_assert, via QEMU_BUILD_BUG_ON, requires
the user have #if conditionals to avoid the statement from appearing
in the preprocessed file at all.  Introduce a new primitive that
allows normal C conditionals and dead-code elimination.

Remove all use of __sync* builtins in favor of __atomic*.
We have required them since 47345e71247, last year, and
should have removed these at that point.  My bad.


r~


Richard Henderson (4):
  include/qemu/osdep: Add qemu_build_assert
  include/qemu/atomic: Use qemu_build_assert
  include/qemu/thread: Use qatomic_* functions
  include/qemu/atomic128: Avoid __sync_val_compare_and_swap_16

 include/qemu/atomic.h    | 16 ++++++++--------
 include/qemu/atomic128.h |  8 +-------
 include/qemu/osdep.h     |  8 ++++++++
 include/qemu/thread.h    |  8 ++++----
 meson.build              |  3 ++-
 5 files changed, 23 insertions(+), 20 deletions(-)

-- 
2.34.1
Re: [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync
Posted by Paolo Bonzini 1 year, 6 months ago
On 10/25/22 01:24, Richard Henderson wrote:
> The current use of _Static_assert, via QEMU_BUILD_BUG_ON, requires
> the user have #if conditionals to avoid the statement from appearing
> in the preprocessed file at all.  Introduce a new primitive that
> allows normal C conditionals and dead-code elimination.
> 
> Remove all use of __sync* builtins in favor of __atomic*.
> We have required them since 47345e71247, last year, and
> should have removed these at that point.  My bad.
> 
> 
> r~
> 
> 
> Richard Henderson (4):
>    include/qemu/osdep: Add qemu_build_assert
>    include/qemu/atomic: Use qemu_build_assert
>    include/qemu/thread: Use qatomic_* functions
>    include/qemu/atomic128: Avoid __sync_val_compare_and_swap_16
> 
>   include/qemu/atomic.h    | 16 ++++++++--------
>   include/qemu/atomic128.h |  8 +-------
>   include/qemu/osdep.h     |  8 ++++++++
>   include/qemu/thread.h    |  8 ++++----
>   meson.build              |  3 ++-
>   5 files changed, 23 insertions(+), 20 deletions(-)
> 

For patches 1-3,

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Re: [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync
Posted by Richard Henderson 1 year, 6 months ago
On 10/25/22 22:43, Paolo Bonzini wrote:
> On 10/25/22 01:24, Richard Henderson wrote:
>> The current use of _Static_assert, via QEMU_BUILD_BUG_ON, requires
>> the user have #if conditionals to avoid the statement from appearing
>> in the preprocessed file at all.  Introduce a new primitive that
>> allows normal C conditionals and dead-code elimination.
>>
>> Remove all use of __sync* builtins in favor of __atomic*.
>> We have required them since 47345e71247, last year, and
>> should have removed these at that point.  My bad.
>>
>>
>> r~
>>
>>
>> Richard Henderson (4):
>>    include/qemu/osdep: Add qemu_build_assert
>>    include/qemu/atomic: Use qemu_build_assert
>>    include/qemu/thread: Use qatomic_* functions
>>    include/qemu/atomic128: Avoid __sync_val_compare_and_swap_16
>>
>>   include/qemu/atomic.h    | 16 ++++++++--------
>>   include/qemu/atomic128.h |  8 +-------
>>   include/qemu/osdep.h     |  8 ++++++++
>>   include/qemu/thread.h    |  8 ++++----
>>   meson.build              |  3 ++-
>>   5 files changed, 23 insertions(+), 20 deletions(-)
>>
> 
> For patches 1-3,
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Queuing patches 1-3 to tcg-next.


r~