IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IfMaskAllOnesElseZeroPack.h
1 // IfMaskAllOnesElseZeroPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_IFMASKALLONESELSEZEROPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_IFMASKALLONESELSEZEROPACK_H__
17 
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 
31 
34 template <typename T>
37  T,
38  typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::value>::type
39 >
40 {
41  static IPSDK_FORCEINLINE
44  {
46  out._val[0] = mask._val[0];
47  return out;
48  }
49 
50  static IPSDK_FORCEINLINE
51  void
53  {
54  out._val[0] = mask._val[0];
55  }
56 };
57 
60 template <typename T>
63  T,
64  typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::value>::type
65 >
66 {
67  static IPSDK_FORCEINLINE
70  {
72  out._val[0] = mask._val[0];
73  out._val[1] = mask._val[1];
74  return out;
75  }
76 
77  static IPSDK_FORCEINLINE
78  void
80  {
81  out._val[0] = mask._val[0];
82  out._val[1] = mask._val[1];
83  }
84 };
85 
88 template <typename T>
91  T,
92  typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::value>::type
93 >
94 {
95  static IPSDK_FORCEINLINE
98  {
100  out._val[0] = mask._val[0];
101  out._val[1] = mask._val[1];
102  out._val[2] = mask._val[2];
103  out._val[3] = mask._val[3];
104  return out;
105  }
106 
107  static IPSDK_FORCEINLINE
108  void
109  act(const BaseMaskPack<ePackType::ePT_Sse, T>& mask)
110  {
111  out._val[0] = mask._val[0];
112  out._val[1] = mask._val[1];
113  out._val[2] = mask._val[2];
114  out._val[3] = mask._val[3];
115  }
116 };
117 
120 template <typename T>
123  T,
124  typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<8> >::value>::type
125 >
126 {
127  static IPSDK_FORCEINLINE
129  act(const BaseMaskPack<ePackType::ePT_Sse, T>& mask)
130  {
132  out._val[0] = mask._val[0];
133  out._val[1] = mask._val[1];
134  out._val[2] = mask._val[2];
135  out._val[3] = mask._val[3];
136  out._val[4] = mask._val[4];
137  out._val[5] = mask._val[5];
138  out._val[6] = mask._val[6];
139  out._val[7] = mask._val[7];
140  return out;
141  }
142 
143  static IPSDK_FORCEINLINE
144  void
145  act(const BaseMaskPack<ePackType::ePT_Sse, T>& mask)
146  {
147  out._val[0] = mask._val[0];
148  out._val[1] = mask._val[1];
149  out._val[2] = mask._val[2];
150  out._val[3] = mask._val[3];
151  out._val[4] = mask._val[4];
152  out._val[5] = mask._val[5];
153  out._val[6] = mask._val[6];
154  out._val[7] = mask._val[7];
155  }
156 };
157 
160 
161 } // end of namespace detail
162 } // end of namespace simd
163 } // end of namespace ipsdk
164 
165 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_IFMASKALLONESELSEZEROPACK_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
cast function; casts a Pack<instructionSet, TIn> to a Pack<instructionSet, TOut>
Definition: IfMaskAllOnesElseZero.h:30
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
function assigning a given value of type T to a given Pack<instructionSet, T>
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36