0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-21 16:07:03 +00:00

[NFC][libclc] Merge atomic extension built-ins with identical name into a single file ()

llvm-diff shows there is no change to amdgcn--amdhsa.bc.

Similar to how cl_khr_fp64 and cl_khr_fp16 implementations are put in a
same file for math built-ins, this PR do the same to atom_* built-ins.

The main motivation is to prevent that two files with same base name
implementats different built-ins. In a follow-up PR, I'd like to relax
libclc_configure_lib_source to only compare filename instead of path for
overriding, since in our downstream the same category of built-ins, e.g.
math, are organized in several different folders.
This commit is contained in:
Wenju He 2025-04-14 09:27:48 +00:00 committed by GitHub
parent dffef041d5
commit cbda72a547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
93 changed files with 760 additions and 993 deletions

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_FUNCTION atom_add
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_FUNCTION atom_add
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define __CLC_FUNCTION atom_add
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_FUNCTION atom_and
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_FUNCTION atom_and
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define __CLC_FUNCTION atom_and
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,39 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clcfunc.h>
#include <clc/clctypes.h>
#ifdef cl_khr_global_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp,
int val);
_CLC_OVERLOAD _CLC_DECL unsigned int
atom_cmpxchg(volatile global unsigned int *p, unsigned int cmp,
unsigned int val);
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile local int *p, int cmp,
int val);
_CLC_OVERLOAD _CLC_DECL unsigned int
atom_cmpxchg(volatile local unsigned int *p, unsigned int cmp,
unsigned int val);
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile global long *p, long cmp,
long val);
_CLC_OVERLOAD _CLC_DECL unsigned long
atom_cmpxchg(volatile global unsigned long *p, unsigned long cmp,
unsigned long val);
_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile local long *p, long cmp,
long val);
_CLC_OVERLOAD _CLC_DECL unsigned long
atom_cmpxchg(volatile local unsigned long *p, unsigned long cmp,
unsigned long val);
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,28 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clcfunc.h>
#include <clc/clctypes.h>
#ifdef cl_khr_global_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile global unsigned int *p);
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile local unsigned int *p);
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
_CLC_OVERLOAD _CLC_DECL long atom_dec(volatile global long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long
atom_dec(volatile global unsigned long *p);
_CLC_OVERLOAD _CLC_DECL long atom_dec(volatile local long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_dec(volatile local unsigned long *p);
#endif // cl_khr_int64_base_atomics

@ -6,8 +6,11 @@
//
//===----------------------------------------------------------------------===//
#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
#include <clc/clcfunc.h>
#include <clc/clctypes.h>
#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE);
__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int)
__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint)

@ -6,8 +6,11 @@
//
//===----------------------------------------------------------------------===//
#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
#include <clc/clcfunc.h>
#include <clc/clctypes.h>
#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE);
__CLC_DECLARE_ATOM(local, long)
__CLC_DECLARE_ATOM(local, ulong)

@ -0,0 +1,28 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clcfunc.h>
#include <clc/clctypes.h>
#ifdef cl_khr_global_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile global unsigned int *p);
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile local unsigned int *p);
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
_CLC_OVERLOAD _CLC_DECL long atom_inc(volatile global long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long
atom_inc(volatile global unsigned long *p);
_CLC_OVERLOAD _CLC_DECL long atom_inc(volatile local long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_inc(volatile local unsigned long *p);
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_FUNCTION atom_max
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_FUNCTION atom_max
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define __CLC_FUNCTION atom_max
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_FUNCTION atom_min
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_FUNCTION atom_min
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define __CLC_FUNCTION atom_min
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_FUNCTION atom_or
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_FUNCTION atom_or
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define __CLC_FUNCTION atom_or
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_FUNCTION atom_sub
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_FUNCTION atom_sub
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define __CLC_FUNCTION atom_sub
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_FUNCTION atom_xchg
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_FUNCTION atom_xchg
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define __CLC_FUNCTION atom_xchg
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_FUNCTION atom_xor
#define __CLC_ADDRESS_SPACE global
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_FUNCTION atom_xor
#define __CLC_ADDRESS_SPACE local
#include <clc/atomic/atom_decl_int32.inc>
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define __CLC_FUNCTION atom_xor
#include <clc/atomic/atom_decl_int64.inc>
#endif // cl_khr_int64_extended_atomics

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_add
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(volatile global unsigned int *p, unsigned int cmp, unsigned int val);

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile global unsigned int *p);

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile global int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile global unsigned int *p);

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_sub
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xchg
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_and
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_max
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_min
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_or
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xor
#define __CLC_ADDRESS_SPACE global
#include <clc/atom_decl_int32.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_add
#include <clc/atom_decl_int64.inc>

