IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IfMaskAllOnesElseZeroPack.h
Go to the documentation of this file.
1 // IfMaskAllOnesElseZeroPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_IFMASKALLONESELSEZEROPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_IFMASKALLONESELSEZEROPACK_H__
17 
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 
28 
29 template <typename T>
30 struct IfMaskAllOnesElseZeroPack<eInstructionSet::eIS_Standard, T>
31 {
32  static IPSDK_FORCEINLINE
35  {
37  //const T maskT = -static_cast<T>(mask._val != 0);
38  //out._val = in._val & maskT;
39  out._val = mask._val ?
42  return out;
43  }
44 
45  static IPSDK_FORCEINLINE
46  void
51  {
52  out._val = mask._val ?
55  }
56 };
57 
60 
61 } // end of namespace detail
62 } // end of namespace simd
63 } // end of namespace ipsdk
64 
65 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_STD_IFMASKALLONESELSEZEROPACK_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: AllBitsToOneReg.h:33
BasePack class; defines a set of scalars (for instruction set "standard") or registers (for all other...
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition of import/export macro for library.
Definition: AllBitsToZeroReg.h:31
compiler optimisations only
Definition: InstructionSetTypes.h:34