Skip to main content

Is VMCPU_CMN_OPCODE compare negative or not

1 reply [Last post]
jiankercn
Offline
Joined: 2008-04-02
Points: 0

When I reading the src\mips\javavm\runtime\jit\jitemitter_cpu.c, I found a comment like this:
// If the opcode is CMN (compare negative), take the
// negative value of the rhs.
and source code like this:
if (cmpOpcode == CVMCPU_CMN_OPCODE) {
if (cmpRhsType == CVMMIPS_ALURHS_REGISTER) {
CVMCPUemitBinaryALURegister(con, CVMCPU_SUB_OPCODE,
CVMMIPS_t7, CVMMIPS_zero, cmpRhsReg,
CVMJIT_NOSETCC);

cmpRhsReg = CVMMIPS_t7;
} else {
cmpRhsConst = -cmpRhsConst;
}
}
But I also found a line in src\mips\javavm\include\jit\jitriscemitterdefs_cpu.h like this:
CVMCPU_CMN_OPCODE, /* cmp reg32, ~aluRhs32 */
Why it says CMN is cmp reg32, ~reg32, but cmp reg32, -reg32 when it is implemented?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16
Points: 0

The comments are wrong. It should be '-', not '~'.

Chris