dtstsfiq

Decimal Test Significance Immediate Quad

dtstsfiq BF, U, FRB

Tests DFP Quad significance.

Encoding

Binary Layout
63
0:5
BF
6:10
/
11:15
U
16:20
FRB
21:30
675
31
 
Format X-form
Opcode 0xFC000546

Operands

  • BF
    CR Field
  • U
    Imm
  • FRB
    Source

Example

dtstsfiq cr0, 0, f3

Registers Altered

FPSCR

Related

More in Decimal Floating-Point

Reference

Description

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.

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.