0.9.9 API documenation
func_integer.hpp
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include "setup.hpp"
16 #include "qualifier.hpp"
17 #include "func_common.hpp"
19 
20 namespace glm
21 {
24 
33  template<length_t L, qualifier P>
34  GLM_FUNC_DECL vec<L, uint, P> uaddCarry(
35  vec<L, uint, P> const & x,
36  vec<L, uint, P> const & y,
37  vec<L, uint, P> & carry);
38 
47  template<length_t L, qualifier P>
48  GLM_FUNC_DECL vec<L, uint, P> usubBorrow(
49  vec<L, uint, P> const & x,
50  vec<L, uint, P> const & y,
51  vec<L, uint, P> & borrow);
52 
61  template<length_t L, qualifier P>
62  GLM_FUNC_DECL void umulExtended(
63  vec<L, uint, P> const & x,
64  vec<L, uint, P> const & y,
65  vec<L, uint, P> & msb,
66  vec<L, uint, P> & lsb);
67 
76  template<length_t L, qualifier P>
77  GLM_FUNC_DECL void imulExtended(
78  vec<L, int, P> const & x,
79  vec<L, int, P> const & y,
80  vec<L, int, P> & msb,
81  vec<L, int, P> & lsb);
82 
99  template<length_t L, typename T, qualifier P>
100  GLM_FUNC_DECL vec<L, T, P> bitfieldExtract(
101  vec<L, T, P> const& Value,
102  int Offset,
103  int Bits);
104 
120  template<length_t L, typename T, qualifier P>
121  GLM_FUNC_DECL vec<L, T, P> bitfieldInsert(
122  vec<L, T, P> const& Base,
123  vec<L, T, P> const& Insert,
124  int Offset,
125  int Bits);
126 
136  template<length_t L, typename T, qualifier P>
137  GLM_FUNC_DECL vec<L, T, P> bitfieldReverse(vec<L, T, P> const & v);
138 
145  template<typename genType>
146  GLM_FUNC_DECL int bitCount(genType v);
147 
155  template<length_t L, typename T, qualifier P>
156  GLM_FUNC_DECL vec<L, int, P> bitCount(vec<L, T, P> const & v);
157 
166  template<typename genIUType>
167  GLM_FUNC_DECL int findLSB(genIUType x);
168 
178  template<length_t L, typename T, qualifier P>
179  GLM_FUNC_DECL vec<L, int, P> findLSB(vec<L, T, P> const & v);
180 
190  template<typename genIUType>
191  GLM_FUNC_DECL int findMSB(genIUType x);
192 
203  template<length_t L, typename T, qualifier P>
204  GLM_FUNC_DECL vec<L, int, P> findMSB(vec<L, T, P> const & v);
205 
207 }//namespace glm
208 
209 #include "func_integer.inl"
GLM_FUNC_DECL vec< L, int, P > findMSB(vec< L, T, P > const &v)
Returns the bit number of the most significant bit in the binary representation of value...
GLM_FUNC_DECL vec< L, int, P > bitCount(vec< L, T, P > const &v)
Returns the number of bits set to 1 in the binary representation of value.
GLM_FUNC_DECL vec< L, uint, P > uaddCarry(vec< L, uint, P > const &x, vec< L, uint, P > const &y, vec< L, uint, P > &carry)
Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32).
GLM_FUNC_DECL vec< L, T, P > bitfieldExtract(vec< L, 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 vec< L, uint, P > usubBorrow(vec< L, uint, P > const &x, vec< L, uint, P > const &y, vec< L, 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.
Definition: _noise.hpp:11
GLM Core
GLM_FUNC_DECL vec< L, T, P > bitfieldReverse(vec< L, T, P > const &v)
Returns the reversal of the bits of value.
GLM_FUNC_DECL vec< L, T, P > bitfieldInsert(vec< L, T, P > const &Base, vec< L, 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(vec< L, uint, P > const &x, vec< L, uint, P > const &y, vec< L, uint, P > &msb, vec< L, uint, P > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL vec< L, int, P > findLSB(vec< L, 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 void imulExtended(vec< L, int, P > const &x, vec< L, int, P > const &y, vec< L, int, P > &msb, vec< L, int, P > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM Core