IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseAndReg.h
Go to the documentation of this file.
1 // BitwiseAndReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_BITWISEANDREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_BITWISEANDREG_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
32 template <typename T>
34  typename boost::enable_if_c<boost::is_integral<T>::value>::type>
35 {
36  static IPSDK_FORCEINLINE
37  typename Sse2Type<T>::Type
38  act(const typename Sse2Type<T>::Type& in1, const typename Sse2Type<T>::Type& in2)
39  {
40  return _mm_and_si128(in1, in2);
41  }
42 
43  static IPSDK_FORCEINLINE
44  void
45  act(const typename Sse2Type<T>::Type& in1,
46  const typename Sse2Type<T>::Type& in2,
47  typename Sse2Type<T>::Type& out)
48  {
49  out = _mm_and_si128(in1, in2);
50  }
51 };
52 
55 template <>
57 {
58  static IPSDK_FORCEINLINE
60  act(const Sse2Type<ipReal32>::Type& in1,
61  const Sse2Type<ipReal32>::Type& in2)
62  {
63  return _mm_and_ps(in1, in2);
64  }
65 
66  static IPSDK_FORCEINLINE
67  void
68  act(const Sse2Type<ipReal32>::Type& in1,
69  const Sse2Type<ipReal32>::Type& in2,
71  {
72  out = _mm_and_ps(in1, in2);
73  }
74 };
75 
78 template <>
80 {
81  static IPSDK_FORCEINLINE
83  act(const Sse2Type<ipReal64>::Type& in1,
84  const Sse2Type<ipReal64>::Type& in2)
85  {
86  return _mm_and_pd(in1, in2);
87  }
88 
89  static IPSDK_FORCEINLINE
90  void
91  act(const Sse2Type<ipReal64>::Type& in1,
92  const Sse2Type<ipReal64>::Type& in2,
94  {
95  out = _mm_and_pd(in1, in2);
96  }
97 };
98 
101 
102 } // end of namespace detail
103 } // end of namespace simd
104 } // end of namespace ipsdk
105 
106 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_BITWISEANDREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Predefined types for Sse2 instruction set management.
Definition of import/export macro for library.
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32
Definition: BitwiseAndReg.h:30
float ipReal32
Base types definition.
Definition: BaseTypes.h:56