@ -1,12 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile global long *p, long cmp, long val);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_cmpxchg(volatile global unsigned long *p, unsigned long cmp, unsigned long val);
_CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile local long *p, long cmp, long val);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_cmpxchg(volatile local unsigned long *p, unsigned long cmp, unsigned long val);

@ -1,12 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL long atom_dec(volatile global long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_dec(volatile global unsigned long *p);
_CLC_OVERLOAD _CLC_DECL long atom_dec(volatile local long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_dec(volatile local unsigned long *p);

@ -1,12 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL long atom_inc(volatile global long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_inc(volatile global unsigned long *p);
_CLC_OVERLOAD _CLC_DECL long atom_inc(volatile local long *p);
_CLC_OVERLOAD _CLC_DECL unsigned long atom_inc(volatile local unsigned long *p);

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_sub
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xchg
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_and
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_max
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_min
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_or
#include <clc/atom_decl_int64.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xor
#include <clc/atom_decl_int64.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_add
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile local int *p, int cmp, int val);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(volatile local unsigned int *p, unsigned int cmp, unsigned int val);

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile local unsigned int *p);

@ -1,10 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile local int *p);
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile local unsigned int *p);

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_sub
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xchg
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_and
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_max
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_min
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_or
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_FUNCTION atom_xor
#define __CLC_ADDRESS_SPACE local
#include <clc/atom_decl_int32.inc>

@ -239,54 +239,22 @@
#include <clc/atomic/atomic_xchg.h>
#include <clc/atomic/atomic_xor.h>
/* cl_khr_global_int32_base_atomics Extension Functions */
#include <clc/cl_khr_global_int32_base_atomics/atom_add.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_dec.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_inc.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_sub.h>
#include <clc/cl_khr_global_int32_base_atomics/atom_xchg.h>
/* cl_khr_global_int32_base_atomics, cl_khr_local_int32_base_atomics and
* cl_khr_int64_base_atomics Extension Functions */
#include <clc/atomic/atom_add.h>
#include <clc/atomic/atom_cmpxchg.h>
#include <clc/atomic/atom_dec.h>
#include <clc/atomic/atom_inc.h>
#include <clc/atomic/atom_sub.h>
#include <clc/atomic/atom_xchg.h>
/* cl_khr_global_int32_extended_atomics Extension Functions */
#include <clc/cl_khr_global_int32_extended_atomics/atom_and.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_max.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_min.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_or.h>
#include <clc/cl_khr_global_int32_extended_atomics/atom_xor.h>
/* cl_khr_local_int32_base_atomics Extension Functions */
#include <clc/cl_khr_local_int32_base_atomics/atom_add.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_dec.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_inc.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_sub.h>
#include <clc/cl_khr_local_int32_base_atomics/atom_xchg.h>
/* cl_khr_local_int32_extended_atomics Extension Functions */
#include <clc/cl_khr_local_int32_extended_atomics/atom_and.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_max.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_min.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_or.h>
#include <clc/cl_khr_local_int32_extended_atomics/atom_xor.h>
/* cl_khr_int64_base_atomics Extension Functions */
#ifdef cl_khr_int64_base_atomics
#include <clc/cl_khr_int64_base_atomics/atom_add.h>
#include <clc/cl_khr_int64_base_atomics/atom_cmpxchg.h>
#include <clc/cl_khr_int64_base_atomics/atom_dec.h>
#include <clc/cl_khr_int64_base_atomics/atom_inc.h>
#include <clc/cl_khr_int64_base_atomics/atom_sub.h>
#include <clc/cl_khr_int64_base_atomics/atom_xchg.h>
#endif
/* cl_khr_int64_extended_atomics Extension Functions */
#ifdef cl_khr_int64_base_atomics
#include <clc/cl_khr_int64_extended_atomics/atom_and.h>
#include <clc/cl_khr_int64_extended_atomics/atom_max.h>
#include <clc/cl_khr_int64_extended_atomics/atom_min.h>
#include <clc/cl_khr_int64_extended_atomics/atom_or.h>
#include <clc/cl_khr_int64_extended_atomics/atom_xor.h>
#endif
/* cl_khr_global_int32_extended_atomics, cl_khr_local_int32_extended_atomics and
* cl_khr_int64_extended_atomics Extension Functions */
#include <clc/atomic/atom_and.h>
#include <clc/atomic/atom_max.h>
#include <clc/atomic/atom_min.h>
#include <clc/atomic/atom_or.h>
#include <clc/atomic/atom_xor.h>
/* 6.12.12 Miscellaneous Vector Functions */
#include <clc/misc/shuffle.h>

