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