%default { "func":"MterpDoPackedSwitch" } | |
/* | |
* Handle a packed-switch or sparse-switch instruction. In both cases | |
* we decode it and hand it off to a helper function. | |
* | |
* We don't really expect backward branches in a switch statement, but | |
* they're perfectly legal, so we check for them here. | |
* | |
* for: packed-switch, sparse-switch | |
*/ | |
/* op vAA, +BBBB */ | |
FETCH(a0, 1) # a0 <- bbbb (lo) | |
FETCH(a1, 2) # a1 <- BBBB (hi) | |
GET_OPA(a3) # a3 <- AA | |
sll t0, a1, 16 | |
or a0, a0, t0 # a0 <- BBBBbbbb | |
GET_VREG(a1, a3) # a1 <- vAA | |
EAS1(a0, rPC, a0) # a0 <- PC + BBBBbbbb*2 | |
JAL($func) # a0 <- code-unit branch offset | |
move rINST, v0 | |
b MterpCommonTakenBranchNoFlags |