1    /*
2     * Unconditional branch, 32-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     * Unlike most opcodes, this one is allowed to branch to itself, so
8     * our "backward branch" test must be "<=0" instead of "<0".
9     */
10    /* goto/32 +AAAAAAAA */
11    .extern MterpProfileBranch
12    lh      rINST, 2(rPC)               # rINST <- aaaa (low)
13    lh      a1, 4(rPC)                  # a1 <- AAAA (high)
14    ins     rINST, a1, 16, 16           # rINST <- offset (sign-extended AAAAaaaa)
15#if MTERP_PROFILE_BRANCHES
16    EXPORT_PC
17    move    a0, rSELF
18    daddu   a1, rFP, OFF_FP_SHADOWFRAME
19    move    a2, rINST
20    jal     MterpProfileBranch          # (self, shadow_frame, offset)
21    bnezc   v0, MterpOnStackReplacement # Note: offset must be in rINST
22#endif
23    dlsa    rPC, rINST, rPC, 1          # rPC <- rPC + offset * 2
24    lw      ra, THREAD_FLAGS_OFFSET(rSELF)  # Preload flags for MterpCheckSuspendAndContinue
25    move    a0, rINST                   # a0 <- offset
26    FETCH_INST                          # load rINST
27    blez    a0, MterpCheckSuspendAndContinue  # suspend check if backwards branch
28    GET_INST_OPCODE v0                  # extract opcode from rINST
29    GOTO_OPCODE v0                      # jump to next instruction
30