BI operand of branch conditional instructions for basic and extended mnemonics

The BI operand of branch conditional instructions for basic and extended mnemonics.

The BI operand specifies a bit (0:31) in the Condition Register for condition comparison. The bit is set by a compare instruction. The bits in the Condition Register are grouped into eight 4-bit fields. These fields are named CR field 0 through CR field 7 (CR0...CR7). The bits of each field are interpreted as follows:

Bit Description
0 Less than; floating-point less than
1 Greater than; floating-point greater than
2 Equal; floating-point equal
3 Summary overflow; floating-point unordered

Normally the symbols shown in the BI Operand Symbols for Basic and Extended Branch Conditional Mnemonics table are defined for use in BI operands. The assembler supports expressions for the BI operands. The expression is a combination of values and the following symbols.

Table 1. BI Operand Symbols for Basic and Extended Branch Conditional Mnemonics
Symbol Value Meaning
lt 0 less than
gt 1 greater than
eq 2 equal
so 3 summary overflow
un 3 unordered (after floating-point comparison)
cr0 0 CR field 0
cr1 1 CR field 1
cr2 2 CR field 2
cr3 3 CR field 3
cr4 4 CR field 4
cr5 5 CR field 5
cr6 6 CR field 6
cr7 7 CR field 7

When using an expression for the BI field in the basic or extended mnemonics with only the BO field incorporated, the CR field number should be multiplied by 4 to get the correct CR bit, since each CR field has four bits.

  1. To decrement CTR, then branch only if CTR is not zero and condition in CR5 is equal:
    
    bdnzt   4*cr5+eq, target_addr
    
    This is equivalent to:
    
    bc   8, 22, target_addr
    
  2. To decrement CTR, then branch only if CTR is not zero and condition in CR0 is equal:
    
    bdnzt   eq, target_addr
    
    This is equivalent to:
    
    bc   8, 2, target_addr
    
    If the BI operand specifies Bit 0 of CR0, the BI operand can be omitted.
  3. To decrement CTR, then branch only if CTR is zero:
    
    bdz   target_addr
    
    This is equivalent to:
    
    bc   18, 0, target_addr
    

For extended mnemonics with the BO field and a partial BI field incorporated, the value of the BI operand indicates the CR field number. Valid values are 0-7. If a value of 0 is used, the BI operand can be omitted.

  1. To branch if CR0 reflects a condition of not less than:
    
    bge   target_addr
    
    This is equivalent to:
    
    bc   4, 0, target_addr
    
  2. To branch to an absolute target if CR4 indicates greater than, and set the Link register:
    
    bgtla   cr4, target_addr
    
    This is equivalent to:
    
    bcla   12, 17, target_addr
    
    The BI operand CR4 is internally expanded to 16 by the assembler. After the gt (greater than) is incorporated, the result of the BI field is 17.