IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseXOrReg.h
Go to the documentation of this file.
1 // BitwiseXOrReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEXORREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEXORREG_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, const ipReal32& in2)
52  {
53  const ipUInt32 in1Cvt = *reinterpret_cast<const ipUInt32*>(&in1);
54  const ipUInt32 in2Cvt = *reinterpret_cast<const ipUInt32*>(&in2);
55  const ipUInt32 nRes = in1Cvt ^ in2Cvt;
56  return *reinterpret_cast<const ipReal32*>(&nRes);
57  }
58 
59  static IPSDK_FORCEINLINE
60  void
61  act(const ipReal32& in1, const ipReal32& in2, ipReal32& out)
62  {
63  const ipUInt32 in1Cvt = *reinterpret_cast<const ipUInt32*>(&in1);
64  const ipUInt32 in2Cvt = *reinterpret_cast<const ipUInt32*>(&in2);
65  const ipUInt32 nRes = in1Cvt ^ in2Cvt;
66  out = *reinterpret_cast<const ipReal32*>(&nRes);
67  }
68 };
69 
72 
73 } // end of namespace detail
74 } // end of namespace simd
75 } // end of namespace ipsdk
76 
77 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISEXORREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition: BitwiseXOrReg.h:30
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