1 %verify "branch taken" 2 %verify "branch not taken" 3 /* 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". 7 * 8 * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez 9 */ 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 15 b 2f 16 1: 17 li a1, 2 # a1- BYTE branch dist for not-taken 18 2: 19 addu a1, a1, a1 # convert to bytes 20 FETCH_ADVANCE_INST_RB(a1) # update rPC, load rINST 21 #if defined(WITH_JIT) 22 lw a0, offThread_pJitProfTable(rSELF) 23 bgez a1, 3f 24 lw rIBASE, offThread_curHandlerTable(rSELF) # refresh table base 25 3: 26 bnez a0, common_updateProfile # test for JIT off at target 27 #else 28 bgez a1, 4f 29 lw rIBASE, offThread_curHandlerTable(rSELF) # refresh rtable base 30 4: 31 #endif 32 GET_INST_OPCODE(t0) # extract opcode from rINST 33 GOTO_OPCODE(t0) # jump to next instruction 34