@@ -378,6 +378,42 @@ OSHMEM_DECLSPEC long long pshmem_longlong_fadd(long long *target, long long valu
378378 long long*: pshmem_longlong_fadd)(dst, val, pe)
379379#endif
380380
381+ /* Atomic Fetch&And */
382+ OSHMEM_DECLSPEC int pshmem_int_atomic_fand (int *target, int value, int pe);
383+ OSHMEM_DECLSPEC long pshmem_long_atomic_fand (long *target, long value, int pe);
384+ OSHMEM_DECLSPEC long long pshmem_longlong_atomic_fand (long long *target, long long value, int pe);
385+ #if OSHMEMP_HAVE_C11
386+ #define pshmem_atomic_fand (dst, val, pe ) \
387+ _Generic (&*(dst), \
388+ int*: pshmem_int_atomic_fand, \
389+ long*: pshmem_long_atomic_fand, \
390+ long long*: pshmem_longlong_atomic_fand)(dst, val, pe)
391+ #endif
392+
393+ /* Atomic Fetch&Or */
394+ OSHMEM_DECLSPEC int pshmem_int_atomic_for (int *target, int value, int pe);
395+ OSHMEM_DECLSPEC long pshmem_long_atomic_for (long *target, long value, int pe);
396+ OSHMEM_DECLSPEC long long pshmem_longlong_atomic_for (long long *target, long long value, int pe);
397+ #if OSHMEMP_HAVE_C11
398+ #define pshmem_atomic_for (dst, val, pe ) \
399+ _Generic (&*(dst), \
400+ int*: pshmem_int_atomic_for, \
401+ long*: pshmem_long_atomic_for, \
402+ long long*: pshmem_longlong_atomic_for)(dst, val, pe)
403+ #endif
404+
405+ /* Atomic Fetch&Xor */
406+ OSHMEM_DECLSPEC int pshmem_int_atomic_fxor (int *target, int value, int pe);
407+ OSHMEM_DECLSPEC long pshmem_long_atomic_fxor (long *target, long value, int pe);
408+ OSHMEM_DECLSPEC long long pshmem_longlong_atomic_fxor (long long *target, long long value, int pe);
409+ #if OSHMEMP_HAVE_C11
410+ #define pshmem_atomic_fxor (dst, val, pe ) \
411+ _Generic (&*(dst), \
412+ int*: pshmem_int_atomic_fxor, \
413+ long*: pshmem_long_atomic_fxor, \
414+ long long*: pshmem_longlong_atomic_fxor)(dst, val, pe)
415+ #endif
416+
381417/* Atomic Fetch */
382418OSHMEM_DECLSPEC int pshmem_int_fetch (const int *target, int pe);
383419OSHMEM_DECLSPEC long pshmem_long_fetch (const long *target, int pe);
@@ -406,7 +442,7 @@ OSHMEM_DECLSPEC long long pshmem_longlong_finc(long long *target, int pe);
406442 long long*: pshmem_longlong_finc)(dst, val, pe)
407443#endif
408444
409- /* Atomic Add*/
445+ /* Atomic Add */
410446OSHMEM_DECLSPEC void pshmem_int_add (int *target, int value, int pe);
411447OSHMEM_DECLSPEC void pshmem_long_add (long *target, long value, int pe);
412448OSHMEM_DECLSPEC void pshmem_longlong_add (long long *target, long long value, int pe);
@@ -418,6 +454,42 @@ OSHMEM_DECLSPEC void pshmem_longlong_add(long long *target, long long value, int
418454 long long*: pshmem_longlong_add)(dst, val, pe)
419455#endif
420456
457+ /* Atomic And */
458+ OSHMEM_DECLSPEC void pshmem_int_atomic_and (int *target, int value, int pe);
459+ OSHMEM_DECLSPEC void pshmem_long_atomic_and (long *target, long value, int pe);
460+ OSHMEM_DECLSPEC void pshmem_longlong_atomic_and (long long *target, long long value, int pe);
461+ #if OSHMEMP_HAVE_C11
462+ #define pshmem_atomic_and (dst, val, pe ) \
463+ _Generic (&*(dst), \
464+ int*: pshmem_int_atomic_and, \
465+ long*: pshmem_long_atomic_and, \
466+ long long*: pshmem_longlong_atomic_and)(dst, val, pe)
467+ #endif
468+
469+ /* Atomic Or */
470+ OSHMEM_DECLSPEC void pshmem_int_atomic_or (int *target, int value, int pe);
471+ OSHMEM_DECLSPEC void pshmem_long_atomic_or (long *target, long value, int pe);
472+ OSHMEM_DECLSPEC void pshmem_longlong_atomic_or (long long *target, long long value, int pe);
473+ #if OSHMEMP_HAVE_C11
474+ #define pshmem_atomic_or (dst, val, pe ) \
475+ _Generic (&*(dst), \
476+ int*: pshmem_int_atomic_or, \
477+ long*: pshmem_long_atomic_or, \
478+ long long*: pshmem_longlong_atomic_or)(dst, val, pe)
479+ #endif
480+
481+ /* Atomic Xor */
482+ OSHMEM_DECLSPEC void pshmem_int_atomic_xor (int *target, int value, int pe);
483+ OSHMEM_DECLSPEC void pshmem_long_atomic_xor (long *target, long value, int pe);
484+ OSHMEM_DECLSPEC void pshmem_longlong_atomic_xor (long long *target, long long value, int pe);
485+ #if OSHMEMP_HAVE_C11
486+ #define pshmem_atomic_xor (dst, val, pe ) \
487+ _Generic (&*(dst), \
488+ int*: pshmem_int_atomic_xor, \
489+ long*: pshmem_long_atomic_xor, \
490+ long long*: pshmem_longlong_atomic_xor)(dst, val, pe)
491+ #endif
492+
421493/* Atomic Inc */
422494OSHMEM_DECLSPEC void pshmem_int_inc (int *target, int pe);
423495OSHMEM_DECLSPEC void pshmem_long_inc (long *target, int pe);
0 commit comments