IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BitwiseCastReg.h
Go to the documentation of this file.
1 // BitwiseCastReg.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX512_BITWISECASTREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX512_BITWISECASTREG_H__
17 
23 #include <boost/mpl/and.hpp>
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 
31 
32 template <typename TIn, typename TOut>
35  TIn,
36  TOut,
37  typename boost::enable_if<
38  typename boost::mpl::and_<
39  typename boost::is_integral<TIn>::type,
40  typename boost::is_integral<TOut>::type
41  >::type
42  >::type>
43 {
44 
45  static IPSDK_FORCEINLINE
46  typename Avx512Type<TOut>::Type
47  act(const typename Avx512Type<TIn>::Type& in)
48  {
49  return in;
50  }
51 
52  static IPSDK_FORCEINLINE
53  void
54  act(const typename Avx512Type<TIn>::Type& in,
55  typename Avx512Type<TOut>::Type& out)
56  {
57  out = in;
58  }
59 };
60 
61 template <typename TIn>
63  typename boost::enable_if<typename boost::is_integral<TIn>::type>::type>
64 {
65 
66  static IPSDK_FORCEINLINE
68  act(const typename Avx512Type<TIn>::Type& in)
69  {
70  return _mm512_castsi512_ps(in);
71  }
72 
73  static IPSDK_FORCEINLINE
74  void
75  act(const typename Avx512Type<TIn>::Type& in,
77  {
78  out = _mm512_castsi512_ps(in);
79  }
80 
81  static IPSDK_FORCEINLINE
82  void
83  act(const typename Avx512MaskType<TIn>::Type& in,
85  {
86  out = in;
87  }
88 };
89 
90 template <typename TOut>
92  typename boost::enable_if<typename boost::is_integral<TOut>::type>::type>
93 {
94  static IPSDK_FORCEINLINE
96  {
97  return _mm512_castps_si512(in);
98  }
99 
100  static IPSDK_FORCEINLINE
101  void
102  act(const Avx512Type<ipReal32>::Type& in,
103  typename Avx512Type<TOut>::Type& out)
104  {
105  out = _mm512_castps_si512(in);
106  }
107 
108  static IPSDK_FORCEINLINE
109  void
110  act(const Avx512MaskType<ipReal32>::Type& in,
111  typename Avx512MaskType<TOut>::Type& out)
112  {
113  out = in;
114  }
115 };
116 
117 template <typename TIn>
119  typename boost::enable_if<typename boost::is_integral<TIn>::type>::type>
120 {
121 
122  static IPSDK_FORCEINLINE
124  act(const typename Avx512Type<TIn>::Type& in)
125  {
126  return _mm512_castsi512_pd(in);
127  }
128 
129  static IPSDK_FORCEINLINE
130  void
131  act(const typename Avx512Type<TIn>::Type& in,
133  {
134  out = _mm512_castsi512_pd(in);
135  }
136 
137  static IPSDK_FORCEINLINE
138  void
139  act(const typename Avx512MaskType<TIn>::Type& in,
141  {
142  out = in;
143  }
144 };
145 
146 template <typename TOut>
148  typename boost::enable_if<typename boost::is_integral<TOut>::type>::type>
149 {
150  static IPSDK_FORCEINLINE
151  typename Avx512Type<TOut>::Type act(const Avx512Type<ipReal64>::Type& in)
152  {
153  return _mm512_castpd_si512(in);
154  }
155 
156  static IPSDK_FORCEINLINE
157  void
158  act(const Avx512Type<ipReal64>::Type& in,
159  typename Avx512Type<TOut>::Type& out)
160  {
161  out = _mm512_castpd_si512(in);
162  }
163 
164  static IPSDK_FORCEINLINE
165  void
166  act(const Avx512MaskType<ipReal64>::Type& in,
167  typename Avx512MaskType<TOut>::Type& out)
168  {
169  out = in;
170  }
171 };
172 
175 
176 } // end of namespace detail
177 } // end of namespace simd
178 } // end of namespace ipsdk
179 
180 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX512_BITWISECASTREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
Predefined mask types for Avx512 instruction set management.
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Predefined types for Avx512 instruction set management.
Definition: Avx512MaskTypes.h:36
Definition of import/export macro for library.
Definition: BitwiseCastReg.h:29
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure used to retrieve AVX512 type associated to a base type
Definition: Avx512Types.h:36