46 static const int BLOCK_SIZE = 8;
58 AVXSimdX8Int32(Int32 a7,Int32 a6,Int32 a5,Int32 a4,Int32 a3,Int32 a2,Int32 a1,Int32 a0)
59 : v0(_mm256_set_epi32(a7,a6,a5,a4,a3,a2,a1,a0)){}
62 : v0(_mm256_set_epi32(base[idx[7]],base[idx[6]],base[idx[5]],base[idx[4]],
63 base[idx[3]],base[idx[2]],base[idx[1]],base[idx[0]])) {}
65 : v0(_mm256_load_si256((
const __m256i*)base)){}
67 Int32 operator[](Integer i)
const {
return ((
const Int32*)&v0)[i]; }
68 Int32& operator[](Integer i) {
return ((Int32*)&v0)[i]; }
70 void set(ARCANE_RESTRICT Int32* base,
const ARCANE_RESTRICT Int32* idx)
const
72 const Int32* x = (
const Int32*)(
this);
83 void set(ARCANE_RESTRICT Int32* base)
const
85 _mm256_store_si256((__m256i*)base,v0);
90 v0 = _mm256_load_si256((
const __m256i*)base);
93 static AVXSimdX8Int32 fromScalar(Int32 a0,Int32 a1,Int32 a2,Int32 a3,
94 Int32 a4,Int32 a5,Int32 a6,Int32 a7)
100 void operator=(Int32 _v);
113 static const int BLOCK_SIZE = 4;
125 : v0(_mm256_set1_pd(r)) { }
128 : v0(_mm256_set_pd(a3,a2,a1,a0)) { }
131 : v0(_mm256_set_pd(base[idx[3]],base[idx[2]],base[idx[1]],base[idx[0]])) {}
134#ifdef ARCANE_USE_AVX2_GATHER
135 : v0(_mm256_i32gather_pd(base,simd_idx.v0,8)){}
141#ifdef ARCANE_USE_AVX2_GATHER
142 : v0(_mm256_i32gather_pd((Real*)base,simd_idx->v0,8)){}
149 : v0(_mm256_load_pd(base)) { }
151 Real operator[](Integer i)
const {
return ((
const Real*)&v0)[i]; }
152 Real& operator[](Integer i) {
return ((Real*)&v0)[i]; }
154 void set(ARCANE_RESTRICT Real* base,
const Int32* idx)
const
157 const Real* x = (
const Real*)(
this);
165 __m128i idx0 = _mm_load_si128((__m128i*)idx);
166 _mm256_i32scatter_pd(base,idx0,v0, 8);
170 void set(ARCANE_RESTRICT Real* base,
const Int32IndexType& simd_idx)
const
172 this->set(base,&simd_idx);
175 void set(ARCANE_RESTRICT Real* base,
const Int32IndexType* simd_idx)
const
177 this->set(base,(
const Int32*)simd_idx);
180 void set(ARCANE_RESTRICT Real* base)
const
182 _mm256_store_pd(base,v0);
185 static AVXSimdX4Real fromScalar(Real a0,Real a1,Real a2,Real a3)
191 inline AVXSimdX4Real operator- ()
const
193 return AVXSimdX4Real(_mm256_sub_pd(_mm256_setzero_pd(),v0));
197 void operator=(Real _v);
210 static const int BLOCK_SIZE = 8;
223 v0 = _mm256_set1_pd(r);
224 v1 = _mm256_set1_pd(r);
227 AVXSimdX8Real(Real a7,Real a6,Real a5,Real a4,Real a3,Real a2,Real a1,Real a0)
229 v0 = _mm256_set_pd(a3,a2,a1,a0);
230 v1 = _mm256_set_pd(a7,a6,a5,a4);
239 v0 = _mm256_set_pd(base[idx[3]],base[idx[2]],base[idx[1]],base[idx[0]]);
240 v1 = _mm256_set_pd(base[idx[7]],base[idx[6]],base[idx[5]],base[idx[4]]);
242 __m128i idx0 = _mm_loadu_si128((__m128i*)idx);
243 __m128i idx1 = _mm_loadu_si128((__m128i*)(idx+4));
244 v0 = _mm256_i32gather_pd((Real*)base,idx0,8);
245 v1 = _mm256_i32gather_pd((Real*)base,idx1,8);
252 v0 = _mm256_load_pd(base);
253 v1 = _mm256_load_pd(base+4);
256 Real operator[](Integer i)
const {
return ((
const Real*)&v0)[i]; }
257 Real& operator[](Integer i) {
return ((Real*)&v0)[i]; }
259 void set(ARCANE_RESTRICT Real* base,
const ARCANE_RESTRICT Int32* idx)
const
262 const Real* x = (
const Real*)(
this);
274 __m128i idx0 = _mm_loadu_si128((__m128i*)idx);
275 __m128i idx1 = _mm_loadu_si128((__m128i*)(idx+4));
276 _mm256_i32scatter_pd(base,idx0,v0, 8);
277 _mm256_i32scatter_pd(base,idx1,v1, 8);
282 void set(ARCANE_RESTRICT Real* base)
const
284 _mm256_store_pd(base,v0);
285 _mm256_store_pd(base+4,v1);
288 static AVXSimdX8Real fromScalar(Real a0,Real a1,Real a2,Real a3,
289 Real a4,Real a5,Real a6,Real a7)
295 inline AVXSimdX8Real operator- ()
const
297 return AVXSimdX8Real(_mm256_sub_pd(_mm256_setzero_pd(),v0),
298 _mm256_sub_pd(_mm256_setzero_pd(),v1));
302 void operator=(Real _v);