dtstdc

Test Data Class

dtstdc BF,FRA,DCM

Tests the data class of a DFP operand and sets the CR field.

Encoding

Binary Layout
0
0:5
BF
6:8
FRA
9:10
DCM
11:15
194
16:31
 
Format Z22-form
Opcode 0xEC000184

Operands

  • BF
    Condition Register Field
  • FRA
    Floating-Point Register A
  • DCM
    Data Class Mask

Example

dtstdc cr0, f2, 0

Registers Altered

CR, FPSCR

Related

More in Decimal Floating-Point

Reference

Description

Tests the data class of the DFP operand in FRA against the data class mask DCM and stores the test result in condition register field BF. The instruction sets CR field BF based on whether FRA belongs to any of the classes specified by the 8-bit mask DCM. This is a Decimal Floating-Point instruction that requires the DFP category.

Operation

if (FRA matches any data class in DCM) then
  CR[BF] ← 0b0010
else
  CR[BF] ← 0b0000

Programming Note

The dtstdc instruction is used to test the data class of a decimal floating-point operand against a specified mask. Ensure that the DFP operand is correctly aligned and that the DCM mask accurately reflects the desired data classes for testing. The instruction updates the CR field BF and FPSCR FPCC based on the sign and data class match, which can be used in conditional logic within your program.