}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
ADVANCE(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
ADVANCE(2);
}
}
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
}
inst = inst->RelativeAt(offset);
} else {
+ BRANCH_INSTRUMENTATION(2);
inst = inst->Next_2xx();
}
break;
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- b${revcmp} .L_${opcode}_not_taken
+ mov${revcmp} rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_${opcode}_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- mov${revcmp} rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- b${revcmp} .L_${opcode}_not_taken
+ mov${revcmp} rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_${opcode}_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- mov${revcmp} rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.${condition} .L_${opcode}_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_${opcode}_taken:
+ csel wINST, w1, w0, ${condition} // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, ${condition} // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.${condition} .L_${opcode}_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_${opcode}_taken:
+ csel wINST, w1, w0, ${condition} // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, ${condition} // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- bne .L_op_if_eq_not_taken
+ movne rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_eq_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- movne rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- beq .L_op_if_ne_not_taken
+ moveq rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_ne_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- moveq rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- bge .L_op_if_lt_not_taken
+ movge rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_lt_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- movge rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- blt .L_op_if_ge_not_taken
+ movlt rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_ge_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- movlt rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- ble .L_op_if_gt_not_taken
+ movle rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_gt_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- movle rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
mov r1, rINST, lsr #12 @ r1<- B
ubfx r0, rINST, #8, #4 @ r0<- A
GET_VREG r3, r1 @ r3<- vB
GET_VREG r2, r0 @ r2<- vA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
cmp r2, r3 @ compare (vA, vB)
- bgt .L_op_if_le_not_taken
+ movgt rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r2, rINST, rINST @ convert to bytes, check sign
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_le_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r1, rINST, lsr #12 @ r1<- B
- ubfx r0, rINST, #8, #4 @ r0<- A
- GET_VREG r3, r1 @ r3<- vB
- GET_VREG r2, r0 @ r2<- vA
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- cmp r2, r3 @ compare (vA, vB)
- movgt rINST, #2 @ rINST<- BYTE branch dist for not-taken
- adds r2, rINST, rINST @ convert to bytes, check sign
- FETCH_ADVANCE_INST_RB r2 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- bne .L_op_if_eqz_not_taken
+ movne rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_eqz_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- movne rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- beq .L_op_if_nez_not_taken
+ moveq rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_nez_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- moveq rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- bge .L_op_if_ltz_not_taken
+ movge rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_ltz_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- movge rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- blt .L_op_if_gez_not_taken
+ movlt rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_gez_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- movlt rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- ble .L_op_if_gtz_not_taken
+ movle rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_gtz_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- movle rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
mov r0, rINST, lsr #8 @ r0<- AA
GET_VREG r2, r0 @ r2<- vAA
FETCH_S rINST, 1 @ rINST<- branch offset, in code units
ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
cmp r2, #0 @ compare (vA, 0)
- bgt .L_op_if_lez_not_taken
+ movgt rINST, #2
+#if MTERP_PROFILE_BRANCHES
+ @ TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov r0, rSELF
add r1, rFP, #OFF_FP_SHADOWFRAME
bl MterpProfileBranch @ (self, shadow_frame, offset)
cmp r0, #0
bne MterpOnStackReplacement @ Note: offset must be in rINST
+#endif
adds r1, rINST, rINST @ convert to bytes & set flags
FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
bmi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip @ extract opcode from rINST
GOTO_OPCODE ip @ jump to next instruction
-.L_op_if_lez_not_taken:
- FETCH_ADVANCE_INST 2 @ update rPC, load rINST
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#else
- mov r0, rINST, lsr #8 @ r0<- AA
- GET_VREG r2, r0 @ r2<- vAA
- FETCH_S rINST, 1 @ rINST<- branch offset, in code units
- ldr lr, [rSELF, #THREAD_FLAGS_OFFSET]
- cmp r2, #0 @ compare (vA, 0)
- movgt rINST, #2 @ rINST<- inst branch dist for not-taken
- adds r1, rINST, rINST @ convert to bytes & set flags
- FETCH_ADVANCE_INST_RB r1 @ update rPC, load rINST
- bmi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip @ extract opcode from rINST
- GOTO_OPCODE ip @ jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.eq .L_op_if_eq_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_eq_taken:
+ csel wINST, w1, w0, eq // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, eq // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.ne .L_op_if_ne_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_ne_taken:
+ csel wINST, w1, w0, ne // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, ne // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.lt .L_op_if_lt_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_lt_taken:
+ csel wINST, w1, w0, lt // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, lt // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.ge .L_op_if_ge_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_ge_taken:
+ csel wINST, w1, w0, ge // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, ge // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.gt .L_op_if_gt_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_gt_taken:
+ csel wINST, w1, w0, gt // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, gt // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
*/
/* if-cmp vA, vB, +CCCC */
-#if MTERP_PROFILE_BRANCHES
lsr w1, wINST, #12 // w1<- B
ubfx w0, wINST, #8, #4 // w0<- A
GET_VREG w3, w1 // w3<- vB
GET_VREG w2, w0 // w2<- vA
- FETCH_S wINST, 1 // wINST<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Offset if branch not taken
cmp w2, w3 // compare (vA, vB)
- b.le .L_op_if_le_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_le_taken:
+ csel wINST, w1, w0, le // Branch if true, stashing result in callee save reg.
+#if MTERP_PROFILE_BRANCHES
+ // TUINING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31 // Sign extend branch offset
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in xINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes, check sign
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w1, wINST, #12 // w1<- B
- ubfx w0, wINST, #8, #4 // w0<- A
- GET_VREG w3, w1 // w3<- vB
- GET_VREG w2, w0 // w2<- vA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Offset if branch not taken
- cmp w2, w3 // compare (vA, vB)
- csel wINST, w1, w0, le // Branch if true, stashing result in callee save reg.
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes, check sign
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.eq .L_op_if_eqz_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_eqz_taken:
+ csel wINST, w1, w0, eq // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, eq // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.ne .L_op_if_nez_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_nez_taken:
+ csel wINST, w1, w0, ne // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, ne // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.lt .L_op_if_ltz_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_ltz_taken:
+ csel wINST, w1, w0, lt // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, lt // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.ge .L_op_if_gez_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_gez_taken:
+ csel wINST, w1, w0, ge // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, ge // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.gt .L_op_if_gtz_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_gtz_taken:
+ csel wINST, w1, w0, gt // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, gt // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */
* for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
*/
/* if-cmp vAA, +BBBB */
-#if MTERP_PROFILE_BRANCHES
lsr w0, wINST, #8 // w0<- AA
GET_VREG w2, w0 // w2<- vAA
- FETCH_S wINST, 1 // w1<- branch offset, in code units
+ FETCH_S w1, 1 // w1<- branch offset, in code units
+ mov w0, #2 // Branch offset if not taken
cmp w2, #0 // compare (vA, 0)
- b.le .L_op_if_lez_taken
- FETCH_ADVANCE_INST 2 // update rPC, load wINST
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-.L_op_if_lez_taken:
+ csel wINST, w1, w0, le // Branch if true, stashing result in callee save reg
+#if MTERP_PROFILE_BRANCHES
+ // TUNING: once measurements are complete, remove #if and hand-schedule.
EXPORT_PC
mov x0, xSELF
add x1, xFP, #OFF_FP_SHADOWFRAME
sbfm x2, xINST, 0, 31
bl MterpProfileBranch // (self, shadow_frame, offset)
cbnz w0, MterpOnStackReplacement // Note: offset must be in wINST
+#endif
ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
adds w2, wINST, wINST // convert to bytes & set flags
FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
b.mi MterpCheckSuspendAndContinue
GET_INST_OPCODE ip // extract opcode from wINST
GOTO_OPCODE ip // jump to next instruction
-#else
- lsr w0, wINST, #8 // w0<- AA
- GET_VREG w2, w0 // w2<- vAA
- FETCH_S w1, 1 // w1<- branch offset, in code units
- mov w0, #2 // Branch offset if not taken
- cmp w2, #0 // compare (vA, 0)
- csel wINST, w1, w0, le // Branch if true, stashing result in callee save reg
- ldr w7, [xSELF, #THREAD_FLAGS_OFFSET]
- adds w2, wINST, wINST // convert to bytes & set flags
- FETCH_ADVANCE_INST_RB w2 // update rPC, load wINST
- b.mi MterpCheckSuspendAndContinue
- GET_INST_OPCODE ip // extract opcode from wINST
- GOTO_OPCODE ip // jump to next instruction
-#endif
/* ------------------------------ */