-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverse_int #262
Merged
Merged
reverse_int #262
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
@main{ | ||
input: int = const 123; | ||
n: int = id input; | ||
v0: int = const 0; | ||
v1: int = const 10; | ||
result: int = id v0; | ||
v2: bool = const true; | ||
notdone: bool = id v2; | ||
.for.cond.3: | ||
v4: bool = id notdone; | ||
br v4 .for.body.3 .for.end.3; | ||
.for.body.3: | ||
v5: int = id n; | ||
a: int = div v5 v1; | ||
floor: int = mul a v1; | ||
remainder: int = sub v5 floor; | ||
result: int = mul result v1; | ||
result: int = add result remainder; | ||
n: int = id a; | ||
comp1: bool = eq n v0; | ||
br comp1 .if.body .for.incre; | ||
.if.body: | ||
notdone: bool = const false; | ||
jmp .for.cond.3; | ||
.for.incre: | ||
jmp .for.cond.3; | ||
.for.end.3: | ||
print result; | ||
} | ||
|
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 @@ | ||
321 |
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 @@ | ||
total_dyn_inst: 47 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK, but to make the benchmark a little more reusable, you might consider making the input a parameter. Here's an example:
bril/benchmarks/core/armstrong.bril
Lines 1 to 2 in a7a0759
That is, you can make
input
a parameter to@main
and then give it a value like# ARGS: 123
for benchmark automation purposes.