-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
695edb6
commit 850461c
Showing
3 changed files
with
17 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
#include "constants.h" | ||
|
||
.section .text | ||
.globl add_asm_function2 | ||
.globl mul_by_const_asm_function | ||
|
||
add_asm_function2: | ||
flw f0,0(a0) | ||
flw f1,0(a1) | ||
#check if it gets executed in a branch shadow | ||
cv.starti 0, start_loop | ||
cv.endi 0, end_loop | ||
cv.counti 0, 100 | ||
start_loop: | ||
.balign 4 | ||
fadd.s fa0, f0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
fadd.s fa0, fa0, f1 # Add the values in a0 and a1, store the result in a0 | ||
end_loop: | ||
ret # Return from the function | ||
mul_by_const_asm_function: | ||
li t0, MULTIPLY_CONSTANT # Load the constant into temporary register t0 | ||
mul a0, a0, t0 # Multiply the value in a0 by the constant in t0 | ||
ret # Return from the function |