0.9.8
func_integer.hpp
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include "setup.hpp"
16 #include "precision.hpp"
17 #include "func_common.hpp"
19 
20 namespace glm
21 {
24 
33  template <precision P, template <typename, precision> class vecType>
34  GLM_FUNC_DECL vecType<uint, P> uaddCarry(
35  vecType<uint, P> const & x,
36  vecType<uint, P> const & y,
37  vecType<uint, P> & carry);
38 
47  template <precision P, template <typename, precision> class vecType>
48  GLM_FUNC_DECL vecType<uint, P> usubBorrow(
49  vecType<uint, P> const & x,
50  vecType<uint, P> const & y,
51  vecType<uint, P> & borrow);
52 
61  template <precision P, template <typename, precision> class vecType>
62  GLM_FUNC_DECL void umulExtended(
63  vecType<uint, P> const & x,
64  vecType<uint, P> const & y,
65  vecType<uint, P> & msb,
66  vecType<uint, P> & lsb);
67 
76  template <precision P, template <typename, precision> class vecType>
77  GLM_FUNC_DECL void imulExtended(
78  vecType<int, P> const & x,
79  vecType<int, P> const & y,
80  vecType<int, P> & msb,
81  vecType<int, P> & lsb);
82 
98  template <typename T, precision P, template <typename, precision> class vecType>
99  GLM_FUNC_DECL vecType<T, P> bitfieldExtract(
100  vecType<T, P> const & Value,
101  int Offset,
102  int Bits);
103 
118  template <typename T, precision P, template <typename, precision> class vecType>
119  GLM_FUNC_DECL vecType<T, P> bitfieldInsert(
120  vecType<T, P> const & Base,
121  vecType<T, P> const & Insert,
122  int Offset,
123  int Bits);
124 
133  template <typename T, precision P, template <typename, precision> class vecType>
134  GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v);
135 
142  template <typename genType>
143  GLM_FUNC_DECL int bitCount(genType v);
144 
151  template <typename T, precision P, template <typename, precision> class vecType>
152  GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v);
153 
162  template <typename genIUType>
163  GLM_FUNC_DECL int findLSB(genIUType x);
164 
173  template <typename T, precision P, template <typename, precision> class vecType>
174  GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v);
175 
185  template <typename genIUType>
186  GLM_FUNC_DECL int findMSB(genIUType x);
187 
197  template <typename T, precision P, template <typename, precision> class vecType>
198  GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v);
199 
201 }//namespace glm
202 
203 #include "func_integer.inl"
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< 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 > 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 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 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< T, P > bitfieldReverse(vecType< T, P > const &v)
Returns the reversal of the bits of value.
Definition: _noise.hpp:11
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.
GLM Core
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.
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 Core