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_AVX_MAXREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX_MAXREGIMPL_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
35 AvxType<ipInt32>::Type
37  const AvxType<ipInt32>::Type& in1,
38  const AvxType<ipInt32>::Type& in2)
39 {
41  act(in1, in2, out);
42  return out;
43 }
44 
45 void
47  const AvxType<ipInt32>::Type& in1,
48  const AvxType<ipInt32>::Type& in2,
50 {
51  __m128i in11, in12;
52  __m128i in21, in22;
53  COPY_IMM_TO_XMM(in1, in11, in12);
54  COPY_IMM_TO_XMM(in2, in21, in22);
55  __m128i out1 = MaxReg<eInstructionSet::eIS_Sse2, ipInt32>::act(in11, in21);
56  __m128i out2 = MaxReg<eInstructionSet::eIS_Sse2, ipInt32>::act(in12, in22);
57  COPY_XMM_TO_IMM(out1, out2, out);
58 }
59 
64  const AvxType<ipReal32>::Type& in1,
65  const AvxType<ipReal32>::Type& in2)
66 {
67  return _mm256_max_ps(in1, in2);
68 }
69 
70 void
72  const AvxType<ipReal32>::Type& in1,
73  const AvxType<ipReal32>::Type& in2,
75 {
76  out = _mm256_max_ps(in1, in2);
77 }
78 
83  const AvxType<ipReal64>::Type& in1,
84  const AvxType<ipReal64>::Type& in2)
85 {
86  return _mm256_max_pd(in1, in2);
87 }
88 
89 void
91  const AvxType<ipReal64>::Type& in1,
92  const AvxType<ipReal64>::Type& in2,
94 {
95  out = _mm256_max_pd(in1, in2);
96 }
97 
100 
101 } // end of namespace detail
102 } // end of namespace simd
103 } // end of namespace ipsdk
104 
105 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX_MAXREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Functions to convert from 128 (resp. 256) bits registers to 256 (resp. 128) bits registers.
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: MaxRegDecl.h:29
Definition of import/export macro for library.
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33