0.9.7
func_integer.hpp
Go to the documentation of this file.
1 
42 #pragma once
43 
44 #include "setup.hpp"
45 #include "precision.hpp"
46 #include "func_common.hpp"
48 
49 namespace glm
50 {
53 
62  template <precision P, template <typename, precision> class vecType>
63  GLM_FUNC_DECL vecType<uint, P> uaddCarry(
64  vecType<uint, P> const & x,
65  vecType<uint, P> const & y,
66  vecType<uint, P> & carry);
67 
76  template <precision P, template <typename, precision> class vecType>
77  GLM_FUNC_DECL vecType<uint, P> usubBorrow(
78  vecType<uint, P> const & x,
79  vecType<uint, P> const & y,
80  vecType<uint, P> & borrow);
81 
90  template <precision P, template <typename, precision> class vecType>
91  GLM_FUNC_DECL void umulExtended(
92  vecType<uint, P> const & x,
93  vecType<uint, P> const & y,
94  vecType<uint, P> & msb,
95  vecType<uint, P> & lsb);
96 
105  template <precision P, template <typename, precision> class vecType>
106  GLM_FUNC_DECL void imulExtended(
107  vecType<int, P> const & x,
108  vecType<int, P> const & y,
109  vecType<int, P> & msb,
110  vecType<int, P> & lsb);
111 
127  template <typename T, precision P, template <typename, precision> class vecType>
128  GLM_FUNC_DECL vecType<T, P> bitfieldExtract(
129  vecType<T, P> const & Value,
130  int Offset,
131  int Bits);
132 
147  template <typename T, precision P, template <typename, precision> class vecType>
148  GLM_FUNC_DECL vecType<T, P> bitfieldInsert(
149  vecType<T, P> const & Base,
150  vecType<T, P> const & Insert,
151  int Offset,
152  int Bits);
153 
162  template <typename T, precision P, template <typename, precision> class vecType>
163  GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v);
164 
171  template <typename genType>
172  GLM_FUNC_DECL int bitCount(genType v);
173 
180  template <typename T, precision P, template <typename, precision> class vecType>
181  GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v);
182 
191  template <typename genIUType>
192  GLM_FUNC_DECL int findLSB(genIUType x);
193 
202  template <typename T, precision P, template <typename, precision> class vecType>
203  GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v);
204 
214  template <typename genIUType>
215  GLM_FUNC_DECL int findMSB(genIUType x);
216 
226  template <typename T, precision P, template <typename, precision> class vecType>
227  GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v);
228 
230 }//namespace glm
231 
232 #include "func_integer.inl"
GLM_FUNC_DECL vecType< T, P > bitfieldInsert(vecType< T, P > const &Base, vecType< T, P > const &Insert, int Offset, int Bits)
Returns the insertion the bits least-significant bits of insert into base.
GLM_FUNC_DECL vecType< uint, P > usubBorrow(vecType< uint, P > const &x, vecType< uint, P > const &y, vecType< uint, P > &borrow)
Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise.
GLM_FUNC_DECL vecType< T, P > bitfieldExtract(vecType< T, P > const &Value, int Offset, int Bits)
Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of...
GLM_FUNC_DECL vecType< int, P > findLSB(vecType< T, P > const &v)
Returns the bit number of the least significant bit set to 1 in the binary representation of value...
GLM_FUNC_DECL vecType< int, P > findMSB(vecType< T, P > const &v)
Returns the bit number of the most significant bit in the binary representation of value...
GLM_FUNC_DECL vecType< T, P > bitfieldReverse(vecType< T, P > const &v)
Returns the reversal of the bits of value.
GLM_FUNC_DECL vecType< uint, P > uaddCarry(vecType< uint, P > const &x, vecType< uint, P > const &y, vecType< uint, P > &carry)
Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32).
GLM_FUNC_DECL void umulExtended(vecType< uint, P > const &x, vecType< uint, P > const &y, vecType< uint, P > &msb, vecType< uint, P > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL void imulExtended(vecType< int, P > const &x, vecType< int, P > const &y, vecType< int, P > &msb, vecType< int, P > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
OpenGL Mathematics (glm.g-truc.net)
Definition: _noise.hpp:40
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
GLM_FUNC_DECL vecType< int, P > bitCount(vecType< T, P > const &v)
Returns the number of bits set to 1 in the binary representation of value.
OpenGL Mathematics (glm.g-truc.net)