IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
FmaddReg.h
Go to the documentation of this file.
1 // FmaddReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_FMA3_FMADDREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_FMA3_FMADDREG_H__
17 
20 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/FmaddReg.h>
23 
24 #if defined __linux__
25 #include <fmaintrin.h>
26 #endif
27 
28 namespace ipsdk {
29 namespace simd {
30 namespace detail {
31 
34 
37 template <>
39 {
40  static
41  IPSDK_FORCEINLINE
43  act(const AvxType<ipReal32>::Type& in1,
44  const AvxType<ipReal32>::Type& in2,
45  const AvxType<ipReal32>::Type& in3)
46  {
47  return _mm256_fmadd_ps(in1, in2, in3);
48  }
49 
50  static
51  IPSDK_FORCEINLINE
52  void
53  act(const AvxType<ipReal32>::Type& in1,
54  const AvxType<ipReal32>::Type& in2,
55  const AvxType<ipReal32>::Type& in3,
57  {
58  out = _mm256_fmadd_ps(in1, in2, in3);
59  }
60 };
61 
64 template <>
66 {
67  static
68  IPSDK_FORCEINLINE
70  act(const AvxType<ipReal64>::Type& in1,
71  const AvxType<ipReal64>::Type& in2,
72  const AvxType<ipReal64>::Type& in3)
73  {
74  return _mm256_fmadd_pd(in1, in2, in3);
75  }
76 
77  static
78  IPSDK_FORCEINLINE
79  void
80  act(const AvxType<ipReal64>::Type& in1,
81  const AvxType<ipReal64>::Type& in2,
82  const AvxType<ipReal64>::Type& in3,
84  {
85  out = _mm256_fmadd_pd(in1, in2, in3);
86  }
87 };
88 
91 
92 } // end of namespace detail
93 } // end of namespace simd
94 } // end of namespace ipsdk
95 
96 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_FMA3_FMADDREG_H__
Fused multiply–add.
Definition: InstructionSetTypes.h:46
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: FmaddReg.h:37
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Predefined types for Avx instruction set management.
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Predefined types associated to instruction set management.
Definition of import/export macro for library.
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56