2 %verify "branch not taken"
4 * Generic one-operand compare-and-branch operation. Provide a "revcmp"
5 * fragment that specifies the *reverse* comparison to perform, e.g.
6 * for "if-le" you would use "gt".
8 * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
10 /* if-cmp vAA, +BBBB */
11 GET_OPA(a0) # a0 <- AA
12 GET_VREG(a2, a0) # a2 <- vAA
13 FETCH_S(a1, 1) # a1 <- branch offset, in code units
14 b${revcmp} a2, zero, 1f # branch to 1 if comparison failed
17 li a1, 2 # a1- BYTE branch dist for not-taken
19 addu a1, a1, a1 # convert to bytes
20 FETCH_ADVANCE_INST_RB(a1) # update rPC, load rINST
22 lw a0, offThread_pJitProfTable(rSELF)
24 lw rIBASE, offThread_curHandlerTable(rSELF) # refresh table base
26 bnez a0, common_updateProfile # test for JIT off at target
29 lw rIBASE, offThread_curHandlerTable(rSELF) # refresh rtable base
32 GET_INST_OPCODE(t0) # extract opcode from rINST
33 GOTO_OPCODE(t0) # jump to next instruction