dtstsfiq
Decimal Test Significance Immediate Quad
Tests DFP Quad significance.
Details
The dtstsfiq instruction compares the number of significant digits (NSDb) of a DFP value in two floating-point registers (FRBp and FRBp+1) to an immediate reference significance specified by UIM. The result of this comparison is stored in the condition register field BF and the FPSCR's FPCC field.
Pseudocode Operation
Let UIM specify the reference significance.
Let NSDb be the number of significant digits of the DFP value in FPR[FRBp:FRBp+1].
If UIM ≠ 0 and UIM < NSDb, set CR field BF to 0b0001 and FPCC to 0b0001.
Else if UIM ≠ 0 and UIM > NSDb, or UIM = 0, set CR field BF to 0b0010 and FPCC to 0b0010.
Else if UIM ≠ 0 and UIM = NSDb, set CR field BF to 0b0100 and FPCC to 0b0100.
Programming Note
The dtstsfiq instruction is used to compare the number of significant digits in a DFP value with an immediate reference significance. Ensure that the UIM (immediate reference significance) is correctly set according to your comparison needs. The result is stored in both the condition register field BF and the FPSCR's FPCC field, allowing for easy conditional branching based on the comparison outcome.
Example
Encoding
Operands
-
BF
CR Field -
U
Imm -
FRB
Source