IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseOrReg.h
Go to the documentation of this file.
1 // BitwiseOrReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX_BITWISEORREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX_BITWISEORREG_H__
17 
23 
24 namespace ipsdk {
25 namespace simd {
26 namespace detail {
27 
30 
31 template <typename T>
33  typename boost::enable_if_c<boost::is_integral<T>::value>::type>
34 {
35  static IPSDK_FORCEINLINE
36  typename AvxType<T>::Type
37  act(const typename AvxType<T>::Type& in1, const typename AvxType<T>::Type& in2)
38  {
40  act(in1, in2, out);
41  return out;
42  }
43 
44  static IPSDK_FORCEINLINE
45  void
46  act(const typename AvxType<T>::Type& in1,
47  const typename AvxType<T>::Type& in2,
48  typename AvxType<T>::Type& out)
49  {
50  __m128i in11, in12;
51  __m128i in21, in22;
52  COPY_IMM_TO_XMM(in1, in11, in12);
53  COPY_IMM_TO_XMM(in2, in21, in22);
54  __m128i out1 = _mm_or_si128(in11, in21);
55  __m128i out2 = _mm_or_si128(in12, in22);
56  COPY_XMM_TO_IMM(out1, out2, out);
57  }
58 };
59 
60 template <>
62 {
63  static IPSDK_FORCEINLINE
65  act(const AvxType<ipReal32>::Type& in1,
66  const AvxType<ipReal32>::Type& in2)
67  {
68  return _mm256_or_ps(in1, in2);
69  }
70 
71  static IPSDK_FORCEINLINE
72  void
73  act(const AvxType<ipReal32>::Type& in1,
74  const AvxType<ipReal32>::Type& in2,
76  {
77  out = _mm256_or_ps(in1, in2);
78  }
79 };
80 
81 template <>
83 {
84  static IPSDK_FORCEINLINE
86  act(const AvxType<ipReal64>::Type& in1,
87  const AvxType<ipReal64>::Type& in2)
88  {
89  return _mm256_or_pd(in1, in2);
90  }
91 
92  static IPSDK_FORCEINLINE
93  void
94  act(const AvxType<ipReal64>::Type& in1,
95  const AvxType<ipReal64>::Type& in2,
97  {
98  out = _mm256_or_pd(in1, in2);
99  }
100 };
101 
104 
105 } // end of namespace detail
106 } // end of namespace simd
107 } // end of namespace ipsdk
108 
109 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX_BITWISEORREG_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
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Predefined types for Avx instruction set management.
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions.
Definition: InstructionSetTypes.h:44
Definition: BitwiseOrReg.h:30
Definition of import/export macro for library.
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56