Bill Buzbee | 3b0b4b9 | 2016-02-02 13:45:36 +0000 | [diff] [blame] | 1 | /* |
Bill Buzbee | 1d011d9 | 2016-04-04 16:59:29 +0000 | [diff] [blame] | 2 | * Generic one-operand compare-and-branch operation. Provide a "condition" |
| 3 | * fragment that specifies the comparison to perform. |
Bill Buzbee | 3b0b4b9 | 2016-02-02 13:45:36 +0000 | [diff] [blame] | 4 | * |
| 5 | * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez |
| 6 | */ |
| 7 | /* if-cmp vAA, +BBBB */ |
Bill Buzbee | 3b0b4b9 | 2016-02-02 13:45:36 +0000 | [diff] [blame] | 8 | lsr w0, wINST, #8 // w0<- AA |
| 9 | GET_VREG w2, w0 // w2<- vAA |
Bill Buzbee | 1d011d9 | 2016-04-04 16:59:29 +0000 | [diff] [blame] | 10 | FETCH_S wINST, 1 // w1<- branch offset, in code units |
Bill Buzbee | 3b0b4b9 | 2016-02-02 13:45:36 +0000 | [diff] [blame] | 11 | cmp w2, #0 // compare (vA, 0) |
Bill Buzbee | 1d011d9 | 2016-04-04 16:59:29 +0000 | [diff] [blame] | 12 | b.${condition} MterpCommonTakenBranchNoFlags |
| 13 | cmp wPROFILE, #JIT_CHECK_OSR // possible OSR re-entry? |
| 14 | b.eq .L_check_not_taken_osr |
| 15 | FETCH_ADVANCE_INST 2 |
Bill Buzbee | 3b0b4b9 | 2016-02-02 13:45:36 +0000 | [diff] [blame] | 16 | GET_INST_OPCODE ip // extract opcode from wINST |
| 17 | GOTO_OPCODE ip // jump to next instruction |