dtstsfiq

Decimal Test Significance Immediate Quad

dtstsfiq BF, U, FRB

Tests DFP Quad significance.

Details

Tests the significance of a Decimal Floating-Point Quad-precision operand based on the immediate value U and updates the specified condition register field. The result indicates whether the value is zero, subnormal, normal, or special (infinity/NaN). Requires the Decimal Floating-Point facility and updates the target CR field.

Pseudocode Operation

if isSpecial(FRB[0:127]) then
  CR[BF*4:BF*4+3] ← test_special(FRB[0:127], U)
elif isZero(FRB[0:127]) then
  CR[BF*4:BF*4+3] ← 0b0100
elif isSubnormal(FRB[0:127]) then
  CR[BF*4:BF*4+3] ← 0b0010
else
  CR[BF*4:BF*4+3] ← 0b0001
end

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

dtstsfiq cr0, 0, f3

Encoding

Binary Layout
63
0
BF
6
/
11
U
16
FRB
21
675
31
 
Format X-form
Opcode 0xFC000546
Extension Decimal Floating-Point
Registers Altered FPSCR

Operands

  • BF
    CR Field
  • U
    Imm
  • FRB
    Source