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_SSE2_SHIFTRIGHTREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_SHIFTRIGHTREG_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
32 template <>
34 {
35  static IPSDK_FORCEINLINE
37  act(const Sse2Type<ipUInt16>::Type& in,
38  ipUInt8 nbBits)
39  {
40  return _mm_srli_epi16(in, nbBits);
41  }
42 
43  static IPSDK_FORCEINLINE
44  void
45  act(const Sse2Type<ipUInt16>::Type& in,
46  ipUInt8 nbBits,
48  {
49  out = _mm_srli_epi16(in, nbBits);
50  }
51 };
52 
55 template <>
57 {
58  static IPSDK_FORCEINLINE
60  act(const Sse2Type<ipInt16>::Type& in,
61  ipUInt8 nbBits)
62  {
63  return _mm_srai_epi16(in, nbBits);
64  }
65 
66  static IPSDK_FORCEINLINE
67  void
68  act(const Sse2Type<ipInt16>::Type& in,
69  ipUInt8 nbBits,
71  {
72  out = _mm_srai_epi16(in, nbBits);
73  }
74 };
75 
78 template <>
80 {
81  static IPSDK_FORCEINLINE
83  act(const Sse2Type<ipUInt32>::Type& in,
84  ipUInt8 nbBits)
85  {
86  return _mm_srli_epi32(in, nbBits);
87  }
88 
89  static IPSDK_FORCEINLINE
90  void
91  act(const Sse2Type<ipUInt32>::Type& in,
92  ipUInt8 nbBits,
94  {
95  out = _mm_srli_epi32(in, nbBits);
96  }
97 };
98 
101 template <>
103 {
104  static IPSDK_FORCEINLINE
106  act(const Sse2Type<ipInt32>::Type& in,
107  ipUInt8 nbBits)
108  {
109  return _mm_srai_epi32(in, nbBits);
110  }
111 
112  static IPSDK_FORCEINLINE
113  void
114  act(const Sse2Type<ipInt32>::Type& in,
115  ipUInt8 nbBits,
117  {
118  out = _mm_srai_epi32(in, nbBits);
119  }
120 };
121 
124 template <>
126 {
127  static IPSDK_FORCEINLINE
129  act(const Sse2Type<ipUInt8>::Type& in,
130  ipUInt8 nbBits)
131  {
132  Sse2Type<ipUInt16>::Type in16l, in16h;
138  return out;
139  }
140 
141  static IPSDK_FORCEINLINE
142  void
143  act(const Sse2Type<ipUInt8>::Type& in,
144  ipUInt8 nbBits,
146  {
147  Sse2Type<ipUInt16>::Type in16l, in16h;
152  }
153 };
154 
157 template <>
159 {
160  static IPSDK_FORCEINLINE
162  act(const Sse2Type<ipInt8>::Type& in,
163  ipUInt8 nbBits)
164  {
165  Sse2Type<ipInt16>::Type in16l, in16h;
171  return out;
172  }
173 
174  static IPSDK_FORCEINLINE
175  void
176  act(const Sse2Type<ipInt8>::Type& in,
177  ipUInt8 nbBits,
179  {
180  Sse2Type<ipInt16>::Type in16l, in16h;
185  }
186 };
187 
190 
191 } // end of namespace detail
192 } // end of namespace simd
193 } // end of namespace ipsdk
194 
195 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_SSE2_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
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
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53