mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-18 19:28:16 +00:00
add convenience 'constructors'
llvm-svn: 52908
This commit is contained in:
parent
5b8e75e2fe
commit
9adb1b56de
@ -152,8 +152,8 @@ namespace llvm {
|
||||
rmNearestTiesToAway
|
||||
};
|
||||
|
||||
/* Operation status. opUnderflow or opOverflow are always returned
|
||||
or-ed with opInexact. */
|
||||
// Operation status. opUnderflow or opOverflow are always returned
|
||||
// or-ed with opInexact.
|
||||
enum opStatus {
|
||||
opOK = 0x00,
|
||||
opInvalidOp = 0x01,
|
||||
@ -163,7 +163,7 @@ namespace llvm {
|
||||
opInexact = 0x10
|
||||
};
|
||||
|
||||
/* Category of internally-represented number. */
|
||||
// Category of internally-represented number.
|
||||
enum fltCategory {
|
||||
fcInfinity,
|
||||
fcNaN,
|
||||
@ -171,7 +171,7 @@ namespace llvm {
|
||||
fcZero
|
||||
};
|
||||
|
||||
/* Constructors. */
|
||||
// Constructors.
|
||||
APFloat(const fltSemantics &, const char *);
|
||||
APFloat(const fltSemantics &, integerPart);
|
||||
APFloat(const fltSemantics &, fltCategory, bool negative);
|
||||
@ -180,6 +180,17 @@ namespace llvm {
|
||||
explicit APFloat(const APInt &, bool isIEEE = false);
|
||||
APFloat(const APFloat &);
|
||||
~APFloat();
|
||||
|
||||
// Convenience "constructors"
|
||||
static APFloat getZero(const fltSemantics &Sem, bool Negative = false) {
|
||||
return APFloat(Sem, fcZero, Negative);
|
||||
}
|
||||
static APFloat getInf(const fltSemantics &Sem, bool Negative = false) {
|
||||
return APFloat(Sem, fcInfinity, Negative);
|
||||
}
|
||||
static APFloat getNaN(const fltSemantics &Sem, bool Negative = false) {
|
||||
return APFloat(Sem, fcNaN, Negative);
|
||||
}
|
||||
|
||||
/// Profile - Used to insert APFloat objects, or objects that contain
|
||||
/// APFloat objects, into FoldingSets.
|
||||
|
Loading…
x
Reference in New Issue
Block a user