IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AllBitsToOneReg.h
Go to the documentation of this file.
1 // AllBitsToOneReg.h:
3 // -------------------
4 //
13 
14 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_ALLBITSTOONEREG_H__
15 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_ALLBITSTOONEREG_H__
16 
22 
23 #include <boost/type_traits/is_integral.hpp>
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 
31 
32 template <eInstructionSet::domain IS, typename T, typename Enable=void>
34 {
35 };
36 
37 template <>
39 {
40  static IPSDK_FORCEINLINE ipInt8 act() { return -1; }
41 };
42 
43 template <>
45 {
46  static IPSDK_FORCEINLINE ipUInt8 act() { return 0xFF; }
47 };
48 
49 template <>
51 {
52  static IPSDK_FORCEINLINE ipInt16 act() { return -1; }
53 };
54 
55 template <>
57 {
58  static IPSDK_FORCEINLINE ipUInt16 act() { return 0xFFFF; }
59 };
60 
61 template <>
63 {
64  static IPSDK_FORCEINLINE ipInt32 act() { return -1; }
65 };
66 
67 template <>
69 {
70  static IPSDK_FORCEINLINE ipUInt32 act() { return 0xFFFFFFFF; }
71 };
72 
73 template <>
75 {
76  static IPSDK_FORCEINLINE ipInt64 act() { return -1; }
77 };
78 
79 template <>
81 {
82  static IPSDK_FORCEINLINE ipUInt64 act() { return 0xFFFFFFFFFFFFFFFF; }
83 };
84 
85 #define IMPLEMENT_ALLBITSTOONEREG_INT(type) \
86 template <eInstructionSet::domain IS> \
87 struct AllBitsToOneReg<IS, type> \
88 { \
89  static IPSDK_FORCEINLINE \
90  typename RegType<IS, type>::Type \
91  act() \
92  { \
93  return AssignReg<IS, ipUInt8>::act(0xFF); \
94  } \
95 };
96 
97 IMPLEMENT_ALLBITSTOONEREG_INT(ipInt8)
98 IMPLEMENT_ALLBITSTOONEREG_INT(ipUInt8)
99 IMPLEMENT_ALLBITSTOONEREG_INT(ipInt16)
100 IMPLEMENT_ALLBITSTOONEREG_INT(ipUInt16)
101 IMPLEMENT_ALLBITSTOONEREG_INT(ipInt32)
102 IMPLEMENT_ALLBITSTOONEREG_INT(ipUInt32)
103 IMPLEMENT_ALLBITSTOONEREG_INT(ipInt64)
104 IMPLEMENT_ALLBITSTOONEREG_INT(ipUInt64)
105 
106 template <eInstructionSet::domain IS>
109 {
110  static IPSDK_FORCEINLINE
112  act()
113  {
115  AssignReg<IS, ipUInt32>::act(0xFFFFFFFF));
116  }
117 };
118 
120 template <eInstructionSet::domain IS>
122 {
123  static IPSDK_FORCEINLINE
125  act()
126  {
128  AssignReg<IS, ipUInt64>::act(0xFFFFFFFFFFFFFFFF));
129  }
130 };
131 
134 
135 } // end of namespace detail
136 } // end of namespace simd
137 } // end of namespace ipsdk
138 
139 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_ALLBITSTOONEREG_H__
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
Definition: AllBitsToOneReg.h:33
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
int16_t ipInt16
Base types definition.
Definition: BaseTypes.h:50
uint8_t ipUInt8
Base types definition.
Definition: BaseTypes.h:49
RegType class.
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition of import/export macro for library.
Definition: BitwiseCastReg.h:29
int64_t ipInt64
Base types definition.
Definition: BaseTypes.h:54
compiler optimisations only
Definition: InstructionSetTypes.h:34
Definition: RegType.h:29
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
Definition: AssignRegDecl.h:31
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53