Concmpi, Concmpo - Intel i960 Jx Developer's Manual

Microprocessor
Table of Contents

Advertisement

INSTRUCTION SET REFERENCE
6.2.22

concmpi, concmpo

Mnemonic:
concmpi
concmpo
Format:
concmp*
Description:
Compares src2 and src1 values when condition code bit 2 is not set. When
comparison is performed, condition code is set according to comparison
results. Otherwise, condition codes are not altered.
These instructions are provided to facilitate bounds checking by means of
two-sided range comparisons (e.g., is A between B and C?). They are
generally used after a compare instruction to test whether a value is
inclusively between two other values.
The example below illustrates this application by testing whether g3 value is
between g5 and g6 values, where g5 is assumed to be less than g6. First a
comparison (
to g6 (i.e., condition code is either 010
(
concmpo
to g5 (indicating that g3 is within the bounds of g5 and g6), condition code is
set to 010
if (AC.cc != 1XX
Action:
{
if(src1 <= src2)
else
}
STANDARD
Faults:
Example:
cmpo g6, g3
concmpo g5, g3
At this point, depending on the register ordering, the condition code is one of
those listed on
6-38
Conditional Compare Integer
Conditional Compare Ordinal
src1,
src2
reg/lit
reg/lit
) of g3 and g6 is performed. When g3 is less than or equal
cmpo
) of g3 and g5 is then performed. When g3 is greater than or equal
; otherwise, it is set to 001
2
)
2
AC.cc = 010
;
2
AC.cc = 001
;
2
Refer to
# Compares g6 and g3
# and sets AC.cc.
# If AC.cc < 100
# g5 is compared with g3.
Table
6-10.
or 001
), a conditional comparison
2
2
.
2
section 6.1.6, "Faults" (pg.
(g6
2
6-5).
g3)

Advertisement

Table of Contents
loading

Table of Contents