dtstsfi
Decimal Test Significance Immediate
dtstsfi BF, U, FRB
Tests the significance of a decimal floating-point value in FPR[FRB] against an immediate value UIM.
Encoding
Binary Layout
59
0:5
BF
6:10
/
11:15
U
16:20
FRB
21:30
675
31
Operands
-
BF
CR Field -
U
Imm -
FRB
Source -
UIM
Immediate Reference Significance
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
The instruction compares the number of significant digits (NSDb) of the DFP value in FPR[FRB] with the reference significance specified by UIM. The result is placed into CR field BF and FPCC.
Operation
NSDb <- number of significant digits in FPR[FRB]
if UIM != 0 and UIM < NSDb then
CR[BF] <- 0b0010
FPCC <- 0b0010
else if UIM != 0 and UIM > NSDb or UIM = 0 then
CR[BF] <- 0b0100
FPCC <- 0b0100
else if UIM != 0 and UIM = NSDb then
CR[BF] <- 0b1000
FPCC <- 0b1000
else
CR[BF] <- 0b0001
FPCC <- 0b0001
Programming Note
The dtstsfi instruction is used to compare the number of significant digits in a DFP value with a specified reference significance. Ensure that the UIM (Upper Immediate) is correctly set according to the desired comparison. This instruction operates at the problem state and may raise exceptions if the FPR[FRB] contains an invalid DFP value. Performance can be optimized by minimizing the use of this instruction in critical loops due to its dependency on floating-point operations.