-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use call and return for internal function call
- Loading branch information
Showing
17 changed files
with
444 additions
and
386 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#returnaddress=stack | ||
fn add(reg u128 x, reg u128 z) -> reg u128 { | ||
reg u128 y; | ||
stack u128[2] t; | ||
y = z; | ||
t[0] = x; | ||
t[1] = y; | ||
x ^= t[0]; | ||
y ^= t[1]; | ||
x ^= y; | ||
return x; | ||
} | ||
|
||
u128 c3 = 3; | ||
u128 c7 = 7; | ||
|
||
export fn main() -> reg u128 { | ||
|
||
reg u128 x y z; | ||
stack u128 s; | ||
x = c3; | ||
y = c7; | ||
z = #set0_128(); | ||
s = z; | ||
x = add(x, y); | ||
x ^= s; | ||
x = add(x, y); | ||
x ^= s; | ||
x = add(x, y); | ||
x ^= s; | ||
return x; | ||
} |
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
Oops, something went wrong.