qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync
@ 2022-10-24 23:24 Richard Henderson
  2022-10-24 23:24 ` [PATCH 1/4] include/qemu/osdep: Add qemu_build_assert Richard Henderson
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Richard Henderson @ 2022-10-24 23:24 UTC (permalink / raw)
  To: qemu-devel

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-25 22:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24 23:24 [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync Richard Henderson
2022-10-24 23:24 ` [PATCH 1/4] include/qemu/osdep: Add qemu_build_assert Richard Henderson
2022-10-25 13:15   ` Philippe Mathieu-Daudé
2022-10-24 23:24 ` [PATCH 2/4] include/qemu/atomic: Use qemu_build_assert Richard Henderson
2022-10-25 13:15   ` Philippe Mathieu-Daudé
2022-10-24 23:24 ` [PATCH 3/4] include/qemu/thread: Use qatomic_* functions Richard Henderson
2022-10-25 13:47   ` Claudio Fontana
2022-10-25 22:32     ` Richard Henderson
2022-10-24 23:24 ` [PATCH 4/4] include/qemu/atomic128: Avoid __sync_val_compare_and_swap_16 Richard Henderson
2022-10-25  1:59   ` Richard Henderson
2022-10-25 12:43 ` [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync Paolo Bonzini
2022-10-25 22:33   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).