Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 1 | %default { "func":"MterpDoPackedSwitch" } |
| 2 | /* |
| 3 | * Handle a packed-switch or sparse-switch instruction. In both cases |
| 4 | * we decode it and hand it off to a helper function. |
| 5 | * |
| 6 | * We don't really expect backward branches in a switch statement, but |
| 7 | * they're perfectly legal, so we check for them here. |
| 8 | * |
| 9 | * for: packed-switch, sparse-switch |
| 10 | */ |
| 11 | /* op vAA, +BBBB */ |
Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 12 | FETCH(a0, 1) # a0 <- bbbb (lo) |
| 13 | FETCH(a1, 2) # a1 <- BBBB (hi) |
| 14 | GET_OPA(a3) # a3 <- AA |
Alexey Frunze | 84603bf | 2016-10-21 19:54:43 -0700 | [diff] [blame] | 15 | INSERT_HIGH_HALF(a0, a1) # a0 <- BBBBbbbb |
Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 16 | GET_VREG(a1, a3) # a1 <- vAA |
| 17 | EAS1(a0, rPC, a0) # a0 <- PC + BBBBbbbb*2 |
| 18 | JAL($func) # a0 <- code-unit branch offset |
| 19 | move rINST, v0 |
Douglas Leung | 020b18a | 2016-06-03 18:05:35 -0700 | [diff] [blame] | 20 | b MterpCommonTakenBranchNoFlags |