20 #ifndef VC_COMMON_INTERLEAVEDMEMORY_H
21 #define VC_COMMON_INTERLEAVEDMEMORY_H
34 template<
typename A,
typename B>
struct CopyConst<const
A,
B> {
typedef const B Type; };
45 typedef typename V::EntryType
T;
46 typedef typename V::IndexType
I;
47 typedef typename V::AsArg
VArg;
63 void deinterleave(V &v0, V &
v1, V &v2, V &v3, V &v4, V &v5, V &v6)
const;
64 void deinterleave(V &v0, V &
v1, V &v2, V &v3, V &v4, V &v5, V &v6, V &v7)
const;
86 :
Base(indexes *
I(StructSize), const_cast<
Ta *>(data))
105 #define _VC_SCATTER_ASSIGNMENT(LENGTH, parameters) \
106 Vc_ALWAYS_INLINE void operator=(const VectorTuple<LENGTH, V> &rhs) \
108 VC_STATIC_ASSERT(LENGTH <= StructSize, You_are_trying_to_scatter_more_data_into_the_struct_than_it_has); \
109 this->interleave parameters ; \
111 Vc_ALWAYS_INLINE void operator=(const VectorTuple<LENGTH, const V> &rhs) \
113 VC_STATIC_ASSERT(LENGTH <= StructSize, You_are_trying_to_scatter_more_data_into_the_struct_than_it_has); \
114 checkIndexesUnique(); \
115 this->interleave parameters ; \
122 _VC_SCATTER_ASSIGNMENT(7, (rhs.l.l.l.l.l.l, rhs.l.l.l.l.l.r, rhs.l.l.l.l.r, rhs.l.l.l.r, rhs.l.l.r, rhs.l.r, rhs.r));
123 _VC_SCATTER_ASSIGNMENT(8, (rhs.l.l.l.l.l.l.l, rhs.l.l.l.l.l.l.r, rhs.l.l.l.l.l.r, rhs.l.l.l.l.r, rhs.l.l.l.r, rhs.l.l.r, rhs.l.r, rhs.r));
124 #undef _VC_SCATTER_ASSIGNMENT
157 typedef typename V::EntryType
T;
158 typedef typename V::IndexType
I;
159 typedef typename V::AsArg
VArg;
166 VC_STATIC_ASSERT((
sizeof(
S) /
sizeof(
T)) *
sizeof(
T) ==
sizeof(
S), InterleavedMemoryAccess_does_not_support_packed_structs);
235 template <
typename U>
252 return operator[](indexes);
260 using Common::InterleavedMemoryWrapper;
268 #endif // VC_COMMON_INTERLEAVEDMEMORY_H
Vc_ALWAYS_INLINE InterleavedMemoryReadAccess(const Ta *data, typename I::AsArg indexes)
Internal::CopyConst< S, T >::Type Ta Vc_MAY_ALIAS
Vc_ALWAYS_INLINE ReadAccess gather(VC_ALIGNED_PARAMETER(IndexType) indexes) const
alias of the above function
Vc_ALWAYS_INLINE InterleavedMemoryAccess(Ta *data, typename I::AsArg indexes)
Vc_ALWAYS_INLINE Internal::EnableInterleaves< S, U, Access >::Type operator[](VC_ALIGNED_PARAMETER(U) indexes)
Interleaved scatter/gather access.
Vc_ALWAYS_INLINE InterleavedMemoryWrapper(S *s)
Constructs the wrapper object.
InterleavedMemoryAccessBase< V > Base
InterleavedMemoryAccessBase< V > Base
Vc_ALWAYS_INLINE InterleavedMemoryAccessBase(typename I::AsArg indexes, Ta *data)
#define VC_ALIGNED_PARAMETER(_Type)
void interleave(VArg v0, VArg v1)
void checkIndexesUnique() const
Vc_ALWAYS_INLINE ReadAccess operator[](VC_ALIGNED_PARAMETER(IndexType) indexes) const
const overload (gathers only) of the above function
_VC_SCATTER_ASSIGNMENT(3,(rhs.l.l, rhs.l.r, rhs.r))
#define VC_STATIC_ASSERT(cond, msg)
InterleavedMemoryAccess< sizeof(S)/sizeof(T), V > Access
Wraps a pointer to memory with convenience functions to access it via vectors.
void deinterleave(V &v0, V &v1) const
InterleavedMemoryReadAccess< sizeof(S)/sizeof(T), V > ReadAccess