Bill Buzbee | 7c58bd4 | 2016-01-20 20:46:01 +0000 | [diff] [blame] | 1 | /* |
| 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 |
| 13 | 1: |
| 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 |
| 23 | 2: |
| 24 | GOTO_NEXT |