summaryrefslogtreecommitdiff
path: root/vm/mterp/armv5te/zcmp.S
blob: bd63fe443d9c0a2c029f612127ff79e9f99105a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%verify "branch taken"
%verify "branch not taken"
    /*
     * Generic one-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-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
     */
    /* if-cmp vAA, +BBBB */
    mov     r0, rINST, lsr #8           @ r0<- AA
    GET_VREG(r2, r0)                    @ r2<- vAA
    FETCH_S(r1, 1)                      @ r1<- branch offset, in code units
    cmp     r2, #0                      @ compare (vA, 0)
    mov${revcmp} r1, #2                 @ r1<- inst branch dist for not-taken
    adds    r1, r1, r1                  @ convert to bytes & set flags
    FETCH_ADVANCE_INST_RB(r1)           @ update rPC, load rINST
#if defined(WITH_JIT)
    ldr     r0, [rSELF, #offThread_pJitProfTable]
    ldrmi   rIBASE, [rSELF, #offThread_curHandlerTable]   @ refresh table base
    cmp     r0,#0
    bne     common_updateProfile        @ test for JIT off at target
#else
    ldrmi   rIBASE, [rSELF, #offThread_curHandlerTable]   @ refresh table base
#endif
    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
    GOTO_OPCODE(ip)                     @ jump to next instruction