Encoding:

COP1

010001

fmt

ft

fs

cc

0

A

1

FC

11

cond

6

5

5

5

3

1

1

2

4

Format:

CABS.cond.fmt

Floating Point Absolute Compare

CABS.cond.S cc,fs,ft

MIPS-3D

Floating Point Absolute Compare

CABS.cond.D cc,fs,ft

MIPS-3D

Floating Point Absolute Compare

CABS.cond.PS cc,fs,ft

MIPS-3D

Floating Point Absolute Compare

Purpose:

Floating Point Absolute Compare

To compare FP values and record the boolean result in one or more condition codes

Description:

FPConditionCode(cc) = FPR[fs] compare_absolute_cond FPR[ft]

The absolute value in FPR fs is compared to the absolute value in FPR ft; the values are in format fmt. The comparison is exact and neither overflows nor underflows.

If the comparison specified by cond2..1 is true for the operand values, the result is true; otherwise, the result is false. If no exception is taken, the result is written into condition code CC; true is 1 and false is 0.

CABS.cond.PS compares the upper and lower halves of FPR fs and FPR ftindependently and writes the results into condition codes CC+1 and CC respectively. The CC number must be even. If the number is not even the operation of the instruction is UNPREDICTABLE.

See the description of the C.cond.fmtinstruction in Volume II of this multi-volume set for a complete description of the cond value and the behavior of the compare instruction.

Restrictions:

The fields fs and ft must specify FPRs valid for operands of type fmt; if they are not valid, the result is UNPREDICTABLE. is UNPREDICTABLE and the value of the

The operands must be values in formatfmt;if they are not,the result operand FPRs becomes UNPREDICTABLE.

The result of CABS.cond.PS is UNPREDICTABLE if the processor is executing in 16 FP registers mode, or if the condition code number is odd.

Operation:

if SNaN(ValueFPR(fs, fmt)) or SNaN(ValueFPR(ft, fmt)) or
   QNaN(ValueFPR(fs, fmt)) or QNaN(ValueFPR(ft, fmt)) then
   less = false
   equal = false
   unordered = true
   if (SNaN(ValueFPR(fs,fmt)) or SNaN(ValueFPR(ft,fmt))) or
   (cond3 and (QNaN(ValueFPR(fs,fmt)) or QNaN(ValueFPR(ft,fmt)))) then
      SignalException(InvalidOperation)
   endif
else
   less =   AbsoluteValue(ValueFPR(fs, fmt)) <fmt
             AbsoluteValue(ValueFPR(ft, fmt))
   equal =  AbsoluteValue(ValueFPR(fs, fmt)) =fmt
             AbsoluteValue(ValueFPR(ft, fmt))
   unordered = false
endif
condition = (cond2 and less) or (cond1 and equal)
      or (cond0 and unordered)
SetFPConditionCode(cc, condition)

For CABS.cond.PS,the pseudo code above is repeated for both halves of the operand registers, treating each half as an independent single-precision values. Exceptions on the two halves are logically ORed and reported together. The results of the lower half comparison are written to condition code CC; the results of the upper half comparison are written to condition code CC+1.

Exceptions:

Coprocessor Unusable, Reserved Instruction

Floating Point Exceptions:

Unimplemented Operation, Invalid Operation