Skip to content

Commit

Permalink
SunPRO change
Browse files Browse the repository at this point in the history
  • Loading branch information
cstes committed Apr 29, 2020
1 parent 42000ad commit 372e3a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions platforms/Cross/vm/sqAtomicOps.h
Expand Up @@ -106,7 +106,7 @@ AtomicGet(uint64_t *target)
# define set64(variable,value) AtomicSet(&(variable),value)

/* Currently we provide definitions for x86 and GCC only. But see below. */
# elif defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))
# elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))

/* atomic read & write of 64-bit values using SSE2 movq to/from sse register.
* 64-bit reads & writes are only guaranteed to be atomic if aligned on a 64-bit
Expand Down Expand Up @@ -210,6 +210,7 @@ AtomicGet(__int64 *target)
# define set64(variable,value) (variable = value)

#else

/* Dear implementor, you have choices. For example consider defining get64 &
* set64 thusly
* #define get64(var) read64(&(var))
Expand Down Expand Up @@ -251,7 +252,7 @@ AtomicGet(__int64 *target)
error("no interlocked add for this variable size"); \
} while (0)

#elif defined(__GNUC__) || defined(__clang__)
#elif defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_C)
/* N.B. I know you want to use the intrinsics; they're pretty; they're official;
* they're portable. But they only apply to int, long and long long sizes.
* Since we want to use 16-bit variables for signal requests and responses in
Expand Down Expand Up @@ -314,7 +315,7 @@ AtomicGet(__int64 *target)
# define sqCompareAndSwap(var,old,new) \
InterlockedCompareExchange(&(var), new, old)

#elif defined(__GNUC__) || defined(__clang__)
#elif defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_C)
# if GCC_HAS_BUILTIN_SYNC || defined(__clang__)
# define sqCompareAndSwap(var,old,new) \
__sync_bool_compare_and_swap(&(var), old, new)
Expand Down

0 comments on commit 372e3a7

Please sign in to comment.