15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_SIGNEDUNSIGNEDOPREG_H__ 16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_SIGNEDUNSIGNEDOPREG_H__ 19 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/SignedUnsignedOpReg.h> 22 #include <boost/type_traits/make_unsigned.hpp> 42 typedef T result_type;
44 static IPSDK_FORCEINLINE result_type act(T x, T y)
49 static IPSDK_FORCEINLINE result_type act(T x, T y, result_type& out)
61 typedef typename boost::make_unsigned<T>::type result_type;
63 static IPSDK_FORCEINLINE result_type act(T x, T y)
66 return result_type(x) - result_type(y);
69 return result_type(x) + result_type(-(y+1)) + 1;
71 return result_type(x - y);
74 static IPSDK_FORCEINLINE
void act(T x, T y, result_type& out)
77 out =result_type(x) - result_type(y);
80 out = result_type(x) + result_type(-(y+1)) + 1;
83 out = result_type(x - y);
94 template<
typename T1,
typename T2>
98 typedef T2 result_type;
99 static IPSDK_FORCEINLINE result_type act(T1 x, T2 y)
104 static IPSDK_FORCEINLINE
void act(T1 x, T2 y, result_type& out)
112 template<
typename T1,
typename T2>
116 typedef T2 result_type;
117 static IPSDK_FORCEINLINE result_type act(T1 x, T2 y)
124 return T2(x - T1(-(y+1)) - 1);
129 static IPSDK_FORCEINLINE
void act(T1 x, T2 y, result_type& out)
134 else if (x > T1(-(y+1)))
136 out = T2(x - T1(-(y+1)) - 1);
150 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_ADDREG_H__ Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: SignedUnsignedOpReg.h:69
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Definition of import/export macro for library.
compiler optimisations only
Definition: InstructionSetTypes.h:34
Definition: SignedUnsignedOpReg.h:51