20 #ifndef VC_COMMON_STORAGE_H
21 #define VC_COMMON_STORAGE_H
33 template<
typename _VectorType,
typename _EntryType,
typename VectorTypeBase = _VectorType>
class VectorMemoryUnion
40 #if defined VC_ICC || defined VC_MSVC
43 data.v =
x;
return *
this;
51 return AliasingEntryHelper<VectorMemoryUnion>(
this, index);
69 #ifdef VC_COMPILE_BENCHMARKS
73 union VectorScalarUnion {
80 data =
x;
return *
this;
87 return reinterpret_cast<AliasingEntryType *
>(&
data)[index];
91 return reinterpret_cast<const AliasingEntryType *
>(&
data)[index];
95 #ifdef VC_COMPILE_BENCHMARKS
102 #if VC_GCC == 0x40700 || (VC_GCC >= 0x40600 && VC_GCC <= 0x40603)
104 template<
typename T,
typename V>
static Vc_ALWAYS_INLINE Vc_CONST T &vectorMemoryUnionAliasedMember(V *data,
size_t index) {
105 if (__builtin_constant_p(index) && index == 0) {
107 asm(
"mov %1,%0" :
"=r"(ret) :
"r"(data));
110 return reinterpret_cast<T *
>(data)[index];
114 return vectorMemoryUnionAliasedMember<AliasingEntryType>(&data, index);
117 return vectorMemoryUnionAliasedMember<AliasingEntryType>(&data, index);
120 return vectorMemoryUnionAliasedMember<AliasingEntryType>(&data, index);
130 #endif // VC_COMMON_STORAGE_H
double read(const std::string &file_name)
reading
EntryType AliasingEntryType Vc_MAY_ALIAS
Vc_ALWAYS_INLINE VectorMemoryUnion & operator=(VectorType x)
Vc_ALWAYS_INLINE VectorMemoryUnion(VectorType x)
Vc_ALWAYS_INLINE Vc_PURE AliasingEntryType & m(size_t index)
Vc_ALWAYS_INLINE Vc_PURE VectorType & v()
static Vc_ALWAYS_INLINE void assertCorrectAlignment(const _T *)
Vc_ALWAYS_INLINE Vc_PURE const VectorType & v() const
Vc_ALWAYS_INLINE VectorMemoryUnion()
Vc_ALWAYS_INLINE Vc_PURE EntryType m(size_t index) const