blob: 7c7d0ecf5a94a9c156b5b71daeb7d734fb39f1bd [file] [log] [blame]
Alexey Frunze00b53b72016-02-02 20:25:45 -08001 /*
2 * Unconditional branch, 8-bit offset.
3 *
4 * The branch distance is a signed code-unit offset, which we need to
5 * double to get a byte offset.
6 */
7 /* goto +AA */
Alexey Frunzedb045be2016-03-03 17:50:48 -08008 .extern MterpProfileBranch
9 srl rINST, rINST, 8
10 seb rINST, rINST # rINST <- offset (sign-extended AA)
11#if MTERP_PROFILE_BRANCHES
12 EXPORT_PC
13 move a0, rSELF
14 daddu a1, rFP, OFF_FP_SHADOWFRAME
15 move a2, rINST
16 jal MterpProfileBranch # (self, shadow_frame, offset)
17 bnezc v0, MterpOnStackReplacement # Note: offset must be in rINST
Alexey Frunze00b53b72016-02-02 20:25:45 -080018#endif
Alexey Frunzedb045be2016-03-03 17:50:48 -080019 dlsa rPC, rINST, rPC, 1 # rPC <- rPC + offset * 2
20 lw ra, THREAD_FLAGS_OFFSET(rSELF) # Preload flags for MterpCheckSuspendAndContinue
21 move a0, rINST # a0 <- offset
22 FETCH_INST # load rINST
23 bltz a0, MterpCheckSuspendAndContinue # suspend check if backwards branch
Alexey Frunze00b53b72016-02-02 20:25:45 -080024 GET_INST_OPCODE v0 # extract opcode from rINST
25 GOTO_OPCODE v0 # jump to next instruction