IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseNotRegImpl.h
Go to the documentation of this file.
1 // BitwiseNotRegImpl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISENOTREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISENOTREGIMPL_H__
17 
19 
20 namespace ipsdk {
21 namespace simd {
22 namespace detail {
23 
26 /*
27 template <typename T>
28 struct BitwiseNotReg<eInstructionSet::eIS_Standard, T>
29 {
30  static T act(const T& in)
31  {
32  return ~in;
33  }
34 };
35 
36 template <>
37 struct BitwiseNotReg<eInstructionSet::eIS_Standard, ipReal32>
38 {
39  static ipReal32 act(const ipReal32& in)
40  {
41  const ipUInt32 inCvt = *reinterpret_cast<const ipUInt32*>(&in);
42  const ipUInt32 nRes = ~inCvt;
43  return *reinterpret_cast<const ipReal32*>(&nRes);
44  }
45 };*/
46 
47 template <typename T>
48 IPSDK_FORCEINLINE
49 T
50 BitwiseNotReg<eInstructionSet::eIS_Standard, T>::act(const T& in)
51 {
52  return ~in;
53 }
54 
55 template <typename T>
56 IPSDK_FORCEINLINE
57 void
58 BitwiseNotReg<eInstructionSet::eIS_Standard, T>::act(const T& in, T& out)
59 {
60  out = ~in;
61 }
62 
63 IPSDK_FORCEINLINE
65 BitwiseNotReg<eInstructionSet::eIS_Standard, ipReal32>::act(
66  const ipReal32& in)
67 {
68  const ipUInt32 inCvt = *reinterpret_cast<const ipUInt32*>(&in);
69  const ipUInt32 nRes = ~inCvt;
70  return *reinterpret_cast<const ipReal32*>(&nRes);
71 }
72 
73 IPSDK_FORCEINLINE
74 void
75 BitwiseNotReg<eInstructionSet::eIS_Standard, ipReal32>::act(
76  const ipReal32& in, ipReal32& out)
77 {
78  const ipUInt32 inCvt = *reinterpret_cast<const ipUInt32*>(&in);
79  const ipUInt32 nRes = ~inCvt;
80  out = *reinterpret_cast<const ipReal32*>(&nRes);
81 }
82 
83 IPSDK_FORCEINLINE
85 BitwiseNotReg<eInstructionSet::eIS_Standard, ipReal64>::act(
86  const ipReal64& in)
87 {
88  const ipUInt64 inCvt = *reinterpret_cast<const ipUInt64*>(&in);
89  const ipUInt64 nRes = ~inCvt;
90  return *reinterpret_cast<const ipReal64*>(&nRes);
91 }
92 
93 IPSDK_FORCEINLINE
94 void
95 BitwiseNotReg<eInstructionSet::eIS_Standard, ipReal64>::act(
96  const ipReal64& in, ipReal64& out)
97 {
98  const ipUInt64 inCvt = *reinterpret_cast<const ipUInt64*>(&in);
99  const ipUInt64 nRes = ~inCvt;
100  out = *reinterpret_cast<const ipReal64*>(&nRes);
101 }
102 
105 
106 } // end of namespace detail
107 } // end of namespace simd
108 } // end of namespace ipsdk
109 
110 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_BITWISENOTREGIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53