• 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    mov     r9, #4                      @ r0<- BYTE branch dist for not-taken
14    cmp     r2, #0                      @ compare (vA, 0)
15    b${revcmp}  1f                      @ branch to 1 if comparison failed
16    FETCH_S(r9, 1)                      @ r9<- branch offset, in code units
17    movs    r9, r9, asl #1              @ convert to bytes, check sign
18    bmi     common_backwardBranch       @ backward branch, do periodic checks
191:
20#if defined(WITH_JIT)
21    GET_JIT_PROF_TABLE(r0)
22    FETCH_ADVANCE_INST_RB(r9)           @ update rPC, load rINST
23    cmp     r0,#0
24    bne     common_updateProfile
25    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
26    GOTO_OPCODE(ip)                     @ jump to next instruction
27#else
28    FETCH_ADVANCE_INST_RB(r9)           @ update rPC, load rINST
29    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
30    GOTO_OPCODE(ip)                     @ jump to next instruction
31#endif
32