IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseAndNotReg.h
Go to the documentation of this file.
1 // BitwiseAndNotReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEANDNOTREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEANDNOTREG_H__
17 
20 
21 namespace ipsdk {
22 namespace simd {
23 namespace detail {
24 
27 
28 template <typename T>
30 {
31  static IPSDK_FORCEINLINE
32  T
33  act(const T& in1, const T& in2)
34  {
35  return in1 & (~in2);
36  }
37 
38  static IPSDK_FORCEINLINE
39  void
40  act(const T& in1, const T& in2, T& out)
41  {
42  out = in1 & (~in2);
43  }
44 };
45 
46 template <>
48 {
49  static IPSDK_FORCEINLINE
50  ipReal32
51  act(const ipReal32& in1,
52  const ipReal32& in2)
53  {
54  const ipUInt32 in1Cvt = *reinterpret_cast<const ipUInt32*>(&in1);
55  const ipUInt32 in2Cvt = *reinterpret_cast<const ipUInt32*>(&in2);
56  const ipUInt32 nRes = in1Cvt & (~in2Cvt);
57  return *reinterpret_cast<const ipReal32*>(&nRes);
58  }
59 
60  static IPSDK_FORCEINLINE
61  void
62  act(const ipReal32& in1,
63  const ipReal32& in2,
64  ipReal32& out)
65  {
66  const ipUInt32 in1Cvt = *reinterpret_cast<const ipUInt32*>(&in1);
67  const ipUInt32 in2Cvt = *reinterpret_cast<const ipUInt32*>(&in2);
68  const ipUInt32 nRes = in1Cvt & (~in2Cvt);
69  out = *reinterpret_cast<const ipReal32*>(&nRes);
70  }
71 };
72 
75 
76 } // end of namespace detail
77 } // end of namespace simd
78 } // end of namespace ipsdk
79 
80 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEANDNOTREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: BitwiseAndNotReg.h:30
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition of import/export macro for library.
compiler optimisations only
Definition: InstructionSetTypes.h:34
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53