-
Notifications
You must be signed in to change notification settings - Fork 26
Fix relative jumps #50
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
Merged
ThomasWaldmann
merged 10 commits into
micropython:master
from
wnienhaus:fix-relative-jumps
Sep 27, 2021
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1e14bd1
add xxd tool for binary dumps from compat tests
wnienhaus a5601e8
add compat tests for relative jumps, which are already supported corr…
wnienhaus a96a7ee
refactor: rename sub_opcode and condition constants for JUMPR/JUMPS i…
wnienhaus d97cb13
fix JUMPS for all "single instruction" conditions
wnienhaus b2cdb24
implement the remaining "single instruction" JUMPR conditions
wnienhaus 180885d
add EQ condition for JUMPR and support for opcodes emitting >1 instru…
wnienhaus a3b84c3
add EQ condition for JUMPS
wnienhaus 82e2765
add GT condition for JUMPS
wnienhaus 7eda90c
fix relative jumps for immediate offsets
wnienhaus c29b7a2
add compat tests for relative jumps with immediate offset from absolu…
wnienhaus 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,64 @@ | ||
.text | ||
.set const, 3 | ||
.global const # exporting symbol is required for binutils, not important for py-esp32-ulp | ||
|
||
entry: | ||
nop | ||
|
||
# jumps with labels | ||
jumps entry, 42, lt | ||
jumps entry, 42, lt | ||
jumps later, 42, lt | ||
jumps entry, 42, le | ||
jumps later, 42, le | ||
jumps entry, 42, ge | ||
jumps later, 42, ge | ||
jumps entry, 42, eq | ||
jumps later, 42, eq | ||
jumps entry, 42, gt | ||
jumps later, 42, gt | ||
|
||
# jumps with immediate offset (specified in bytes, but real instruction uses words) | ||
jumps 0, 42, lt | ||
|
||
jumps 4, 42, lt | ||
jumps 8, 42, lt | ||
jumps 32, 42, lt | ||
|
||
jumps -4, 42, lt | ||
jumps -8, 42, lt | ||
jumps -32, 42, lt | ||
|
||
# jumps with immediate offset from absolute symbol | ||
jumps const, 42, lt | ||
|
||
# jumpr with labels | ||
jumpr entry, 42, lt | ||
jumpr later, 42, lt | ||
jumpr entry, 42, ge | ||
jumpr later, 42, ge | ||
jumpr entry, 42, le | ||
jumpr later, 42, le | ||
jumpr entry, 42, gt | ||
jumpr later, 42, gt | ||
jumpr entry, 42, eq | ||
jumpr later, 42, eq | ||
|
||
# jumpr with immediate offset (specified in bytes, but real instruction uses words) | ||
jumpr 0, 42, lt | ||
|
||
jumpr 4, 42, lt | ||
jumpr 8, 42, lt | ||
jumpr 32, 42, lt | ||
|
||
jumpr -4, 42, lt | ||
jumpr -8, 42, lt | ||
jumpr -32, 42, lt | ||
|
||
# jumps with immediate offset from absolute symbol | ||
jumpr const, 42, lt | ||
|
||
nop | ||
nop | ||
nop | ||
later: |
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.
Uh oh!
There was an error while loading. Please reload this page.