0.9.9 API documentation
integer.hpp
Go to the documentation of this file.
1 
17 #pragma once
18 
19 #include "detail/qualifier.hpp"
20 #include "common.hpp"
21 #include "vector_relational.hpp"
22 
23 namespace glm
24 {
27 
36  template<length_t L, qualifier Q>
37  GLM_FUNC_DECL vec<L, uint, Q> uaddCarry(
38  vec<L, uint, Q> const& x,
39  vec<L, uint, Q> const& y,
40  vec<L, uint, Q> & carry);
41 
50  template<length_t L, qualifier Q>
51  GLM_FUNC_DECL vec<L, uint, Q> usubBorrow(
52  vec<L, uint, Q> const& x,
53  vec<L, uint, Q> const& y,
54  vec<L, uint, Q> & borrow);
55 
64  template<length_t L, qualifier Q>
65  GLM_FUNC_DECL void umulExtended(
66  vec<L, uint, Q> const& x,
67  vec<L, uint, Q> const& y,
68  vec<L, uint, Q> & msb,
69  vec<L, uint, Q> & lsb);
70 
79  template<length_t L, qualifier Q>
80  GLM_FUNC_DECL void imulExtended(
81  vec<L, int, Q> const& x,
82  vec<L, int, Q> const& y,
83  vec<L, int, Q> & msb,
84  vec<L, int, Q> & lsb);
85 
102  template<length_t L, typename T, qualifier Q>
103  GLM_FUNC_DECL vec<L, T, Q> bitfieldExtract(
104  vec<L, T, Q> const& Value,
105  int Offset,
106  int Bits);
107 
123  template<length_t L, typename T, qualifier Q>
124  GLM_FUNC_DECL vec<L, T, Q> bitfieldInsert(
125  vec<L, T, Q> const& Base,
126  vec<L, T, Q> const& Insert,
127  int Offset,
128  int Bits);
129 
139  template<length_t L, typename T, qualifier Q>
140  GLM_FUNC_DECL vec<L, T, Q> bitfieldReverse(vec<L, T, Q> const& v);
141 
148  template<typename genType>
149  GLM_FUNC_DECL int bitCount(genType v);
150 
158  template<length_t L, typename T, qualifier Q>
159  GLM_FUNC_DECL vec<L, int, Q> bitCount(vec<L, T, Q> const& v);
160 
169  template<typename genIUType>
170  GLM_FUNC_DECL int findLSB(genIUType x);
171 
181  template<length_t L, typename T, qualifier Q>
182  GLM_FUNC_DECL vec<L, int, Q> findLSB(vec<L, T, Q> const& v);
183 
193  template<typename genIUType>
194  GLM_FUNC_DECL int findMSB(genIUType x);
195 
206  template<length_t L, typename T, qualifier Q>
207  GLM_FUNC_DECL vec<L, int, Q> findMSB(vec<L, T, Q> const& v);
208 
210 }//namespace glm
211 
212 #include "detail/func_integer.inl"
GLM_FUNC_DECL void umulExtended(vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &msb, vec< L, uint, Q > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL vec< L, int, Q > bitCount(vec< L, T, Q > const &v)
Returns the number of bits set to 1 in the binary representation of value.
GLM_FUNC_DECL vec< L, uint, Q > usubBorrow(vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &borrow)
Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise.
Core features
GLM_FUNC_DECL vec< L, int, Q > findLSB(vec< L, T, Q > 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, Q > const &x, vec< L, int, Q > const &y, vec< L, int, Q > &msb, vec< L, int, Q > &lsb)
Multiplies 32-bit integers x and y, producing a 64-bit result.
GLM_FUNC_DECL vec< L, T, Q > bitfieldExtract(vec< L, T, Q > 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, int, Q > findMSB(vec< L, T, Q > const &v)
Returns the bit number of the most significant bit in the binary representation of value...
GLM_FUNC_DECL vec< L, T, Q > bitfieldReverse(vec< L, T, Q > const &v)
Returns the reversal of the bits of value.
Definition: common.hpp:20
GLM_FUNC_DECL vec< L, T, Q > bitfieldInsert(vec< L, T, Q > const &Base, vec< L, T, Q > const &Insert, int Offset, int Bits)
Returns the insertion the bits least-significant bits of insert into base.
Core features
GLM_FUNC_DECL vec< L, uint, Q > uaddCarry(vec< L, uint, Q > const &x, vec< L, uint, Q > const &y, vec< L, uint, Q > &carry)
Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32).