@ -4,6 +4,17 @@ async/async_work_group_copy.cl
async/async_work_group_strided_copy.cl
async/prefetch.cl
async/wait_group_events.cl
atomic/atom_add.cl
atomic/atom_and.cl
atomic/atom_cmpxchg.cl
atomic/atom_dec.cl
atomic/atom_inc.cl
atomic/atom_max.cl
atomic/atom_min.cl
atomic/atom_or.cl
atomic/atom_sub.cl
atomic/atom_xchg.cl
atomic/atom_xor.cl
atomic/atomic_add.cl
atomic/atomic_and.cl
atomic/atomic_cmpxchg.cl
@ -13,41 +24,8 @@ atomic/atomic_max.cl
atomic/atomic_min.cl
atomic/atomic_or.cl
atomic/atomic_sub.cl
atomic/atomic_xor.cl
atomic/atomic_xchg.cl
cl_khr_global_int32_base_atomics/atom_add.cl
cl_khr_global_int32_base_atomics/atom_cmpxchg.cl
cl_khr_global_int32_base_atomics/atom_dec.cl
cl_khr_global_int32_base_atomics/atom_inc.cl
cl_khr_global_int32_base_atomics/atom_sub.cl
cl_khr_global_int32_base_atomics/atom_xchg.cl
cl_khr_global_int32_extended_atomics/atom_and.cl
cl_khr_global_int32_extended_atomics/atom_max.cl
cl_khr_global_int32_extended_atomics/atom_min.cl
cl_khr_global_int32_extended_atomics/atom_or.cl
cl_khr_global_int32_extended_atomics/atom_xor.cl
cl_khr_local_int32_base_atomics/atom_add.cl
cl_khr_local_int32_base_atomics/atom_cmpxchg.cl
cl_khr_local_int32_base_atomics/atom_dec.cl
cl_khr_local_int32_base_atomics/atom_inc.cl
cl_khr_local_int32_base_atomics/atom_sub.cl
cl_khr_local_int32_base_atomics/atom_xchg.cl
cl_khr_local_int32_extended_atomics/atom_and.cl
cl_khr_local_int32_extended_atomics/atom_max.cl
cl_khr_local_int32_extended_atomics/atom_min.cl
cl_khr_local_int32_extended_atomics/atom_or.cl
cl_khr_local_int32_extended_atomics/atom_xor.cl
cl_khr_int64_base_atomics/atom_add.cl
cl_khr_int64_base_atomics/atom_cmpxchg.cl
cl_khr_int64_base_atomics/atom_dec.cl
cl_khr_int64_base_atomics/atom_inc.cl
cl_khr_int64_base_atomics/atom_sub.cl
cl_khr_int64_base_atomics/atom_xchg.cl
cl_khr_int64_extended_atomics/atom_and.cl
cl_khr_int64_extended_atomics/atom_max.cl
cl_khr_int64_extended_atomics/atom_min.cl
cl_khr_int64_extended_atomics/atom_or.cl
cl_khr_int64_extended_atomics/atom_xor.cl
atomic/atomic_xor.cl
common/degrees.cl
common/mix.cl
common/radians.cl

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_add.h>
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_ATOMIC_OP add
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_ATOMIC_OP add
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_add(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_add_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_and.h>
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_ATOMIC_OP and
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_ATOMIC_OP and
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_and(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_and_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,43 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_cmpxchg.h>
#include <clc/atomic/atomic_cmpxchg.h>
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp, \
TYPE val) { \
return atomic_cmpxchg(p, cmp, val); \
}
#ifdef cl_khr_global_int32_base_atomics
IMPL(global, int)
IMPL(global, unsigned int)
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
IMPL(local, int)
IMPL(local, unsigned int)
#endif // cl_khr_local_int32_base_atomics
#undef IMPL
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp, \
TYPE val) { \
return __sync_val_compare_and_swap_8(p, cmp, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,42 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_dec.h>
#include <clc/atomic/atom_sub.h>
#include <clc/atomic/atomic_dec.h>
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) { \
return atomic_dec(p); \
}
#ifdef cl_khr_global_int32_base_atomics
IMPL(global, int)
IMPL(global, unsigned int)
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
IMPL(local, int)
IMPL(local, unsigned int)
#endif // cl_khr_local_int32_base_atomics
#undef IMPL
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) { \
return atom_sub(p, (TYPE)1); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,42 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_add.h>
#include <clc/atomic/atom_inc.h>
#include <clc/atomic/atomic_inc.h>
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) { \
return atomic_inc(p); \
}
#ifdef cl_khr_global_int32_base_atomics
IMPL(global, int)
IMPL(global, unsigned int)
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
IMPL(local, int)
IMPL(local, unsigned int)
#endif // cl_khr_local_int32_base_atomics
#undef IMPL
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) { \
return atom_add(p, (TYPE)1); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -9,10 +9,11 @@
#include <clc/clc.h>
#include <clc/utils.h>
#define __CLC_ATOM_IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE __CLC_XCONCAT(atom_, __CLC_ATOMIC_OP) (volatile AS TYPE *p, TYPE val) { \
return __CLC_XCONCAT(atomic_, __CLC_ATOMIC_OP) (p, val); \
}
#define __CLC_ATOM_IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE __CLC_XCONCAT(atom_, __CLC_ATOMIC_OP)( \
volatile AS TYPE * p, TYPE val) { \
return __CLC_XCONCAT(atomic_, __CLC_ATOMIC_OP)(p, val); \
}
__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, int)
__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, uint)

