
3-28
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Instruction Set Summary
See Appendix F, “Simplified Mnemonics,” in the
Programming Environments Manual
, for
a complete set of simplified mnemonics.
3.2.4.6
Processor Control Instructions
UISA-level processor control instructions are used to read from and write to the condition
register (CR).
3.2.4.6.1
Move To/From Condition Register Instructions
Table 3-24 lists the instructions provided by the G2 core for reading from or writing to the
CR.
3.2.4.7
Memory Synchronization Instructions—UISA
Memory synchronization instructions control the order in which memory operations are
completed with respect to asynchronous events and the order in which memory operations
are seen by other processors or memory access mechanisms. See Chapter 4, “Instruction
and Data Cache Operation,” for additional information about these instructions and about
related aspects of memory synchronization.
The
sync
instruction delays execution of subsequent instructions until previous instructions
have completed to the point that they can no longer cause an exception and until all
previous memory accesses are performed globally; the
sync
operation is not broadcast onto
the G2 core 60x bus interface. Additionally, all load and store cache/bus activities initiated
by prior instructions are completed. Touch load operations (
dcbt
and
dcbtst
) are required
to complete at least through address translation but are not required to complete on the bus.
The functions performed by the
sync
instruction normally take a significant amount of time
to complete; as a result, frequent use of this instruction may adversely affect performance.
In addition, the number of cycles required to complete a
sync
instruction depends on system
parameters and on the processor's state when the instruction is issued.
The proper paired use of the
lwarx
and
stwcx.
instructions allows programmers to emulate
common semaphore operations such as test and set, compare and swap, exchange memory,
and fetch and add. Examples of these operations can be found in Appendix E,
“Synchronization Programming Examples,” in the
Programming Environments Manual
.
Typically, the
lwarx
instruction should be paired with an
stwcx.
instruction with the same
Table 3-24. Move To/From Condition Register Instructions
Name
Mnemonic
Operand Syntax
Move from Condition Register
mfcr
r
D
Move to Condition Register Fields
mtcrf
CRM
,r
S
Move to Condition Register from XER
mcrxr
crf
D
F
Freescale Semiconductor, Inc.
n
.