summaryrefslogtreecommitdiff
path: root/vm/mterp/x86/zcmp.S
blob: cbda889096da7662c6f6217282c9e6a480e235eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%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 */
    cmpl     $$0,(rFP,rINST,4)     # compare (vA, 0)
    movl     $$2,%eax              # assume branch not taken
    j${revcmp}   1f
    movl     rSELF,%ecx
    movswl   2(rPC),%eax           # fetch signed displacement
    movl     offThread_curHandlerTable(%ecx),rIBASE
1:
    FETCH_INST_INDEXED %eax
    ADVANCE_PC_INDEXED %eax
    GOTO_NEXT