Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [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(rINSTq) # compare (vA, 0) |
Serguei Katkov | c8705a7 | 2016-02-26 13:00:40 +0600 | [diff] [blame] | 10 | movl $$2, rINST # assume branch not taken |
Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [diff] [blame] | 11 | j${revcmp} 1f |
Serguei Katkov | c8705a7 | 2016-02-26 13:00:40 +0600 | [diff] [blame] | 12 | movswq 2(rPC), rINSTq # fetch signed displacement |
Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [diff] [blame] | 13 | 1: |
Serguei Katkov | c8705a7 | 2016-02-26 13:00:40 +0600 | [diff] [blame] | 14 | MTERP_PROFILE_BRANCH |
| 15 | addq rINSTq, rINSTq # rINSTq <- AA * 2 |
| 16 | leaq (rPC, rINSTq), rPC |
Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [diff] [blame] | 17 | FETCH_INST |
Serguei Katkov | c8705a7 | 2016-02-26 13:00:40 +0600 | [diff] [blame] | 18 | jle MterpCheckSuspendAndContinue # AA * 2 <= 0 => suspend check |
Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [diff] [blame] | 19 | GOTO_NEXT |