search for: _atomic

Displaying 20 results from an estimated 54 matches for "_atomic".

Did you mean: atomic
2011 Oct 13
1
[LLVMdev] Are x86/ARM likely to support atomics larger than 2 pointers?
There's a discussion over on cfe-commits about how future-proof to make the C1x/C++11 atomic ABI. (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20111010/047647.html) One argument is that, because C ABI changes are painful, and processors may introduce larger atomic operations in the future, we should try to design the atomics implementation in such a way that it can take
2019 Dec 29
2
__c11_atomic builtins' input requirements
I have started working on an implementation of atomic_ref. Implementing this requires performing atomic operations on arbitrary references. The behavior is undefined if a reference is provided that is not aligned per the public export required_alignment. What assumptions do the __c11_atomic builtins make about destination argument alignment, format, size etc.? Is it required that the destination argument be annotated as _Atomic like the corresponding standard c11 functions require? The following code in libcxx/include/config implies that the c11 atomic builtins should be substituted...
2016 Jan 27
7
Adding sanity to the Atomics implementation
...ns, which clang lowers directly to atomic IR instructions. Then, the llvm atomic IR instructions themselves can sometimes emit libcalls to __sync_* library functions (which are basically undocumented, and users are often responsible for implementing themselves if they need it). There's the new __atomic_* builtins, which clang will, depending on size and alignment and target, lower either to a libcall to a "standardized-by-GCC <https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary>" __atomic_* library function (implemented by libatomic), or, to the atomic IR instructions. (Also covered by...
2013 Mar 17
2
[LLVMdev] Running cross compiled binaries for ARM on gem5
...t.hpp:117:9: error: cannot compile this atomic library call yet CV_XADD(refcount, 1); ^~~~~~~~~~~~~~~~~~~~ /home/silky/VecProject/opencv/OpenCVInstall/arm/include/opencv2/core/operations.hpp:61:38: note: expanded from macro 'CV_XADD' #define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST) Could someone please suggest what I am missing here, or what the error indicates? Thank you all. -- View this message in context: http://llvm.1065342.n5.nabble.com/Running-cross-compiled-binaries-for-ARM-on-gem5-tp55767p56023.html Se...
2016 Jan 28
0
Adding sanity to the Atomics implementation
...tomic IR instructions. Then, the llvm atomic IR instructions > themselves can sometimes emit libcalls to __sync_* library > functions (which are basically undocumented, and users are often > responsible for implementing themselves if they need it). > 2. There's the new __atomic_* builtins, which clang will, depending > on size and alignment and target, lower either to a libcall to a > "standardized-by-GCC > <https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary>" __atomic_* > library function (implemented by libatomic), or, to the atomi...
2016 Jan 31
2
Adding sanity to the Atomics implementation
...tructions. Then, the llvm atomic IR > instructions themselves can sometimes emit libcalls to __sync_* > library functions (which are basically undocumented, and users > are often responsible for implementing themselves if they need > it). > 2. There's the new __atomic_* builtins, which clang will, > depending on size and alignment and target, lower either to a > libcall to a " standardized-by-GCC " __atomic_* library function > (implemented by libatomic), or, to the atomic IR instructions. > (Also covered by the same code is...
2015 Apr 24
3
[LLVMdev] Floating point atomic load and add
Quoting Tim Northover <t.p.northover at gmail.com>: > On 24 April 2015 at 13:53, Tyler Denniston <tyler at csail.mit.edu> wrote: >> I'm wondering how I can create an atomic load and add instruction for >> floating point values. If I use IRBuilder::CreateAtomicRMW() I get the >> error message: "atomicrmw operand must have integer type". > >
2013 Mar 18
0
[LLVMdev] Running cross compiled binaries for ARM on gem5
...this atomic library call yet > CV_XADD(refcount, 1); > ^~~~~~~~~~~~~~~~~~~~ > > /home/silky/VecProject/opencv/OpenCVInstall/arm/include/opencv2/core/operations.hpp:61:38: > note: expanded from macro 'CV_XADD' > #define CV_XADD(addr, delta) > __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST) > This is odd. This atomic is implemented in CGAtomic.cpp, but it's being lowered as a library call because "UseLibcall" is true: bool UseLibcall = (Size != Align || getContext().toBits(sizeChars) &g...
2019 Jun 05
2
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...t;\n"; > diff --git a/lib/connect.c b/lib/connect.c > index b889f80..4e3141f 100644 > --- a/lib/connect.c > +++ b/lib/internal.h > @@ -80,7 +80,17 @@ struct nbd_handle { > /* Linked list of close callbacks. */ > struct close_callback *close_callbacks; > > - _Atomic enum state state; /* State machine. */ > + /* State machine. > + * > + * The actual current state is ‘next_state’. ‘state’ is updated > + * before we release the lock. > + * > + * Note don't access these fields directly, use the SET_NEXT_STATE > + * macro...
2016 Jan 10
3
[PATCH v2 1/3] checkpatch.pl: add missing memory barriers
On Sun, 2016-01-10 at 13:56 +0200, Michael S. Tsirkin wrote: > SMP-only barriers were missing in checkpatch.pl > > Refactor code slightly to make adding more variants easier. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5116,7 +5116,25 @@ sub process { > ? } > ? } > ?# check for memory barriers without a comment. > - if ($line =~
2016 Jan 10
3
[PATCH v2 1/3] checkpatch.pl: add missing memory barriers
On Sun, 2016-01-10 at 13:56 +0200, Michael S. Tsirkin wrote: > SMP-only barriers were missing in checkpatch.pl > > Refactor code slightly to make adding more variants easier. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5116,7 +5116,25 @@ sub process { > ? } > ? } > ?# check for memory barriers without a comment. > - if ($line =~
2019 Jun 08
0
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
.../lib/connect.c > > index b889f80..4e3141f 100644 > > --- a/lib/connect.c > > > +++ b/lib/internal.h > > @@ -80,7 +80,17 @@ struct nbd_handle { > > /* Linked list of close callbacks. */ > > struct close_callback *close_callbacks; > > > > - _Atomic enum state state; /* State machine. */ > > + /* State machine. > > + * > > + * The actual current state is ‘next_state’. ‘state’ is updated > > + * before we release the lock. > > + * > > + * Note don't access these fields directly, use the SE...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...= -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 7290247..1bef1c2 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -80,7 +80,17 @@ struct nbd_handle { /* Linked list of close callbacks. */ struct close_callback *close_callbacks; - _Atomic enum state state; /* State machine. */ + /* State machine. + * + * The actual current state is ‘next_state’. ‘state’ is updated + * before we release the lock. + * + * Note don't access these fields directly, use the SET_NEXT_STATE + * macro in generator/states* code, or the s...
2019 Mar 12
1
Handling of __c11_atomic_is_lock_free({1, 2, 4, 8}) in compiler-rt atomic.c
...think this more of a front-end issue than a compile-rt issue, but I’m also copying the llvm-dev list In compiler-rt the file lib/builtins/atomic.c seems to rely on determining at compile time if an atomic operation of size 1, 2, 4, or 8 is always lock free. For example, in the implementation of __atomic_load_8() we have something like this after macro expansion: void __atomic_load_8(…) { If (__c11_atomic_is_lock_free(8)) return __c11_atomic_load_8(..) /* otherwise lock-based implementation */ } Let’s say a target supports lock-free atomics for 8-byte objects. Then the front-end will lower...
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...= -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 61ddbde..503bf34 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -80,7 +80,17 @@ struct nbd_handle { /* Linked list of close callbacks. */ struct close_callback *close_callbacks; - _Atomic enum state state; /* State machine. */ + /* State machine. + * + * The actual current state is ‘state’. ‘public_state’ is updated + * before we release the lock. + * + * Note don't access these fields directly, use the SET_NEXT_STATE + * macro in generator/states* code, or the...
2013 Mar 18
2
[LLVMdev] Running cross compiled binaries for ARM on gem5
...call yet > CV_XADD(refcount, 1); > ^~~~~~~~~~~~~~~~~~~~ > /home/silky/VecProject/opencv/OpenCVInstall/arm/include/opencv2/core/operations.hpp:61:38: > note: expanded from macro 'CV_XADD' > #define CV_XADD(addr, delta) > __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), > __ATOMIC_SEQ_CST) > > > This is odd. This atomic is implemented in CGAtomic.cpp, but it's > being lowered as a library call because "UseLibcall" is true: > > bool UseLibcall = (Size != Align || >...
2016 Jan 10
0
[PATCH v2 1/3] checkpatch.pl: add missing memory barriers
...not to have to > prefix it with smp_ before using it. > > my $smp_barriers = qr{ > smp_store_release| > smp_load_acquire| > smp_store_mb| > smp_read_barrier_depends That's missing (?:barriers) too. btw: shouldn't this also have smp_mb__(?:before|after)_atomic ?
2015 Feb 15
1
[PATCH V4] x86 spinlock: Fix memory corruption on completing completions
...ickets.head) == want) { >> + head = READ_ONCE(lock->tickets.head); >> + if (__tickets_equal(head, want)) { >> add_stats(TAKEN_SLOW_PICKUP, 1); >> goto out; > > This is off-topic, but with or without this change perhaps it makes sense > to add smp_mb__after_atomic(). It is nop on x86, just to make this code > more understandable for those (for me ;) who can never remember even the > x86 rules. > Hope you meant it for add_stat. yes smp_mb__after_atomic() would be harmless barrier() in x86. Did not add this V5 as yoiu though but this made me look a...
2015 Feb 15
1
[PATCH V4] x86 spinlock: Fix memory corruption on completing completions
...ickets.head) == want) { >> + head = READ_ONCE(lock->tickets.head); >> + if (__tickets_equal(head, want)) { >> add_stats(TAKEN_SLOW_PICKUP, 1); >> goto out; > > This is off-topic, but with or without this change perhaps it makes sense > to add smp_mb__after_atomic(). It is nop on x86, just to make this code > more understandable for those (for me ;) who can never remember even the > x86 rules. > Hope you meant it for add_stat. yes smp_mb__after_atomic() would be harmless barrier() in x86. Did not add this V5 as yoiu though but this made me look a...
2013 Mar 11
0
[LLVMdev] Running cross compiled binaries for ARM on gem5
Hi Silky, If I got correctly, you seem to be trying to run a bare-metal image on your model, but you compile with linux-gnueabi GCC. I don't know if that will make a difference, but I'd try to use none-eabi GCC toolchain and set the -target armv7a-none-eabi just in case. On 10 March 2013 00:26, Silky Arora <silkyar at umich.edu> wrote: > Most of the search results talk about