IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
UnaryPackOpRetMask.h
Go to the documentation of this file.
1 // UnaryPackOpRetMask.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_UNARYPACKOPRETMASK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_UNARYPACKOPRETMASK_H__
17 
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 
28 
29 // todo
30 template <typename T,
31  class OpClass>
33  typename boost::enable_if_c<sizeof(T) == 1>::type>
34 {
35  static
36  IPSDK_FORCEINLINE
38  act(const BasePack<ePackType::ePT_Sse, T>& in)
39  {
41  out._val[0] = OpClass::act(in._val[0]);
42  return out;
43  }
44 
45  static
46  IPSDK_FORCEINLINE
47  void
48  act(const BasePack<ePackType::ePT_Sse, T>& in,
50  {
51  OpClass::act(in._val[0], out._val[0]);
52  }
53 };
54 
55 template <typename T, class OpClass>
57  typename boost::enable_if_c<sizeof(T) == 2>::type>
58 {
59  static
60  IPSDK_FORCEINLINE
61  void
62  act(const BasePack<ePackType::ePT_Sse, T>& in,
64  {
65  OpClass::act(in._val[0], out._val[0]);
66  OpClass::act(in._val[1], out._val[1]);
67  }
68 };
69 
70 template <typename T, class OpClass>
72  typename boost::enable_if_c<sizeof(T) == 4>::type>
73 {
74  static
75  IPSDK_FORCEINLINE
77  act(const BasePack<ePackType::ePT_Sse, T>& in)
78  {
80  out._val[0] = OpClass::act(in._val[0]);
81  out._val[1] = OpClass::act(in._val[1]);
82  out._val[2] = OpClass::act(in._val[2]);
83  out._val[3] = OpClass::act(in._val[3]);
84  return out;
85  }
86 
87  static
88  IPSDK_FORCEINLINE
89  void
90  act(const BasePack<ePackType::ePT_Sse, T>& in,
92  {
93  OpClass::act(in._val[0], out._val[0]);
94  OpClass::act(in._val[1], out._val[1]);
95  OpClass::act(in._val[2], out._val[2]);
96  OpClass::act(in._val[3], out._val[3]);
97  }
98 };
99 
100 template <typename T, class OpClass>
102  typename boost::enable_if_c<sizeof(T) == 8>::type>
103 {
104  static
105  IPSDK_FORCEINLINE
107  act(const BasePack<ePackType::ePT_Sse, T>& in)
108  {
110  out._val[0] = OpClass::act(in._val[0]);
111  out._val[1] = OpClass::act(in._val[1]);
112  out._val[2] = OpClass::act(in._val[2]);
113  out._val[3] = OpClass::act(in._val[3]);
114  out._val[4] = OpClass::act(in._val[4]);
115  out._val[5] = OpClass::act(in._val[5]);
116  out._val[6] = OpClass::act(in._val[6]);
117  out._val[7] = OpClass::act(in._val[7]);
118  return out;
119  }
120 
121  static
122  IPSDK_FORCEINLINE
123  void
124  act(const BasePack<ePackType::ePT_Sse, T>& in,
126  {
127  OpClass::act(in._val[0], out._val[0]);
128  OpClass::act(in._val[1], out._val[1]);
129  OpClass::act(in._val[2], out._val[2]);
130  OpClass::act(in._val[3], out._val[3]);
131  OpClass::act(in._val[4], out._val[4]);
132  OpClass::act(in._val[5], out._val[5]);
133  OpClass::act(in._val[6], out._val[6]);
134  OpClass::act(in._val[7], out._val[7]);
135  }
136 };
137 
140 
141 } // end of namespace detail
142 } // end of namespace simd
143 } // end of namespace ipsdk
144 
145 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_UNARYPACKOPRETMASK_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: UnaryPackOpRetMask.h:31
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Predefined types associated to instruction set management.
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36