blob: 5e4225fd863799b9bc7d6962640c5822e6ba3778 [file] [log] [blame]
/*
* Generic two-operand compare-and-branch operation. Provide a "revcmp"
* fragment that specifies the *reverse* comparison to perform, e.g.
* for "if-le" you would use "gt".
*
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
movl rINST, %ecx # rcx <- A+
sarl $$4, rINST # rINST <- B
andb $$0xf, %cl # rcx <- A
GET_VREG %eax, %rcx # eax <- vA
cmpl VREG_ADDRESS(rINSTq), %eax # compare (vA, vB)
movl $$2, %eax # assume not taken
j${revcmp} 1f
movswq 2(rPC),%rax # Get signed branch offset
1:
addq %rax, %rax # rax <- AA * 2
leaq (rPC, %rax), rPC
FETCH_INST
jg 2f # AA * 2 > 0 => no suspend check
#if MTERP_SUSPEND
REFRESH_IBASE
#else
jmp MterpCheckSuspendAndContinue
#endif
2:
GOTO_NEXT