IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AssignRegImpl.h
Go to the documentation of this file.
1 // AssignRegImpl.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNREGIMPL_H__
17 
19 
20 namespace ipsdk {
21 namespace simd {
22 namespace detail {
23 
26 
27 // load implementation for AVX for int32 types
28 IPSDK_FORCEINLINE
29 AvxType<ipInt32>::Type
30 AssignReg<eInstructionSet::eIS_Avx, ipInt32>::act(const ipInt32& value)
31 {
32  return _mm256_set1_epi32(value);
33 }
34 
35 IPSDK_FORCEINLINE
36 void
37 AssignReg<eInstructionSet::eIS_Avx, ipInt32>::act(AvxType<ipInt32>::Type& reg,
38  const ipInt32& value)
39 {
40  reg = _mm256_set1_epi32(value);
41 }
42 
43 // load implementation for AVX for real32 types
44 IPSDK_FORCEINLINE
45 AvxType<ipReal32>::Type
46 AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(const ipReal32& value)
47 {
48  return _mm256_set1_ps(value);
49 }
50 
51 IPSDK_FORCEINLINE
52 void
53 AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(AvxType<ipReal32>::Type& reg,
54  const ipReal32& value)
55 {
56  reg = _mm256_set1_ps(value);
57 }
58 
59 // load implementation for AVX for real64 types
60 IPSDK_FORCEINLINE
61 AvxType<ipReal64>::Type
62 AssignReg<eInstructionSet::eIS_Avx, ipReal64>::act(const ipReal64& value)
63 {
64  return _mm256_set1_pd(value);
65 }
66 
67 IPSDK_FORCEINLINE
68 void
69 AssignReg<eInstructionSet::eIS_Avx, ipReal64>::act(AvxType<ipReal64>::Type& reg,
70  const ipReal64& value)
71 {
72  reg = _mm256_set1_pd(value);
73 }
74 
77 
78 } // end of namespace detail
79 } // end of namespace simd
80 } // end of namespace ipsdk
81 
82 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNREGIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
float ipReal32
Base types definition.
Definition: BaseTypes.h:56