IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ShiftRightReg.h
Go to the documentation of this file.
1 // ShiftRightReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_SHIFTRIGHTREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_SHIFTRIGHTREG_H__
17 
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 
28 
31 template <>
33 {
34  static IPSDK_FORCEINLINE
36  act(const Avx512Type<ipUInt16>::Type& in,
37  ipUInt8 nbBits)
38  {
39  return _mm512_srli_epi16(in, nbBits);
40  }
41 
42  static IPSDK_FORCEINLINE
43  void
44  act(const Avx512Type<ipUInt16>::Type& in,
45  ipUInt8 nbBits,
47  {
48  out = _mm512_srli_epi16(in, nbBits);
49  }
50 };
51 
54 template <>
56 {
57  static IPSDK_FORCEINLINE
59  act(const Avx512Type<ipInt16>::Type& in,
60  ipUInt8 nbBits)
61  {
62  return _mm512_srai_epi16(in, nbBits);
63  }
64 
65  static IPSDK_FORCEINLINE
66  void
67  act(const Avx512Type<ipInt16>::Type& in,
68  ipUInt8 nbBits,
70  {
71  out = _mm512_srai_epi16(in, nbBits);
72  }
73 };
74 
75 
76 
79 template <>
81 {
82  static IPSDK_FORCEINLINE
84  act(const Avx512Type<ipUInt32>::Type& in,
85  ipUInt8 nbBits)
86  {
87  return _mm512_srli_epi32(in, nbBits);
88  }
89 
90  static IPSDK_FORCEINLINE
91  void
92  act(const Avx512Type<ipUInt32>::Type& in,
93  ipUInt8 nbBits,
95  {
96  out = _mm512_srli_epi32(in, nbBits);
97  }
98 };
99 
102 template <>
104 {
105  static IPSDK_FORCEINLINE
107  act(const Avx512Type<ipInt32>::Type& in,
108  ipUInt8 nbBits)
109  {
110  return _mm512_srai_epi32(in, nbBits);
111  }
112 
113  static IPSDK_FORCEINLINE
114  void
115  act(const Avx512Type<ipInt32>::Type& in,
116  ipUInt8 nbBits,
118  {
119  out = _mm512_srai_epi32(in, nbBits);
120  }
121 };
122 
125 template <>
127 {
128  static IPSDK_FORCEINLINE
130  act(const Avx512Type<ipUInt8>::Type& in,
131  ipUInt8 nbBits)
132  {
133  Avx512Type<ipUInt16>::Type in16l, in16h;
139  return out;
140  }
141 
142  static IPSDK_FORCEINLINE
143  void
144  act(const Avx512Type<ipUInt8>::Type& in,
145  ipUInt8 nbBits,
147  {
148  Avx512Type<ipUInt16>::Type in16l, in16h;
153  }
154 };
155 
158 template <>
160 {
161  static IPSDK_FORCEINLINE
163  act(const Avx512Type<ipInt8>::Type& in,
164  ipUInt8 nbBits)
165  {
166  Avx512Type<ipInt16>::Type in16l, in16h;
172  return out;
173  }
174 
175  static IPSDK_FORCEINLINE
176  void
177  act(const Avx512Type<ipInt8>::Type& in,
178  ipUInt8 nbBits,
180  {
181  Avx512Type<ipInt16>::Type in16l, in16h;
186  }
187 };
188 
191 
192 } // end of namespace detail
193 } // end of namespace simd
194 } // end of namespace ipsdk
195 
196 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_SHIFTRIGHTPACK_H__
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
Definition: CastReg.h:30
int16_t ipInt16
Base types definition.
Definition: BaseTypes.h:50
uint8_t ipUInt8
Base types definition.
Definition: BaseTypes.h:49
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition of import/export macro for library.
Definition: ShiftRightReg.h:30
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53
structure used to retrieve AVX512 type associated to a base type
Definition: Avx512Types.h:36