Skip to content
Snippets Groups Projects
Commit aea5b42f authored by Pavel Pisa's avatar Pavel Pisa
Browse files

seminaries/qtrvsim/branchpred-1: include example for branch predictor


Signed-off-by: default avatarPavel Pisa <pisa@cmp.felk.cvut.cz>
parent d4430035
No related branches found
No related tags found
No related merge requests found
# i = s0, j = s1, c = s2, t0 = outer loop limits, t1 = inner loop limit, t3 - auxiliary variable
addi s1, zero, 0 # c = 0;
addi t0, zero, 4 # t0 = 500;
addi t1, zero, 5 # t1 = 2
addi s0, zero, 0 # i = 0;
L1:
addi s1, zero, 0 # j = 0;
L2:
addi s2, s2, 1 # c++;
addi s1, s1, 1 # j++;
slt t3, s1, t1 # t3 = (s1 < t1) ? 1 : 0;
bne t3, zero, L2
addi s0, s0, 1 # i++;
slt t3, s0, t0 # t3 = (s0 < t0) ? 1 : 0;
bne t3, zero, L1
ebreak
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment