dtstsf

Decimal Floating-Point Test Significance Single

dtstsf BF,FRA,FRB

Tests the significance of a DFP value in FPR[FRB] against a reference significance.

Details

Compares the number of significant digits (NSDb) of the DFP value in FPR[FRB] with the reference significance specified by bits 58:63 of FPR[FRA]. The result is placed into CR field BF and FPCC.

Pseudocode Operation

let k be the contents of bits 58:63 of FPR[FRA]
let NSDb be the number of significant digits of the DFP value in FPR[FRB]
if k != 0 and k < NSDb then
    CR field BF <- 0b0010
    FPCC <- 0b0010
else if k != 0 and k > NSDb, or k = 0 then
    CR field BF <- 0b0100
    FPCC <- 0b0100
else if k != 0 and k = NSDb then
    CR field BF <- 0b1000
    FPCC <- 0b1000
else
    CR field BF <- 0b0001
    FPCC <- 0b0001

Programming Note

The dtstsf instruction is used to compare the number of significant digits in a decimal floating-point value with a reference significance. Ensure that the FPR registers are correctly aligned and initialized before use. The instruction modifies both CR and FPSCR, so check these registers after execution for the comparison result. This instruction operates at user privilege level but may raise exceptions if the input values are invalid or out of range.

Example

dtstsf cr0, f2, f3

Encoding

Binary Layout
0
0
BF
6
FRA
9
FRB
11
 
Format X-form
Opcode 0xEC000544
Extension Decimal Floating-Point
Registers Altered CR, FPSCR

Operands

  • BF
    Condition Register Field
  • FRA
    Floating-Point Register A
  • FRB
    Floating-Point Register B