llvm::RoundingMode

Rounding mode.

Synopsis

Declared in <llvm/ADT/FloatingPointMode.h>

enum class RoundingMode : int8_t;

Description

Enumerates supported rounding modes, as well as some special values. The set of the modes must agree with IEEE-754, 4.3.1 and 4.3.2. The constants assigned to the IEEE rounding modes must agree with the values used by FLT_ROUNDS (C11, 5.2.4.2.2p8).

This value is packed into bitfield in some cases, including FPOptions, so the rounding mode values and the special value Dynamic must fit into the the bit field (now - 3 bits). The value Invalid is used only in values returned by intrinsics to indicate errors, it should never be stored as rounding mode value, so it does not need to fit the bit fields.

Members

NameDescription
TowardZero roundTowardZero.
NearestTiesToEven roundTiesToEven.
TowardPositive roundTowardPositive.
TowardNegative roundTowardNegative.
NearestTiesToAway roundTiesToAway.
Dynamic Denotes mode unknown at compile time.
Invalid Denotes invalid value.

Non-Member Functions

NameDescription
canRoundingModeBeReturns true if the rounding mode RM may be QRM at compile time or at run time.
convertRoundingModeToStrFor any RoundingMode enumerator, returns a string valid as input in constrained intrinsic rounding mode metadata.
convertStrToRoundingModeReturns a valid RoundingMode enumerator when given a string that is valid as input in constrained intrinsic rounding mode metadata.
spellReturns text representation of the given rounding mode.