Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
abs64 - absolute value of a 64-bit int. Not all environments support "abs" on whatever their name for the 64-bit int type is. The absolute value of the largest negative number is undefined, as with "abs".
Definition at line 401 of file MathExtras.h.
References x.
|
inlinestatic |
BitsToDouble - This function takes a 64-bit integer and returns the bit equivalent double.
Definition at line 309 of file MathExtras.h.
|
inlinestatic |
BitsToFloat - This function takes a 32-bit integer and returns the bit equivalent float.
Definition at line 320 of file MathExtras.h.
CountLeadingOnes_32 - this function performs the operation of counting the number of ones from the most significant bit to the first zero bit. Ex. CountLeadingOnes_32(0xFF0FFF00) == 8. Returns 32 if the word is all ones.
Definition at line 124 of file MathExtras.h.
References CountLeadingZeros_32().
CountLeadingOnes_64 - This function performs the operation of counting the number of ones from the most significant bit to the first zero bit (64 bit edition.) Returns 64 if the word is all ones.
Definition at line 182 of file MathExtras.h.
References CountLeadingZeros_64().
Count number of 0's from the most significant bit to the least stopping at the first 1.
Only unsigned integral types are allowed.
ZB | the behavior on an input of 0. Only ZB_Width and ZB_Undefined are valid arguments. |
Definition at line 424 of file MathExtras.h.
CountLeadingZeros_32 - this function performs the platform optimal form of counting the number of zeros from the most significant bit to the first one bit. Ex. CountLeadingZeros_32(0x00F000FF) == 8. Returns 32 if the word is zero.
Definition at line 95 of file MathExtras.h.
Referenced by CountLeadingOnes_32(), CountLeadingZeros_64(), getT2SOImmValRotateVal(), Log2_32(), and Log2_32_Ceil().
CountLeadingZeros_64 - This function performs the platform optimal form of counting the number of zeros from the most significant bit to the first one bit (64 bit edition.) Returns 64 if the word is zero.
Definition at line 132 of file MathExtras.h.
References CountLeadingZeros_32(), Hi_32(), and Lo_32().
Referenced by CountLeadingOnes_64(), Log2_64(), and Log2_64_Ceil().
CountPopulation_32 - this function counts the number of set bits in a value. Ex. CountPopulation(0xF000F000) = 8 Returns 0 if the word is zero.
Definition at line 247 of file MathExtras.h.
References v.
CountPopulation_64 - this function counts the number of set bits in a value, (64 bit edition.)
Definition at line 259 of file MathExtras.h.
References v.
CountTrailingOnes_32 - this function performs the operation of counting the number of ones from the least significant bit to the first zero bit. Ex. CountTrailingOnes_32(0x00FF00FF) == 8. Returns 32 if the word is all ones.
Definition at line 210 of file MathExtras.h.
References CountTrailingZeros_32().
CountTrailingOnes_64 - This function performs the operation of counting the number of ones from the least significant bit to the first zero bit (64 bit edition.) Returns 64 if the word is all ones.
Definition at line 240 of file MathExtras.h.
References CountTrailingZeros_64().
CountTrailingZeros_32 - this function performs the platform optimal form of counting the number of zeros from the least significant bit to the first one bit. Ex. CountTrailingZeros_32(0xFF00FF00) == 8. Returns 32 if the word is zero.
Definition at line 190 of file MathExtras.h.
Referenced by CountTrailingOnes_32(), getSOImmValRotate(), getT2SOImmValRotate(), getThumbImm16ValShift(), and getThumbImmValShift().
CountTrailingZeros_64 - This function performs the platform optimal form of counting the number of zeros from the least significant bit to the first one bit (64 bit edition.) Returns 64 if the word is zero.
Definition at line 218 of file MathExtras.h.
Referenced by CountTrailingOnes_64().
|
inlinestatic |
DoubleToBits - This function takes a double and returns the bit equivalent 64-bit integer. Note that copying doubles around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.
Definition at line 333 of file MathExtras.h.
|
inlinestatic |
FloatToBits - This function takes a float and returns the bit equivalent 32-bit integer. Note that copying floats around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.
Definition at line 346 of file MathExtras.h.
GreatestCommonDivisor64 - Return the greatest common divisor of the two values using Euclid's algorithm.
Definition at line 298 of file MathExtras.h.
Hi_32 - This function returns the high 32 bits of a 64 bit value.
Definition at line 37 of file MathExtras.h.
Referenced by CountLeadingZeros_64().
isIntN - Checks if an signed integer fits into the given (dynamic) bit width. isMask_32 - This function returns true if the argument is a sequence of ones starting at the least significant bit with the remainder zero (32 bit version). Ex. isMask_32(0x0000FFFFU) == true.
Definition at line 61 of file MathExtras.h.
Referenced by isShiftedMask_32().
isMask_64 - This function returns true if the argument is a sequence of ones starting at the least significant bit with the remainder zero (64 bit version).
Definition at line 68 of file MathExtras.h.
Referenced by isShiftedMask_64().
isPowerOf2_32 - This function returns true if the argument is a power of two > 0. Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)
Definition at line 87 of file MathExtras.h.
isShiftedMask_32 - This function returns true if the argument contains a sequence of ones with the remainder zero (32 bit version.) Ex. isShiftedMask_32(0x0000FF00U) == true.
Definition at line 75 of file MathExtras.h.
References isMask_32().
isShiftedMask_64 - This function returns true if the argument contains a sequence of ones with the remainder zero (64 bit version.)
Definition at line 81 of file MathExtras.h.
References isMask_64().
isUIntN - Checks if an unsigned integer fits into the given (dynamic) bit width.
Definition at line 48 of file MathExtras.h.
Lo_32 - This function returns the low 32 bits of a 64 bit value.
Definition at line 42 of file MathExtras.h.
Referenced by CountLeadingZeros_64().
Log2_32 - This function returns the floor log base 2 of the specified value, -1 if the value is zero. (32 bit edition.) Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
Definition at line 273 of file MathExtras.h.
References CountLeadingZeros_32().
Log2_32_Ceil - This function returns the ceil log base 2 of the specified value, 32 if the value is zero. (32 bit edition). Ex. Log2_32_Ceil(32) == 5, Log2_32_Ceil(1) == 0, Log2_32_Ceil(6) == 3
Definition at line 286 of file MathExtras.h.
References CountLeadingZeros_32().
Log2_64 - This function returns the floor log base 2 of the specified value, -1 if the value is zero. (64 bit edition.)
Definition at line 279 of file MathExtras.h.
References CountLeadingZeros_64().
Log2_64_Ceil - This function returns the ceil log base 2 of the specified value, 64 if the value is zero. (64 bit edition.)
Definition at line 292 of file MathExtras.h.
References CountLeadingZeros_64().
MinAlign - A and B are either alignments or offsets. Return the minimum alignment that may be assumed after adding the two together.
Definition at line 357 of file MathExtras.h.
NextPowerOf2 - Returns the next power of two (in 64-bits) that is strictly greater than A. Returns zero on overflow.
Definition at line 368 of file MathExtras.h.
References A.
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value
and is a multiple of Align
. Align
must be non-zero.
Definition at line 394 of file MathExtras.h.
References RoundUpToAlignment().
Returns the next integer (mod 2**64) that is greater than or equal to Value
and is a multiple of Align
. Align
must be non-zero.
Examples:
Definition at line 387 of file MathExtras.h.
Referenced by OffsetToAlignment().