IBM SA14-2339-04 Personal Computer User Manual


 
Programming Model 2-11
descriptions in Chapter 9, “Instruction Set.” The CR contents can be used in conditional branch
instructions.
The CR can be modified in any of the following ways:
mtcrf sets specified CR fields by writing to the CR from a GPR, under control of a mask specified
as an instruction field.
mcrf sets a specified CR field by copying another CR field to it.
mcrxr copies certain bits of the XER into a designated CR field, and then clears the corresponding
XER bits.
The “with update” forms of integer instructions implicitly update CR[CR0].
Integer compare instructions update a specified CR field.
Auxiliary processor instructions can update a specified CR field (including the implicit update of
CR[CR1] by certain floating-point operations).
The CR-logical instructions update a specified CR bit with the result of a logical operation on a
specified pair of CR bit fields.
Conditional branch instructions can test a CR bit as one of the branch conditions.
If a CR field is set by a compare instruction, the bits are set as described in “CR Fields after Compare
Instructions.”
The CR is part of the user programming model.
2.3.3.1 CR Fields after Compare Instructions
Compare instructions compare the values of two registers. The two types of compare instructions,
arithmetic
and
logical
, are distinguished by the interpretation given to the 32-bit values. For
arithmetic
Figure 2-8. Condition Register (CR)
0:3 CR0 Condition Register Field 0
4:7 CR1 Condition Register Field 1
8:11 CR2 Condition Register Field 2
12:15 CR3 Condition Register Field 3
16:19 CR4 Condition Register Field 4
20:23 CR5 Condition Register Field 5
24:27 CR6 Condition Register Field 6
28:31 CR7 Condition Register Field 7
0 3 4 7 8 1112 1516 1920 2324 2728 31
CR0
CR1
CR2
CR3
CR4
CR5
CR6
CR7