blob: a16050b3714183d53efadef4b2e279670582456d [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, rINST # assume not taken
j${revcmp} 1f
movswq 2(rPC), rINSTq # Get signed branch offset
1:
MTERP_PROFILE_BRANCH
addq rINSTq, rINSTq # rax <- AA * 2
leaq (rPC, rINSTq), rPC
FETCH_INST
jle MterpCheckSuspendAndContinue # AA * 2 <= 0 => suspend check
GOTO_NEXT