16 #ifndef __IPSDKUTIL_ALIGNEDARITHMETIC_H__ 17 #define __IPSDKUTIL_ALIGNEDARITHMETIC_H__ 19 #include <IPSDKUtil/InstructionSet/Pack.h> 35 template <ipsdk::eInstructionSet::domain IS,
37 static IPSDK_FORCEINLINE
void 38 alignedAdd(
const BufType* pInputBuf,
42 simd::Pack<IS, BufType> inputPack, inOutPack;
43 for(
ipUInt64 k=0; k<size; k+=simd::NbEltsPerOp<IS>::Value) {
45 simd::load<IS>(inputPack, pInputBuf + k);
46 simd::load<IS>(inOutPack, pInOutBuf + k);
47 simd::add<IS>(inOutPack, inputPack, inOutPack);
48 simd::unload<IS>(inOutPack, pInOutBuf + k);
56 template <ipsdk::eInstructionSet::domain IS,
58 static IPSDK_FORCEINLINE
void 59 alignedSub(
const BufType* pInputBuf,
63 simd::Pack<IS, BufType> inputPack, inOutPack;
64 for(
ipUInt64 k=0; k<size; k+=simd::NbEltsPerOp<IS>::Value) {
66 simd::load<IS>(inputPack, pInputBuf + k);
67 simd::load<IS>(inOutPack, pInOutBuf + k);
68 simd::sub<IS>(inOutPack, inputPack, inOutPack);
69 simd::unload<IS>(inOutPack, pInOutBuf + k);
76 template <ipsdk::eInstructionSet::domain IS,
79 static IPSDK_FORCEINLINE
void 80 alignedRound(
const BufInType* pInputBuf,
82 BufOutType* pOutputBuf)
84 simd::Pack<IS, BufInType> inputPack;
85 simd::Pack<IS, BufOutType> outputPack;
86 for(
ipUInt64 k=0; k<size; k+=simd::NbEltsPerOp<IS>::Value) {
88 simd::load<IS>(inputPack, pInputBuf + k);
89 simd::round<IS>(inputPack, outputPack);
90 simd::unload<IS>(outputPack, pOutputBuf + k);
100 #endif // __IPSDKUTIL_ALIGNEDARITHMETIC_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
round function; returns the round values of the elements of a pack
load function; loads a buffer into a pack
sub function; returns the result of an arithmetic substraction on all the elements of 2 input pack op...
unload function; unloads a pack into a memory buffer
add function; returns the result of an arithmetic add operation on all the elements of 2 input pack o...