IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
MaxRegImpl.h
Go to the documentation of this file.
1 // MaxRegImpl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_MAXREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_MAXREGIMPL_H__
17 
24 
25 #include <boost/mpl/contains.hpp>
26 #include <boost/mpl/vector.hpp>
27 
28 namespace ipsdk {
29 namespace simd {
30 namespace detail {
31 
34 
36 
37 template <typename T>
38 typename Sse2Type<T>::Type
39 MaxReg<
41  T,
42  typename boost::enable_if<typename boost::mpl::not_<typename boost::mpl::contains<SpecificTypesForSSE2MaxRegImpl, T>::type>::type>::type
43 >::act(const typename Sse2Type<T>::Type& in1,
44  const typename Sse2Type<T>::Type& in2)
45 {
48  in2, in1);
49 }
50 
51 template <typename T>
52 void
53 MaxReg<
55  T,
56  typename boost::enable_if<typename boost::mpl::not_<typename boost::mpl::contains<SpecificTypesForSSE2MaxRegImpl, T>::type>::type>::type
57 >::act(const typename Sse2Type<T>::Type& in1,
58  const typename Sse2Type<T>::Type& in2,
59  typename Sse2Type<T>::Type& out)
60 {
61  typename Sse2Type<T>::Type lessReg;
64  lessReg, in2, in1, out);
65 }
66 
71  const Sse2Type<ipUInt8>::Type& in1,
72  const Sse2Type<ipUInt8>::Type& in2)
73 {
74  return _mm_max_epu8(in1, in2);
75 }
76 
77 void
79  const Sse2Type<ipUInt8>::Type& in1,
80  const Sse2Type<ipUInt8>::Type& in2,
82 {
83  out = _mm_max_epu8(in1, in2);
84 }
85 
90  const Sse2Type<ipUInt16>::Type& in1,
91  const Sse2Type<ipUInt16>::Type& in2)
92 {
93  return _mm_max_epi16(in1, in2);
94 }
95 
96 void
98  const Sse2Type<ipUInt16>::Type& in1,
99  const Sse2Type<ipUInt16>::Type& in2,
101 {
102  out = _mm_max_epi16(in1, in2);
103 }
104 
109  const Sse2Type<ipReal32>::Type& in1,
110  const Sse2Type<ipReal32>::Type& in2)
111 {
112  return _mm_max_ps(in1, in2);
113 }
114 
115 void
117  const Sse2Type<ipReal32>::Type& in1,
118  const Sse2Type<ipReal32>::Type& in2,
120 {
121  out = _mm_max_ps(in1, in2);
122 }
123 
126 
127 } // end of namespace detail
128 } // end of namespace simd
129 } // end of namespace ipsdk
130 
131 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_MAXREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
template structure which is specialized to implement the maximum computation on 2 scalars or 2 regist...
Definition: BitwiseSelectReg.h:30
Predefined types for Sse2 instruction set management.
Definition: MaxRegDecl.h:29
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
Definition: IsLessRegDecl.h:30
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32