diff options
author | Julian Eisel <julian@blender.org> | 2020-12-04 18:25:49 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-12-04 20:28:46 +0300 |
commit | f5eaf67e34df088a2f0a19c744be7f8a51e7d9be (patch) | |
tree | 2c82010244d73b778cef371af83e0865c7b71251 /intern/atomic/atomic_ops.h | |
parent | 1d2c70d7615c14b380e00ae993e58cc14376dcf7 (diff) |
Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operations
I could use a 16 bit atomic fetch + AND for D9719. The alternative would be to
turn a `short` into a `int` in DNA, which isn't a nice workaround.
Also adds tests for the new functions.
Diffstat (limited to 'intern/atomic/atomic_ops.h')
-rw-r--r-- | intern/atomic/atomic_ops.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h index e6ca7a105ba..ad404c756ce 100644 --- a/intern/atomic/atomic_ops.h +++ b/intern/atomic/atomic_ops.h @@ -87,6 +87,9 @@ ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x); ATOMIC_INLINE int32_t atomic_fetch_and_or_int32(int32_t *p, int32_t x); ATOMIC_INLINE int32_t atomic_fetch_and_and_int32(int32_t *p, int32_t x); +ATOMIC_INLINE int16_t atomic_fetch_and_or_int16(int16_t *p, int16_t b); +ATOMIC_INLINE int16_t atomic_fetch_and_and_int16(int16_t *p, int16_t b); + ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8(uint8_t *p, uint8_t b); ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b); |