IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SortRegImpl.h
Go to the documentation of this file.
1 // SortRegImpl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_SORTREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_SORTREGIMPL_H__
17 
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 
31 
32 template <typename T>
33 IPSDK_FORCEINLINE
34 void
35 SortReg<
37  T/*,
38  typename boost::enable_if_c<boost::is_integral<T>::value>::type*/
39 >::act(
40  typename Sse2Type<T>::Type& inOut1,
41  typename Sse2Type<T>::Type& inOut2)
42 {
43  typedef typename RegType<eInstructionSet::eIS_Sse2, T>::Type RegT;
44  RegT savedInOut1 = inOut1;
45  RegT savedInOut2 = inOut2;
46 
47  RegT lessReg;
48  IsLessReg<eInstructionSet::eIS_Sse2, T>::act(inOut1, inOut2, lessReg);
49  BitwiseSelectReg<eInstructionSet::eIS_Sse2, T>::act(
50  lessReg, savedInOut1, savedInOut2, inOut1);
51  BitwiseSelectReg<eInstructionSet::eIS_Sse2, T>::act(
52  lessReg, savedInOut2, savedInOut1, inOut2);
53 }
54 
55 template <>
56 IPSDK_FORCEINLINE
57 void
58 SortReg<eInstructionSet::eIS_Sse2, ipReal32>::act(
59  Sse2Type<ipReal32>::Type& inOut1,
60  Sse2Type<ipReal32>::Type& inOut2)
61 {
62  Sse2Type<ipReal32>::Type savedInOut1 = inOut1;
64  MaxReg<eInstructionSet::eIS_Sse2, ipReal32>::act(savedInOut1, inOut2, inOut2);
65 }
66 
67 template <>
68 IPSDK_FORCEINLINE
69 void
70 SortReg<eInstructionSet::eIS_Sse2, ipReal64>::act(
71  Sse2Type<ipReal64>::Type& inOut1,
72  Sse2Type<ipReal64>::Type& inOut2)
73 {
74  Sse2Type<ipReal64>::Type savedInOut1 = inOut1;
75  MinReg<eInstructionSet::eIS_Sse2, ipReal64>::act(inOut1, inOut2, inOut1);
76  MaxReg<eInstructionSet::eIS_Sse2, ipReal64>::act(savedInOut1, inOut2, inOut2);
77 }
78 
81 
82 } // end of namespace detail
83 } // end of namespace simd
84 } // end of namespace ipsdk
85 
86 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_SORTREGIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
template structure which is specialized to implement the minimum computation on 2 scalars or 2 regist...
static IPSDK_FORCEINLINE Sse2Type< ipReal32 >::Type act(const Sse2Type< ipReal32 >::Type &in1, const Sse2Type< ipReal32 >::Type &in2)
MinReg template specialization for instruction set SSE2 and for type ipReal32.
Definition: MinRegImpl.h:108
template structure which is specialized to implement the maximum computation on 2 scalars or 2 regist...
static IPSDK_FORCEINLINE Sse2Type< ipReal32 >::Type act(const Sse2Type< ipReal32 >::Type &in1, const Sse2Type< ipReal32 >::Type &in2)
MaxReg template specialization for instruction set SSE2 and for type ipReal32.
Definition: MaxRegImpl.h:108
RegType class.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36