![Xilinx Virtex-II Pro PPC405 User Manual Download Page 284](http://html1.mh-extra.com/html/xilinx/virtex-ii-pro-ppc405/virtex-ii-pro-ppc405_user-manual_3410279284.webp)
592
March 2002 Release
1-800-255-7778
Virtex-II Pro™ Platform FPGA Documentation
Chapter 11:
Instruction Set
R
cmp
Compare
Description
A 32-bit signed comparison is performed between the contents of register
r
A and register
r
B.
crf
D which CR field is updated to reflect the comparison results. The value of XER[SO]
is loaded into the same CR field.
Simplified mnemonics defined for this instruction are described in
Pseudocode
c
0:3
←
0b0000
if (
r
A) < (
r
B) then c
0
←
1
if (
r
A) > (
r
B) then c
1
←
1
if (
r
A)
=
(
r
B) then c
2
←
1
c
3
←
XER[SO]
n
←
crf
D
CR[CRn]
←
c
0:3
Registers Altered
•
CR[CR
n
] as specified by the
crf
D field.
Exceptions
•
None.
Execution of any of the following invalid-instruction forms results in a boundedly-
undefined result rather than a program exception:
•
Reserved bits containing a non-zero value.
Compatibility
This instruction is defined by the PowerPC user instruction-set architecture (UISA). It is
implemented by all PowerPC processors.
cmp
crf
D, 0,
r
A,
r
B
X Instruction Form
31
crf
D
0
0
r
A
r
B
0
0
0
6
9
1
1
1
6
2
1
3
1