• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    mov     r0, rINST, lsr #8           @ r0<- AA
12    GET_VREG(r2, r0)                    @ r2<- vAA
13    FETCH_S(r1, 1)                      @ r1<- branch offset, in code units
14    cmp     r2, #0                      @ compare (vA, 0)
15    mov${revcmp} r1, #2                 @ r1<- inst branch dist for not-taken
16    adds    r1, r1, r1                  @ convert to bytes & set flags
17    FETCH_ADVANCE_INST_RB(r1)           @ update rPC, load rINST
18#if defined(WITH_JIT)
19    ldr     r0, [rSELF, #offThread_pJitProfTable]
20    ldrmi   rIBASE, [rSELF, #offThread_curHandlerTable]   @ refresh table base
21    cmp     r0,#0
22    bne     common_updateProfile        @ test for JIT off at target
23#else
24    ldrmi   rIBASE, [rSELF, #offThread_curHandlerTable]   @ refresh table base
25#endif
26    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
27    GOTO_OPCODE(ip)                     @ jump to next instruction
28