Andy McFadden | a5069fb | 2009-06-19 15:20:12 -0700 | [diff] [blame] | 1 | %verify "branch taken" |
| 2 | %verify "branch not taken" |
| 3 | /* |
| 4 | * Generic two-operand compare-and-branch operation. Provide a "revcmp" |
| 5 | * fragment that specifies the *reverse* comparison to perform, e.g. |
| 6 | * for "if-le" you would use "gt". |
| 7 | * |
| 8 | * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le |
| 9 | */ |
| 10 | /* if-cmp vA, vB, +CCCC */ |
| 11 | mov r1, rINST, lsr #12 @ r1<- B |
| 12 | ubfx r0, rINST, #8, #4 @ r0<- A |
| 13 | GET_VREG(r3, r1) @ r3<- vB |
| 14 | GET_VREG(r2, r0) @ r2<- vA |
buzbee | 9a3147c | 2011-03-02 15:43:48 -0800 | [diff] [blame] | 15 | FETCH_S(r1, 1) @ r1<- branch offset, in code units |
Andy McFadden | a5069fb | 2009-06-19 15:20:12 -0700 | [diff] [blame] | 16 | cmp r2, r3 @ compare (vA, vB) |
buzbee | 9a3147c | 2011-03-02 15:43:48 -0800 | [diff] [blame] | 17 | mov${revcmp} r1, #2 @ r1<- BYTE branch dist for not-taken |
| 18 | adds r2, r1, r1 @ convert to bytes, check sign |
| 19 | FETCH_ADVANCE_INST_RB(r2) @ update rPC, load rINST |
Andy McFadden | a5069fb | 2009-06-19 15:20:12 -0700 | [diff] [blame] | 20 | #if defined(WITH_JIT) |
buzbee | 9a3147c | 2011-03-02 15:43:48 -0800 | [diff] [blame] | 21 | ldr r0, [rSELF, #offThread_pJitProfTable] |
| 22 | ldrmi rIBASE, [rSELF, #offThread_curHandlerTable] @ refresh rIBASE |
| 23 | cmp r0, #0 |
| 24 | bne common_updateProfile |
Andy McFadden | a5069fb | 2009-06-19 15:20:12 -0700 | [diff] [blame] | 25 | #else |
buzbee | 9a3147c | 2011-03-02 15:43:48 -0800 | [diff] [blame] | 26 | ldrmi rIBASE, [rSELF, #offThread_curHandlerTable] @ refresh rIBASE |
| 27 | #endif |
Andy McFadden | a5069fb | 2009-06-19 15:20:12 -0700 | [diff] [blame] | 28 | GET_INST_OPCODE(ip) @ extract opcode from rINST |
| 29 | GOTO_OPCODE(ip) @ jump to next instruction |