diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-11-25 14:37:32 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2020-11-25 14:43:43 +0300 |
commit | 4a179e8e3e0fe39b76baa3cba753491a8083de51 (patch) | |
tree | 5b9c25936244af1f3c1d80a536c7455c4288a1e9 /intern/atomic/atomic_ops.h | |
parent | 432388612336bd7b40d4c65ea06f676c0bbb78dc (diff) |
Atomics: Fix missing 64bit implementation for 32bit platforms
Blender uses 64bit atomics to manipulate SessionUUID, and these atomics
were not defined on any of 32bit platforms.
While official support is limited to 64bit platforms only, the code
should not make assumptions about bitness or endianess, in terms that
there should be codepaths and fallback (or provision of them) for 32bit
platforms.
This change makes 64bit atomic functions defined for all platforms.
The atomic_test was compiled and successfully tested on i686 and armv7l
platforms. The rest of compilation process of Blender will be very
tedious, so that was not done.
This change is essential, but not necessarily enough to make Blender
compilable on i686 (ability to compile Blender on 32bit platforms was
lost during the 2.91 development).
This is a functional part of original fix done by Brecht in D9577.
Diffstat (limited to 'intern/atomic/atomic_ops.h')
-rw-r--r-- | intern/atomic/atomic_ops.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h index 91c6ab9fec5..e6ca7a105ba 100644 --- a/intern/atomic/atomic_ops.h +++ b/intern/atomic/atomic_ops.h @@ -59,7 +59,6 @@ /******************************************************************************/ /* Function prototypes. */ -#if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64(uint64_t *p, uint64_t x); @@ -71,7 +70,6 @@ ATOMIC_INLINE int64_t atomic_sub_and_fetch_int64(int64_t *p, int64_t x); ATOMIC_INLINE int64_t atomic_fetch_and_add_int64(int64_t *p, int64_t x); ATOMIC_INLINE int64_t atomic_fetch_and_sub_int64(int64_t *p, int64_t x); ATOMIC_INLINE int64_t atomic_cas_int64(int64_t *v, int64_t old, int64_t _new); -#endif ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32(uint32_t *p, uint32_t x); |