@ -0,0 +1,44 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_max.h>
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_ATOMIC_OP max
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_ATOMIC_OP max
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
unsigned long __clc__sync_fetch_and_max_local_8(volatile local long *, long);
unsigned long __clc__sync_fetch_and_max_global_8(volatile global long *, long);
unsigned long __clc__sync_fetch_and_umax_local_8(volatile local unsigned long *,
unsigned long);
unsigned long
__clc__sync_fetch_and_umax_global_8(volatile global unsigned long *,
unsigned long);
#define IMPL(AS, TYPE, OP) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_max(volatile AS TYPE *p, TYPE val) { \
return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \
}
IMPL(global, long, max)
IMPL(global, unsigned long, umax)
IMPL(local, long, max)
IMPL(local, unsigned long, umax)
#undef IMPL
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,44 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_min.h>
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_ATOMIC_OP min
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_ATOMIC_OP min
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
unsigned long __clc__sync_fetch_and_min_local_8(volatile local long *, long);
unsigned long __clc__sync_fetch_and_min_global_8(volatile global long *, long);
unsigned long __clc__sync_fetch_and_umin_local_8(volatile local unsigned long *,
unsigned long);
unsigned long
__clc__sync_fetch_and_umin_global_8(volatile global unsigned long *,
unsigned long);
#define IMPL(AS, TYPE, OP) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_min(volatile AS TYPE *p, TYPE val) { \
return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \
}
IMPL(global, long, min)
IMPL(global, unsigned long, umin)
IMPL(local, long, min)
IMPL(local, unsigned long, umin)
#undef IMPL
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_or.h>
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_ATOMIC_OP or
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_ATOMIC_OP or
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_or(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_or_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_extended_atomics

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_sub.h>
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_ATOMIC_OP sub
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_ATOMIC_OP sub
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_sub(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_sub_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_xchg.h>
#ifdef cl_khr_global_int32_base_atomics
#define __CLC_ATOMIC_OP xchg
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_base_atomics
#ifdef cl_khr_local_int32_base_atomics
#define __CLC_ATOMIC_OP xchg
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_base_atomics
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(volatile AS TYPE *p, TYPE val) { \
return __sync_swap_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_base_atomics

@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/atomic/atom_xor.h>
#ifdef cl_khr_global_int32_extended_atomics
#define __CLC_ATOMIC_OP xor
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "atom_int32_binary.inc"
#endif // cl_khr_global_int32_extended_atomics
#ifdef cl_khr_local_int32_extended_atomics
#define __CLC_ATOMIC_OP xor
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "atom_int32_binary.inc"
#endif // cl_khr_local_int32_extended_atomics
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_xor(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_xor_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif // cl_khr_int64_extended_atomics

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP add
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile global TYPE *p, TYPE cmp, TYPE val) { \
return atomic_cmpxchg(p, cmp, val); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile global TYPE *p) { \
return atomic_dec(p); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile global TYPE *p) { \
return atomic_inc(p); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP sub
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP xchg
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP and
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP max
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP min
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP or
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP xor
#define __CLC_ATOMIC_ADDRESS_SPACE global
#include "../atom_int32_binary.inc"

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_add(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_add_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp, TYPE val) { \
return __sync_val_compare_and_swap_8(p, cmp, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) { \
return atom_sub(p, (TYPE)1); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) { \
return atom_add(p, (TYPE)1); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_sub(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_sub_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_base_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(volatile AS TYPE *p, TYPE val) { \
return __sync_swap_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_and(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_and_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,29 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_extended_atomics
unsigned long __clc__sync_fetch_and_max_local_8(volatile local long *, long);
unsigned long __clc__sync_fetch_and_max_global_8(volatile global long *, long);
unsigned long __clc__sync_fetch_and_umax_local_8(volatile local unsigned long *, unsigned long);
unsigned long __clc__sync_fetch_and_umax_global_8(volatile global unsigned long *, unsigned long);
#define IMPL(AS, TYPE, OP) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_max(volatile AS TYPE *p, TYPE val) { \
return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \
}
IMPL(global, long, max)
IMPL(global, unsigned long, umax)
IMPL(local, long, max)
IMPL(local, unsigned long, umax)
#undef IMPL
#endif

@ -1,29 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_extended_atomics
unsigned long __clc__sync_fetch_and_min_local_8(volatile local long *, long);
unsigned long __clc__sync_fetch_and_min_global_8(volatile global long *, long);
unsigned long __clc__sync_fetch_and_umin_local_8(volatile local unsigned long *, unsigned long);
unsigned long __clc__sync_fetch_and_umin_global_8(volatile global unsigned long *, unsigned long);
#define IMPL(AS, TYPE, OP) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_min(volatile AS TYPE *p, TYPE val) { \
return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \
}
IMPL(global, long, min)
IMPL(global, unsigned long, umin)
IMPL(local, long, min)
IMPL(local, unsigned long, umin)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_or(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_or_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#ifdef cl_khr_int64_extended_atomics
#define IMPL(AS, TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_xor(volatile AS TYPE *p, TYPE val) { \
return __sync_fetch_and_xor_8(p, val); \
}
IMPL(global, long)
IMPL(global, unsigned long)
IMPL(local, long)
IMPL(local, unsigned long)
#undef IMPL
#endif

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP add
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile local TYPE *p, TYPE cmp, TYPE val) { \
return atomic_cmpxchg(p, cmp, val); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile local TYPE *p) { \
return atomic_dec(p); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,17 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile local TYPE *p) { \
return atomic_inc(p); \
}
IMPL(int)
IMPL(unsigned int)

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP sub
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP xchg
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP and
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP max
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP min
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP or
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"

@ -1,11 +0,0 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define __CLC_ATOMIC_OP xor
#define __CLC_ATOMIC_ADDRESS_SPACE local
#include "../atom_int32_binary.inc"