IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AbsReg.h
Go to the documentation of this file.
1 // AbsReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_ABS512_ADDREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_ABS512_ADDREG_H__
17 
20 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/AbsReg.h>
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
32 template <>
34 {
35  static IPSDK_FORCEINLINE
37  act(const Avx512Type<ipInt8>::Type& in)
38  {
39  return _mm512_abs_epi8(in);
40  }
41 
42  static IPSDK_FORCEINLINE
43  void
44  act(const Avx512Type<ipInt8>::Type& in,
46  {
47  out = _mm512_abs_epi8(in);
48  }
49 };
50 
53 template <>
55 {
56  static IPSDK_FORCEINLINE
58  act(const Avx512Type<ipInt16>::Type& in)
59  {
60  return _mm512_abs_epi16(in);
61  }
62 
63  static IPSDK_FORCEINLINE
64  void
65  act(const Avx512Type<ipInt16>::Type& in,
67  {
68  out = _mm512_abs_epi16(in);
69  }
70 };
71 
74 template <>
76 {
77  static IPSDK_FORCEINLINE
79  act(const Avx512Type<ipInt32>::Type& in)
80  {
81  return _mm512_abs_epi32(in);
82  }
83 
84  static IPSDK_FORCEINLINE
85  void
86  act(const Avx512Type<ipInt32>::Type& in,
88  {
89  out = _mm512_abs_epi32(in);
90  }
91 };
92 
95 template <>
97 {
98  static IPSDK_FORCEINLINE
100  act(const Avx512Type<ipReal32>::Type& in)
101  {
102  return _mm512_abs_ps(in);
103  }
104 
105  static IPSDK_FORCEINLINE
106  void
107  act(const Avx512Type<ipReal32>::Type& in,
109  {
110  out = _mm512_abs_ps(in);
111  }
112 };
113 
116 template <>
118 {
119  static IPSDK_FORCEINLINE
121  act(const Avx512Type<ipReal64>::Type& in)
122  {
123 #ifdef IPSDK_WINDOWS
124  return _mm512_abs_pd(in);
125 #else
126  Avx512Type<ipReal64>::Type mzero, notmzero;
130 #endif
131  }
132 
133  static IPSDK_FORCEINLINE
134  void
135  act(const Avx512Type<ipReal64>::Type& in,
137  {
138 #ifdef IPSDK_WINDOWS
139  out = _mm512_abs_pd(in);
140 #else
141  Avx512Type<ipReal64>::Type mzero, notmzero;
145 #endif
146  }
147 };
150 
151 } // end of namespace detail
152 } // end of namespace simd
153 } // end of namespace ipsdk
154 
155 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX512_ABSREG_H__
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: BitwiseNotRegDecl.h:30
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
int16_t ipInt16
Base types definition.
Definition: BaseTypes.h:50
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Predefined types for Avx512 instruction set management.
Definition of import/export macro for library.
template structure which is specialized to implement the computation of abs function on a scalar or a...
Definition: AbsReg.h:46
Definition: BitwiseAndReg.h:30
Definition: AssignRegDecl.h:31
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure used to retrieve AVX512 type associated to a base type
Definition: Avx512Types.h:36