Arbitrary‐precision fixed‐point value with associated semantics.
Synopsis
Declared in <llvm/ADT/APFixedPoint.h>
class APFixedPoint;
Description
The APFixedPoint class works similarly to APInt/APSInt in that it is a functional replacement for a scaled integer. It supports a wide range of semantics including the one used by fixed point types proposed in ISO/IEC JTC1 SC22 WG14 N1169. The class carries the value and semantics of a fixed point, and provides different operations that would normally be performed on fixed point types.
Member Functions
Name |
Description |
|
Constructors |
Add |
|
Compare against |
|
Convert this number to match the semantics provided. |
|
Convert this fixed point number to a floating point value with the provided semantics. |
|
Return the integral part rounded toward zero into an APSInt. |
|
Divide by |
|
Dump this value to stderr for debugging. |
|
Return true if the underlying scaled integer is non‐zero. |
|
Return the integral part of this fixed point number, rounded towards zero. (‐2.5k ‐> ‐2) |
|
Return the LSB weight of this value's semantics. |
|
Return the MSB weight of this value's semantics. |
|
Return the fractional scale of this value's semantics. |
|
Return a copy of this value's fixed‐point semantics. |
|
Return the underlying scaled integer with matching signedness. |
|
Return the bit width of this value's semantics. |
|
Return true if unsigned semantics reserve a padding bit. |
|
Return true if this value's semantics saturate on overflow. |
|
Return true if this value uses a signed representation. |
|
Multiply by |
|
Perform a unary negation (‐X) on this fixed point type, taking into account saturation if applicable. |
|
Write a human‐readable representation to |
|
Left‐shift the scaled integer by |
|
Right‐shift the scaled integer by |
|
Subtract |
|
|
|
Return true if this value equals |
|
Return true if this value differs from |
|
Return true if this value is less than |
|
Return true if this value is less than or equal to |
|
Return true if this value is greater than |
|
Return true if this value is greater than or equal to |
Static Member Functions
Name |
Description |
Return the smallest positive quantum (epsilon) for semantics |
|
Create an APFixedPoint from a float in the given target semantics. |
|
Create an APFixedPoint from an integer in the given target semantics. |
|
Return the maximum representable value for semantics |
|
Return the minimum representable value for semantics |
|
Given a floating point semantic, return the next floating point semantic with a larger exponent and larger or equal mantissa. |
Non-Member Functions
Name |
Description |
Compute a hash code for fixed‐point value |
Created with MrDocs