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_AVX_BITWISECASTREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_BITWISECASTREG_H__
17 
22 #include <boost/mpl/and.hpp>
23 
24 namespace ipsdk {
25 namespace simd {
26 namespace detail {
27 
30 
31 template <typename TIn>
33  typename boost::enable_if<typename boost::mpl::and_<typename boost::mpl::equal_to<boost::mpl::int_<sizeof(TIn)>, boost::mpl::int_<4> >::type,
34  typename boost::is_integral<TIn>::type>::type>::type>
35 {
36 
37  static IPSDK_FORCEINLINE
39  act(const typename AvxType<TIn>::Type& in)
40  {
41  return _mm256_castsi256_ps(in);
42  }
43 
44  static IPSDK_FORCEINLINE
45  void
46  act(const typename AvxType<TIn>::Type& in,
47  typename AvxType<ipReal32>::Type& out)
48  {
49  out = _mm256_castsi256_ps(in);
50  }
51 };
52 
53 template <typename TOut>
55  typename boost::enable_if<typename boost::mpl::and_<typename boost::mpl::equal_to<boost::mpl::int_<sizeof(TOut)>, boost::mpl::int_<4> >::type,
56  typename boost::is_integral<TOut>::type>::type>::type>
57 {
58 
59  static IPSDK_FORCEINLINE
60  typename AvxType<TOut>::Type act(const typename AvxType<ipReal32>::Type& in)
61  {
62  return _mm256_castps_si256(in);
63  }
64 
65  static IPSDK_FORCEINLINE
66  void
67  act(const typename AvxType<ipReal32>::Type& in,
68  typename AvxType<TOut>::Type& out)
69  {
70  out = _mm256_castps_si256(in);
71  }
72 };
73 
76 
77 } // end of namespace detail
78 } // end of namespace simd
79 } // end of namespace ipsdk
80 
81 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_BITWISECASTREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Predefined types for Avx instruction set management.
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions.
Definition: InstructionSetTypes.h:44
Definition of import/export macro for library.
Definition: BitwiseCastReg.h:29
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56