cmpf.d


Floating-point compare (double)

[Syntax]

-

cmpf.d imm4, reg1, reg2, cc#3

-

cmpfcnd.d reg1, reg2

 

The following can be specified for imm4:

-

Absolute expression having a value up to 4 bits

[Function]

-

Syntax "cmpf.d imm4, reg1, reg2, cc#3"

The content in double-precision floating-point format in the register pair specified by reg2 is compared with the content in double-precision floating-point format in the register pair specified by reg1, via the imm4 comparison condition. The result (1 if true; 0 if false) is set in the condition bit (CC(7:0) bits; bits 31-24) in the FPSR register specified via cc#3. If cc#3 is omitted, it is set in the CC0 bit (bit 24).

-

Syntax "cmpfcnd.d reg1, reg2"

Via cmpfcnd.d, a corresponding "cmpf.d" instruction is generated (see "Table 5.49 cmpfcnd.d Instruction List" for details), and expanded in the format "cmpf.d imm4, reg1, reg2, cc#3". The content in single-precision floating-point format in the register pair specified by reg2 is compared with the content in single-precision floating-point format in the register pair specified by reg1, via the comparison condition. The result (1 if true; 0 if false) is set in the condition bit (CC(7:0) bits; bits 31-24) in the FPSR register specified via cc#3. If cc#3 is omitted, it is set in the CC0 bit (bit 24).

[Description]

-

If the instruction is executed in syntax "cmpf.d imm4, reg1, reg2, cc#3", the assembler generates one cmpf.d machine instruction.

-

If the instruction is executed in syntax "cmpfcnd.d reg1, reg2", the assembler generates the corresponding cmpf.d instruction (see "Table 5.49 cmpfcnd.d Instruction List") and expands it to syntax "cmpf.d imm4, reg1, reg2, cc#3".

Table 5.49

cmpfcnd.d Instruction List

Instruction

Condition

Meaning of Condition

Instruction Expansion

cmpff.d

FALSE

Always false

cmpf.d 0x0

cmpfun.d

Unordered

At least one of reg1 and reg2 is a non-number

cmpf.d 0x1

cmpfeq.d

reg2 = reg1

Neither is a non-number, and they are equal

cmpf.d 0x2

cmpfueq.d

reg2 ?= reg1

At least one is a non-number, or they are equal

cmpf.d 0x3

cmpfolt.d

reg2 < reg1

Neither is a non-number, and less than

cmpf.d 0x4

cmpfult.d

reg2 ?< reg1

At least one is a non-number, or less than

cmpf.d 0x5

cmpfole.d

reg2 <= reg1

Neither is a non-number, and less than or equal

cmpf.d 0x6

cmpfule.d

reg2 ?<= reg1

At least one is a non-number, or less than or equal

cmpf.d 0x7

cmpfsf.d

FALSE

Always false

cmpf.d 0x8

cmpfngle.d

Unordered

At least one of reg1 and reg2 is a non-number

cmpf.d 0x9

cmpfseq.d

reg2 = reg1

Neither is a non-number, and they are equal

cmpf.d 0xA

cmpfngl.d

reg2 ?= reg1

At least one is a non-number, or they are equal

cmpf.d 0xB

cmpflt.d

reg2 < reg1

Neither is a non-number, and less than

cmpf.d 0xC

cmpfnge.d

reg2 ?< reg1

At least one is a non-number, or less than

cmpf.d 0xD

cmpfle.d

reg2 <= reg1

Neither is a non-number, and less than or equal

cmpf.d 0xE

cmpfngt.d

reg2 ?<= reg1

At least one is a non-number, or less than or equal

cmpf.d 0xF

Remark

?: Unordered

[Caution]

-

If an absolute expression having a value exceeding 4 bits is specified as imm4 of the cmpf.d instruction, the following message is output, and assembly continues using the lower 4 bits of the specified value.

W0550011 : illegal operand (range error in immediate).