IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
InstructionSetArithmeticUtils.h
1 // InstructionSetUtils.h:
3 // ----------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSETUTILS_H__
16 #define __IPSDKUTIL_INSTRUCTIONSETUTILS_H__
17 
18 #include <IPSDKUtil/InstructionSet/Pack.h>
22 
23 namespace ipsdk {
24 namespace simd {
25 
28 
30 template <ipsdk::eInstructionSet::domain IS, typename T>
31 IPSDK_FORCEINLINE
32 void complexMultiply(const simd::Pack<IS, T>& packIn1Re,
33  const simd::Pack<IS, T>& packIn1Im,
34  const simd::Pack<IS, T>& packIn2Re,
35  const simd::Pack<IS, T>& packIn2Im,
36  simd::Pack<IS, T>& packOutRe,
37  simd::Pack<IS, T>& packOutIm)
38 {
39  simd::Pack<IS, T> packOp1, packOp2;
40 
41  simd::mul<IS>(packIn1Re, packIn2Re, packOp1);
42  simd::mul<IS>(packIn1Im, packIn2Im, packOp2);
43  simd::sub<IS>(packOp1, packOp2, packOutRe);
44 
45  simd::mul<IS>(packIn1Re, packIn2Im, packOp1);
46  simd::mul<IS>(packIn1Im, packIn2Re, packOp2);
47  simd::add<IS>(packOp1, packOp2, packOutIm);
48 }
49 
52 
53 } // end of namespace simd
54 } // end of namespace ipsdk
55 
56 #endif // __IPSDKUTIL_INSTRUCTIONSETUTILS_H__
Definition: PackDecl.h:30
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
IPSDK_FORCEINLINE void complexMultiply(const simd::Pack< IS, T > &packIn1Re, const simd::Pack< IS, T > &packIn1Im, const simd::Pack< IS, T > &packIn2Re, const simd::Pack< IS, T > &packIn2Im, simd::Pack< IS, T > &packOutRe, simd::Pack< IS, T > &packOutIm)
Complex multiplication.
Definition: InstructionSetArithmeticUtils.h:32
mul function; returns the product of 2 input pack operandes
sub function; returns the result of an arithmetic substraction on all the elements of 2 input pack op...
add function; returns the result of an arithmetic add operation on all the elements of 2 input pack o...