GLM  0.9.5
func_integer.hpp
1 
38 #ifndef glm_core_func_integer
39 #define glm_core_func_integer
40 
41 #include "setup.hpp"
42 
43 namespace glm
44 {
47 
56  template <typename genUType>
57  GLM_FUNC_DECL genUType uaddCarry(
58  genUType const & x,
59  genUType const & y,
60  genUType & carry);
61 
70  template <typename genUType>
71  GLM_FUNC_DECL genUType usubBorrow(
72  genUType const & x,
73  genUType const & y,
74  genUType & borrow);
75 
84  template <typename genUType>
85  GLM_FUNC_DECL void umulExtended(
86  genUType const & x,
87  genUType const & y,
88  genUType & msb,
89  genUType & lsb);
90 
99  template <typename genIType>
100  GLM_FUNC_DECL void imulExtended(
101  genIType const & x,
102  genIType const & y,
103  genIType & msb,
104  genIType & lsb);
105 
121  template <typename genIUType>
122  GLM_FUNC_DECL genIUType bitfieldExtract(
123  genIUType const & Value,
124  int const & Offset,
125  int const & Bits);
126 
141  template <typename genIUType>
142  GLM_FUNC_DECL genIUType bitfieldInsert(
143  genIUType const & Base,
144  genIUType const & Insert,
145  int const & Offset,
146  int const & Bits);
147 
156  template <typename genIUType>
157  GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value);
158 
167  template <typename T, template <typename> class genIUType>
168  GLM_FUNC_DECL typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
169 
180  template <typename T, template <typename> class genIUType>
181  GLM_FUNC_DECL typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
182 
194  template <typename T, template <typename> class genIUType>
195  GLM_FUNC_DECL typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
196 
198 }//namespace glm
199 
200 #include "func_integer.inl"
201 
202 #endif//glm_core_func_integer
203 
GLM_FUNC_DECL genIUType< T >::signed_type findLSB(genIUType< T > const &Value)
Returns the bit number of the least significant bit set to 1 in the binary representation of value...
GLM_FUNC_DECL genIUType< T >::signed_type bitCount(genIUType< T > const &Value)
Returns the number of bits set to 1 in the binary representation of value.
GLM_FUNC_DECL void imulExtended(genIType const &x, genIType const &y, genIType &msb, genIType &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL genIUType bitfieldExtract(genIUType const &Value, int const &Offset, int const &Bits)
Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of...
GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const &Value)
Returns the reversal of the bits of value.
GLM_FUNC_DECL void umulExtended(genUType const &x, genUType const &y, genUType &msb, genUType &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL genIUType bitfieldInsert(genIUType const &Base, genIUType const &Insert, int const &Offset, int const &Bits)
Returns the insertion the bits least-significant bits of insert into base.
GLM_FUNC_DECL genIUType< T >::signed_type findMSB(genIUType< T > const &Value)
Returns the bit number of the most significant bit in the binary representation of value...
GLM_FUNC_DECL genUType uaddCarry(genUType const &x, genUType const &y, genUType &carry)
Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32).
GLM_FUNC_DECL genUType usubBorrow(genUType const &x, genUType const &y, genUType &borrow)
Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise.