blob: 5ce4f0f6a77ebe6e6c4b06cb9b3aebea1fff32bc [file] [log] [blame]
Bill Buzbee7c58bd42016-01-20 20:46:01 +00001/*
2 * Generic one-operand compare-and-branch operation. Provide a "revcmp"
3 * fragment that specifies the *reverse* comparison to perform, e.g.
4 * for "if-le" you would use "gt".
5 *
6 * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
7 */
8 /* if-cmp vAA, +BBBB */
9 cmpl $$0, VREG_ADDRESS(rINST) # compare (vA, 0)
10 movl $$2, %eax # assume branch not taken
11 j${revcmp} 1f
12 movswl 2(rPC),%eax # fetch signed displacement
131:
14 addl %eax, %eax # eax <- AA * 2
15 leal (rPC, %eax), rPC
16 FETCH_INST
17 jg 2f # AA * 2 > 0 => no suspend check
18#if MTERP_SUSPEND
19 REFRESH_IBASE
20#else
21 jmp MterpCheckSuspendAndContinue
22#endif
232:
24 GOTO_NEXT