IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LoadRegImpl.h
Go to the documentation of this file.
1 // LoadRegImpl.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_LOADREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_LOADREGIMPL_H__
17 
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 
28 
29 // load implementation for SSE2 for integral types
30 template <typename T>
31 typename Sse2Type<T>::Type
32 LoadReg<
34  T,
35  typename boost::enable_if_c<
36  boost::is_integral<T>::value
37  >::type
38 >::act(const T* pT)
39 {
40  return _mm_loadu_si128(
41  reinterpret_cast<const typename Sse2Type<T>::Type*>(pT));
42 }
43 
44 template <typename T>
45 void
46 LoadReg<
48  T,
49  typename boost::enable_if_c<
50  boost::is_integral<T>::value
51  >::type
52 >::act(typename Sse2Type<T>::Type& reg, const T* pT)
53 {
54  reg = _mm_loadu_si128(
55  reinterpret_cast<const typename Sse2Type<T>::Type*>(pT));
56 }
57 
58 Sse2Type<ipReal32>::Type
59 LoadReg<eInstructionSet::eIS_Sse2, ipReal32>::act(const ipReal32* pT)
60 {
61  return _mm_loadu_ps(pT);
62 }
63 
64 void
65 LoadReg<eInstructionSet::eIS_Sse2, ipReal32>::act(
66  Sse2Type<ipReal32>::Type& reg,
67  const ipReal32* pT)
68 {
69  reg = _mm_loadu_ps(pT);
70 }
71 
72 Sse2Type<ipReal64>::Type
73 LoadReg<eInstructionSet::eIS_Sse2, ipReal64>::act(const ipReal64* pT)
74 {
75  return _mm_loadu_pd(pT);
76 }
77 
78 void
79 LoadReg<eInstructionSet::eIS_Sse2, ipReal64>::act(
80  Sse2Type<ipReal64>::Type& reg,
81  const ipReal64* pT)
82 {
83  reg = _mm_loadu_pd(pT);
84 }
85 
88 
89 } // end of namespace detail
90 } // end of namespace simd
91 } // end of namespace ipsdk
92 
93 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_LOADREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
float ipReal32
Base types definition.
Definition: BaseTypes.h:56