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_SSE2_SCANREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_SCANREG_H__
17 
19 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/ScanReg.h>
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
27 template <>
29 {
30  static IPSDK_FORCEINLINE
32  act(const Sse2Type<ipReal32>::Type& in)
33  {
35  act(in, out);
36  return out;
37  }
38 
39  static IPSDK_FORCEINLINE
40  void
41  act(const Sse2Type<ipReal32>::Type& in,
43  {
44  out = _mm_add_ps(in, _mm_castsi128_ps(_mm_slli_si128(_mm_castps_si128(in), 4)));
45  out = _mm_add_ps(out, _mm_shuffle_ps(_mm_setzero_ps(), out, 0x40));
46  }
47 };
48 
49 template <>
51 {
52  static IPSDK_FORCEINLINE
54  act(const Sse2Type<ipReal64>::Type& in)
55  {
57  act(in, out);
58  return out;
59  }
60 
61  static IPSDK_FORCEINLINE
62  void
63  act(const Sse2Type<ipReal64>::Type& in,
65  {
66  out = _mm_add_pd(in, _mm_castsi128_pd(_mm_slli_si128(_mm_castpd_si128(in), 8)));
67  }
68 };
71 
72 } // end of namespace detail
73 } // end of namespace simd
74 } // end of namespace ipsdk
75 
76 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_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
Predefined types for Sse2 instruction set management.
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32
float ipReal32
Base types definition.
Definition: BaseTypes.h:56