blob: 0f28d1acd8dbf4aa0ba371d9ca44778cd120010f [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)
buzbee2de973d2016-02-23 13:25:00 -080010 movl $$2, rINST
Bill Buzbee7c58bd42016-01-20 20:46:01 +000011 j${revcmp} 1f
buzbee2de973d2016-02-23 13:25:00 -080012 movswl 2(rPC), rINST # fetch signed displacement
Bill Buzbee7c58bd42016-01-20 20:46:01 +0000131:
buzbee2de973d2016-02-23 13:25:00 -080014 MTERP_PROFILE_BRANCH
15 addl rINST, rINST # eax <- AA * 2
16 leal (rPC, rINST), rPC
Bill Buzbee7c58bd42016-01-20 20:46:01 +000017 FETCH_INST
buzbee2de973d2016-02-23 13:25:00 -080018 jle MterpCheckSuspendAndContinue # AA * 2 <= 0 => suspend check
Bill Buzbee7c58bd42016-01-20 20:46:01 +000019 GOTO_NEXT