PSMoveService
func_integer.hpp
Go to the documentation of this file.
1 
38 #ifndef glm_core_func_integer
39 #define glm_core_func_integer GLM_VERSION
40 
41 namespace glm
42 {
45 
54  template <typename genUType>
55  genUType uaddCarry(
56  genUType const & x,
57  genUType const & y,
58  genUType & carry);
59 
68  template <typename genUType>
69  genUType usubBorrow(
70  genUType const & x,
71  genUType const & y,
72  genUType & borrow);
73 
82  template <typename genUType>
83  void umulExtended(
84  genUType const & x,
85  genUType const & y,
86  genUType & msb,
87  genUType & lsb);
88 
97  template <typename genIType>
98  void imulExtended(
99  genIType const & x,
100  genIType const & y,
101  genIType & msb,
102  genIType & lsb);
103 
119  template <typename genIUType>
120  genIUType bitfieldExtract(
121  genIUType const & Value,
122  int const & Offset,
123  int const & Bits);
124 
139  template <typename genIUType>
140  genIUType bitfieldInsert(
141  genIUType const & Base,
142  genIUType const & Insert,
143  int const & Offset,
144  int const & Bits);
145 
154  template <typename genIUType>
155  genIUType bitfieldReverse(genIUType const & value);
156 
165  template <typename T, template <typename> class genIUType>
166  typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
167 
178  template <typename T, template <typename> class genIUType>
179  typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
180 
192  template <typename T, template <typename> class genIUType>
193  typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
194 
196 }//namespace glm
197 
198 #include "func_integer.inl"
199 
200 #endif//glm_core_func_integer
201 
genIUType< T >::signed_type findMSB(genIUType< T > const &Value)
Returns the bit number of the most significant bit in the binary representation of value...
void imulExtended(genIType const &x, genIType const &y, genIType &msb, genIType &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
Definition: func_integer.inl:217
Definition: _detail.hpp:38
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...
genIUType bitfieldReverse(genIUType const &value)
Returns the reversal of the bits of value.
Definition: func_integer.inl:407
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).
Definition: func_integer.inl:40
genIUType< T >::signed_type bitCount(genIUType< T > const &Value)
Returns the number of bits set to 1 in the binary representation of value.
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...
Definition: func_integer.inl:279
void umulExtended(genUType const &x, genUType const &y, genUType &msb, genUType &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
Definition: func_integer.inl:155
OpenGL Mathematics (glm.g-truc.net)
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.
Definition: func_integer.inl:97
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.
Definition: func_integer.inl:340