0.9.6
func_integer.hpp
Go to the documentation of this file.
1 
38 #pragma once
39 
40 #include "setup.hpp"
41 #include "precision.hpp"
42 #include "func_common.hpp"
44 
45 namespace glm
46 {
49 
58  template <precision P, template <typename, precision> class vecType>
59  GLM_FUNC_DECL vecType<uint, P> uaddCarry(
60  vecType<uint, P> const & x,
61  vecType<uint, P> const & y,
62  vecType<uint, P> & carry);
63 
72  template <precision P, template <typename, precision> class vecType>
73  GLM_FUNC_DECL vecType<uint, P> usubBorrow(
74  vecType<uint, P> const & x,
75  vecType<uint, P> const & y,
76  vecType<uint, P> & borrow);
77 
86  template <precision P, template <typename, precision> class vecType>
87  GLM_FUNC_DECL void umulExtended(
88  vecType<uint, P> const & x,
89  vecType<uint, P> const & y,
90  vecType<uint, P> & msb,
91  vecType<uint, P> & lsb);
92 
101  template <precision P, template <typename, precision> class vecType>
102  GLM_FUNC_DECL void imulExtended(
103  vecType<int, P> const & x,
104  vecType<int, P> const & y,
105  vecType<int, P> & msb,
106  vecType<int, P> & lsb);
107 
123  template <typename T, precision P, template <typename, precision> class vecType>
124  GLM_FUNC_DECL vecType<T, P> bitfieldExtract(
125  vecType<T, P> const & Value,
126  int Offset,
127  int Bits);
128 
143  template <typename T, precision P, template <typename, precision> class vecType>
144  GLM_FUNC_DECL vecType<T, P> bitfieldInsert(
145  vecType<T, P> const & Base,
146  vecType<T, P> const & Insert,
147  int Offset,
148  int Bits);
149 
158  template <typename T, precision P, template <typename, precision> class vecType>
159  GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v);
160 
167  template <typename genType>
168  GLM_FUNC_DECL int bitCount(genType v);
169 
176  template <typename T, precision P, template <typename, precision> class vecType>
177  GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v);
178 
187  template <typename genIUType>
188  GLM_FUNC_DECL int findLSB(genIUType x);
189 
198  template <typename T, precision P, template <typename, precision> class vecType>
199  GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v);
200 
210  template <typename genIUType>
211  GLM_FUNC_DECL int findMSB(genIUType x);
212 
222  template <typename T, precision P, template <typename, precision> class vecType>
223  GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v);
224 
226 }//namespace glm
227 
228 #include "func_integer.inl"
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< 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 > 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 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...
Definition: _noise.hpp:31
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 > bitfieldReverse(vecType< T, P > const &v)
Returns the reversal of the bits of value.
OpenGL Mathematics (glm.g-truc.net)
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 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)
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)