Compare Type Function - Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

The 64-bit (cmp) and 32-bit (cmp4) compare instructions compare two registers, or a
register and an immediate, for one of ten relations (e.g., >, <=). The compare
instructions set two predicate targets according to the result. The cmp4 instruction
compares the least-significant 32-bits of both sources (the most significant 32-bits are
ignored).
The test bit (tbit) instruction sets two predicate registers according to the state of a
single bit in a general register (the position of the bit is specified by an immediate). The
test NaT (tnat) instruction sets two predicate registers according to the state of the
NaT bit corresponding to a general register.
The test feature (tf) instruction sets two predicate registers according to whether or
not the selected feature is implemented in the processor.
The fcmp instruction compares two floating-point registers and sets two predicate
targets according to one of eight relations. The fclass instruction sets two predicate
targets according to the classification of the number contained in the floating-point
register source.
The frcpa, fprcpa, frsqrta and fprsqrta instructions set a single predicate target if
their floating-point register sources are such that a valid approximation can be
produced, otherwise the predicate target is cleared.
4.3.3
Compare Types
Compare instructions can have as many as five compare types: Normal, Unconditional,
AND, OR, or DeMorgan. The type defines how the instruction writes its target predicate
registers based on the outcome of the comparison and on the qualifying predicate. The
description of these types is contained in
value of the qualifying predicate of the compare and "result" refers to the outcome of
the compare relation (one if the compare relation is true and zero if the compare
relation is false).
Table 4-9.
Compare Type
Normal
Unconditional
AND
OR
DeMorgan
The Normal compare type simply writes the compare result to the first predicate target
and the complement of the result to the second predicate target.
Volume 1, Part 1: Application Programming Model

Compare Type Function

Completer
First Predicate Target
none
if (qp) {target = result}
if (qp) {target = result}
unc
else {target = 0}
and
if (qp &&!result) {target = 0}
andcm
if (qp && result) {target = 0}
or
if (qp && result) {target = 1}
orcm
if (qp &&!result) {target = 1}
or.andcm
if (qp && result) {target = 1}
and.orcm
if (qp &&!result) {target = 0}
Table
4-9. In the table, "qp" refers to the
Operation
Second Predicate Target
if (qp) {target =!result}
if (qp) {target =!result}
else {target = 0}
if (qp &&!result) {target = 0}
if (qp && result) {target = 0}
if (qp && result) {target = 1}
if (qp &&!result) {target = 1}
if (qp && result) {target = 0}
if (qp &&!result) {target = 1}
1:55

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents