IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ScanReg.h
Go to the documentation of this file.
1 // ScanReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANREG_H__
17 
19 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/ScanReg.h>
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 
26 template <>
28 {
29  static IPSDK_FORCEINLINE
31  act(const AvxType<ipReal32>::Type& in)
32  {
34  }
35 
36  static IPSDK_FORCEINLINE
37  void
38  act(const AvxType<ipReal32>::Type& in,
40  {
42  }
43 };
44 
45 template <>
47 {
48  static IPSDK_FORCEINLINE
50  act(const AvxType<ipReal64>::Type& in)
51  {
53  }
54 
55  static IPSDK_FORCEINLINE
56  void
57  act(const AvxType<ipReal64>::Type& in,
59  {
60  __m256d t0, t1;
61  //shift1_AVX + add
62  t0 = _mm256_permute4x64_pd(in, 0x90);
63  t1 = _mm256_permute2f128_pd(t0, t0, 41);
64  __m256d t2;
65  t2 = _mm256_blend_pd(t0, t1, 0x8);
66  out = _mm256_add_pd(in, _mm256_blend_pd(t0, t1, 0x1));
67 
68  //shift2_AVX + add
69  t1 = _mm256_permute2f128_pd(out, out, 41);
70  out = _mm256_add_pd(out, t1);
71  }
72 };
73 
74 
77 
78 } // end of namespace detail
79 } // end of namespace simd
80 } // end of namespace ipsdk
81 
82 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
template structure which is specialized to implement the cumulative sum on 2 registers, depending on the used instructionSet and on the types of the buffers loaded in the registers
Definition: ScanReg.h:36
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48
Definition of import/export macro for library.
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56