Skip to content

Commit

Permalink
modify comments
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed May 28, 2022
1 parent 13935df commit 3165aa3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/argmax.s
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ loop_start:
li t1, -1 # element counter
li t2, MIN # the largest element
loop_body:
slli t0, t1, 2 # bias
add t0, t0, s0 # the address of the element
lw t0, 0(t0) # the current element
slli t0, t1, 2
add t0, t0, s0 # the address of the current element
lw t0, 0(t0) # the value of the current element
blt t0, t2, loop_continue
beq t0, t2, handle_equal
mv s2, t1
Expand Down
18 changes: 9 additions & 9 deletions src/dot.s
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ checks_pass:
loop_start:
li t2, 0 # element counter
loop_body:
slli t0, t2, 2
mul t0, t0, s3 # bias
add t0, t0, s0 # the address of the element in v0
lw t0, 0(t0) # the current element of v0
slli t1, t2, 2
mul t1, t1, s4 # bias
add t1, t1, s1 # the address of the element in v1
lw t1, 0(t1) # the current element in v1
mul t3, t0, t1 # the product of the two elements
mul t0, t2, s3 # the index of the current element of v0
slli t0, t0, 2
add t0, t0, s0 # the address of the current element of v0
lw t0, 0(t0) # the value of the current element of v0
mul t1, t2, s4 # the index of the current element of v1
slli t1, t1, 2
add t1, t1, s1 # the address of the current element of v1
lw t1, 0(t1) # the value of the current element of v1
mul t3, t0, t1 # the product of the two values
add s5, s5, t3
# loop continue
addi t2, t2, 1
Expand Down
6 changes: 3 additions & 3 deletions src/relu.s
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ checks_pass:
loop_start:
li t1, 0 # element counter
loop_body:
slli, t0, t1, 2 # bias
add t0, t0, s0 # the address of the element
lw t2, 0(t0) # the current element
slli, t0, t1, 2
add t0, t0, s0 # the address of the current element
lw t2, 0(t0) # the value current element
bge t2, zero, loop_continue
sw zero, 0(t0)
loop_continue:
Expand Down

0 comments on commit 3165aa3

Please sign in to comment.