search for: __atomic_exchange

Displaying 5 results from an estimated 5 matches for "__atomic_exchange".

2016 Jan 27
7
Adding sanity to the Atomics implementation
...l still need to emit library calls itself for data not aligned naturally for its size. The LLVM atomic instructions currently will not handle unaligned data, but unaligned data is allowed for the four "slab of memory" builtins (__atomic_load, __atomic_store, __atomic_compare_exchange, and __atomic_exchange). A3) In LLVM, add "align" attributes to cmpxchg and atomicrmw, and allow specifying "align" values for "load atomic" and "store atomic" (where the attribute currently exists but cannot be used). LLVM will then be able to lower misaligned accesses to library...
2016 Jan 20
0
[PATCH] tools/virtio: use virt_xxx barriers
...define smp_wmb() barrier() +#define virt_mb() __sync_synchronize() +#define virt_rmb() barrier() +#define virt_wmb() barrier() +/* Atomic store should be enough, but gcc generates worse code in that case. */ +#define virt_store_mb(var, value) do { \ + typeof(var) virt_store_mb_value = (value); \ + __atomic_exchange(&(var), &virt_store_mb_value, &virt_store_mb_value, \ + __ATOMIC_SEQ_CST); \ + barrier(); \ +} while (0); /* Weak barriers should be used. If not - it's a bug */ -# define rmb() abort() -# define wmb() abort() +# define mb() abort() +# define rmb() abort() +# define wmb() abort...
2016 Jan 20
0
[PATCH] tools/virtio: use virt_xxx barriers
...define smp_wmb() barrier() +#define virt_mb() __sync_synchronize() +#define virt_rmb() barrier() +#define virt_wmb() barrier() +/* Atomic store should be enough, but gcc generates worse code in that case. */ +#define virt_store_mb(var, value) do { \ + typeof(var) virt_store_mb_value = (value); \ + __atomic_exchange(&(var), &virt_store_mb_value, &virt_store_mb_value, \ + __ATOMIC_SEQ_CST); \ + barrier(); \ +} while (0); /* Weak barriers should be used. If not - it's a bug */ -# define rmb() abort() -# define wmb() abort() +# define mb() abort() +# define rmb() abort() +# define wmb() abort...
2016 Jan 28
0
Adding sanity to the Atomics implementation
...rary calls > itself for data not aligned naturally for its size. The LLVM atomic > instructions currently will not handle unaligned data, but unaligned > data is allowed for the four "slab of memory" builtins (__atomic_load, > __atomic_store, __atomic_compare_exchange, and __atomic_exchange). > > A3) In LLVM, add "align" attributes to cmpxchg and atomicrmw, and > allow specifying "align" values for "load atomic" and "store atomic" > (where the attribute currently exists but cannot be used). LLVM will > then be able to lower mis...
2016 Jan 31
2
Adding sanity to the Atomics implementation
...ary calls > itself for data not aligned naturally for its size. The LLVM atomic > instructions currently will not handle unaligned data, but unaligned > data is allowed for the four "slab of memory" builtins > (__atomic_load, __atomic_store, __atomic_compare_exchange, and > __atomic_exchange). > > > A3) In LLVM, add "align" attributes to cmpxchg and atomicrmw, and > allow specifying "align" values for "load atomic" and "store atomic" > (where the attribute currently exists but cannot be used). LLVM will > then be able to lower...