diff options
author | Julian Eisel <julian@blender.org> | 2020-12-04 18:25:49 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-12-04 18:57:32 +0300 |
commit | 67b48290853a9d7e8f92764a6a3938c3a804c294 (patch) | |
tree | 2e2a855feec81f1528739ffebc5705093452dbc1 /intern/atomic/atomic_ops.h | |
parent | d07009498ac36d067fbccd61cfbcd51d4e2ba310 (diff) |
Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operationstemp-atomics-int16
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); |