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) |
buzbee | 2de973d | 2016-02-23 13:25:00 -0800 | [diff] [blame^] | 10 | movl $$2, rINST |
Bill Buzbee | 7c58bd4 | 2016-01-20 20:46:01 +0000 | [diff] [blame] | 11 | j${revcmp} 1f |
buzbee | 2de973d | 2016-02-23 13:25:00 -0800 | [diff] [blame^] | 12 | movswl 2(rPC), rINST # fetch signed displacement |
Bill Buzbee | 7c58bd4 | 2016-01-20 20:46:01 +0000 | [diff] [blame] | 13 | 1: |
buzbee | 2de973d | 2016-02-23 13:25:00 -0800 | [diff] [blame^] | 14 | MTERP_PROFILE_BRANCH |
| 15 | addl rINST, rINST # eax <- AA * 2 |
| 16 | leal (rPC, rINST), rPC |
Bill Buzbee | 7c58bd4 | 2016-01-20 20:46:01 +0000 | [diff] [blame] | 17 | FETCH_INST |
buzbee | 2de973d | 2016-02-23 13:25:00 -0800 | [diff] [blame^] | 18 | jle MterpCheckSuspendAndContinue # AA * 2 <= 0 => suspend check |
Bill Buzbee | 7c58bd4 | 2016-01-20 20:46:01 +0000 | [diff] [blame] | 19 | GOTO_NEXT |