IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LdexpReg.h
Go to the documentation of this file.
1 // LdexpReg.h:
3 // -------------------
4 //
13 
14 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_COMMON_LDEXPREG_H__
15 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_COMMON_LDEXPREG_H__
16 
20 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/AddReg.h>
27 
28 namespace ipsdk {
29 namespace simd {
30 namespace detail {
31 
34 
36 template <eInstructionSet::domain IS>
37 struct LdexpReg<IS, ipReal32>
38 {
39  static IPSDK_FORCEINLINE
41  act(const typename RegType<IS, ipReal32>::Type& x,
42  const typename RegType<IS, ipInt32>::Type& exp)
43  {
44  typename RegType<IS, ipReal32>::Type out;
45  act(x, exp, out);
46  return out;
47  }
48 
49 
50  static IPSDK_FORCEINLINE
51  void
52  act(const typename RegType<IS, ipReal32>::Type& x,
53  const typename RegType<IS, ipInt32>::Type& exp,
54  typename RegType<IS, ipReal32>::Type& out)
55  {
56  typedef typename RegType<IS, ipReal32>::Type Reg;
57  typedef typename RegType<IS, ipInt32>::Type RegInt32;
58 
59  RegInt32 regM126, reg127;
60  AssignReg<IS, ipInt32>::act(regM126, -126);
61  AssignReg<IS, ipInt32>::act(reg127, 127);
62  RegInt32 newExp;
63  MaxReg<IS, ipInt32>::act(exp, regM126, newExp);
64  MinReg<IS, ipInt32>::act(newExp, reg127, newExp);
65  AddReg<IS, ipInt32>::act(newExp, reg127, newExp);
66  ShiftLeftReg<IS, ipInt32>::act(newExp, 23, newExp);
67  Reg newExpReal32;
68  BitwiseCastReg<IS, ipInt32, ipReal32>::act(newExp, newExpReal32);
69  MulReg<IS, ipReal32>::act(x, newExpReal32, out);
70 
71  }
72 };
73 
76 
77 } // end of namespace detail
78 } // end of namespace simd
79 } // end of namespace ipsdk
80 
81 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_SSE2_POWREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: MinRegDecl.h:29
template structure which is specialized to implement the minimum computation on 2 scalars or 2 regist...
template structure which is specialized to implement the maximum computation on 2 scalars or 2 regist...
RegType class.
Definition: ShiftLeftReg.h:30
Definition: MaxRegDecl.h:29
Definition of import/export macro for library.
template structure which is specialized to implement the arithmetic addition on 2 scalars or 2 regist...
Definition: AddReg.h:37
Definition: MulReg.h:39
Definition: BitwiseCastReg.h:29
template structure which is specialized to implement the computation of ldexp function on scalars or ...
Definition: LdexpReg.h:38
Definition: RegType.h:29
Definition: AssignRegDecl.h:31
float ipReal32
Base types definition.
Definition: BaseTypes.h:56