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 #if defined(WITH_JIT) 22 GET_JIT_PROF_TABLE(r0) 23 FETCH_ADVANCE_INST_RB(r9) @ update rPC, load rINST 24 cmp r0,#0 25 bne common_updateProfile 26 GET_INST_OPCODE(ip) @ extract opcode from rINST 27 GOTO_OPCODE(ip) @ jump to next instruction 28 #else 29 FETCH_ADVANCE_INST_RB(r9) @ update rPC, load rINST 30 GET_INST_OPCODE(ip) @ extract opcode from rINST 31 GOTO_OPCODE(ip) @ jump to next instruction 32 #endif 33