drintn

Decimal Floating-Point Round To FP Integer Without Inexact

drintn R,FRT,FRB,RMC

drintn. R,FRT,FRB,RMC

Rounds a decimal floating-point number to an integer without recognizing an inexact exception.

Details

This operation rounds the value in FRB to an integer using the specified rounding mode (RMC) and places the result in FRT. It does not recognize an inexact exception.

Pseudocode Operation

if 'drintn' then
    FRT <- Round(FRB, RMC)
    FI <- 0
    FR <- 0
    VXSNAN <- 0
    if Rc=1 then
        CR1 <- ClassAndSign(FRT)
else if 'drintn.' then
    FRT <- Round(FRB, RMC)
    FI <- 0
    FR <- 0
    VXSNAN <- 0
    CR1 <- ClassAndSign(FRT)

Programming Note

The DFP Round To FP Integer Without Inexact and DFP Round To FP Integer Without Inexact Quad instructions can be used to implement decimal equivalents of several C99 rounding functions by specifying the appropriate R and RMC field values.

Example

drintn 0, f1, f3, 0

Encoding

Binary Layout
0
0
FRT
6
R
11
FRB
15
RMC
16
Rc
21
 
Format Z23-form
Opcode 0xEC0001C6
Extension Decimal Floating-Point
Registers Altered FPSCR, (FPRF, FX, VXSNAN), FPSCR, (FR, FI), CR1, CR0

Operands

  • R
    Rounding mode control
  • FRT
    Target Floating-Point Register
  • FRB
    Source Floating-Point Register
  • RMC
    Rounding Mode Control