• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%verify "executed"
2%verify "forward, backward, self"
3    /*
4     * Unconditional branch, 32-bit offset.
5     *
6     * The branch distance is a signed code-unit offset, which we need to
7     * double to get a byte offset.
8     *
9     * Unlike most opcodes, this one is allowed to branch to itself, so
10     * our "backward branch" test must be "<=0" instead of "<0".  The ORRS
11     * instruction doesn't affect the V flag, so we need to clear it
12     * explicitly.
13     */
14    /* goto/32 +AAAAAAAA */
15    FETCH(r0, 1)                        @ r0<- aaaa (lo)
16    FETCH(r1, 2)                        @ r1<- AAAA (hi)
17    cmp     ip, ip                      @ (clear V flag during stall)
18    orrs    r0, r0, r1, lsl #16         @ r0<- AAAAaaaa, check sign
19    mov     r9, r0, asl #1              @ r9<- byte offset
20    ble     common_backwardBranch       @ backward branch, do periodic checks
21    FETCH_ADVANCE_INST_RB(r9)           @ update rPC, load rINST
22    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
23    GOTO_OPCODE(ip)                     @ jump to next instruction
24
25