-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixing TriCore disasm instructions #2088
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d0ac226
Fix TriCore ld/st instructions using +r registers
11254b6
Fix TriCore abs insns using wrong source operand
54f2f14
Fix TriCore extr/_u insns using wrong source operand
b6d6904
Fix TriCore mtcr insns using wrong source register
13f9567
Fix TriCore store insns using +r or +c operands
8228bd3
TriCore: Add const8_fixup()
23455ce
suite/TriCore: Add test for rr insns
098a8ca
suite/TriCore: Add tests for ld/st with +r and +c operands
5944315
suite/TriCore: Add tests for extr and extr.u insns
62b99ad
suite/TriCore: Add tests for mtcr mfcr insns
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # CS_ARCH_TRICORE, CS_MODE_TRICORE_131, None | ||
| 0xcd, 0x41, 0xe0, 0x0f = mtcr #-0x1fc, d1 | ||
| 0x4d, 0x40, 0xe0, 0x2f = mfcr d2, #0xfe04 |
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,3 @@ | ||
| # CS_ARCH_TRICORE, CS_MODE_TRICORE_131, None | ||
| 0x17, 0x01, 0x40, 0x02 = extr d0, d1, e2 | ||
| 0x17, 0x01, 0x60, 0x02 = extr.u d0, d1, e2 |
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,47 @@ | ||
| # CS_ARCH_TRICORE, CS_MODE_TRICORE_162, None | ||
| 0xa9, 0x00, 0x80, 0x03 = cachea.i [p0+r] | ||
| 0xa9, 0x00, 0x8a, 0x07 = cachea.i [p0+c]#0xa | ||
| 0xa9, 0x00, 0x00, 0x03 = cachea.w [p0+r] | ||
| 0xa9, 0x00, 0x0a, 0x07 = cachea.w [p0+c]#0xa | ||
| 0xa9, 0x00, 0x40, 0x03 = cachea.wi [p0+r] | ||
| 0xa9, 0x00, 0x4a, 0x07 = cachea.wi [p0+c]#0xa | ||
| 0x69, 0x02, 0xc0, 0x00 = cmpswap.w [p0+r], e2 | ||
| 0x69, 0x02, 0xca, 0x04 = cmpswap.w [p0+c]#0xa, e2 | ||
| 0x29, 0x02, 0x80, 0x01 = ld.a a2, [p0+r] | ||
| 0x29, 0x02, 0x8a, 0x05 = ld.a a2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x00, 0x00 = ld.b d2, [p0+r] | ||
| 0x29, 0x02, 0x0a, 0x04 = ld.b d2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x40, 0x00 = ld.bu d2, [p0+r] | ||
| 0x29, 0x02, 0x4a, 0x04 = ld.bu d2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x40, 0x01 = ld.d e2, [p0+r] | ||
| 0x29, 0x02, 0x4a, 0x05 = ld.d e2, [p0+c]#0xa | ||
| 0x29, 0x02, 0xc0, 0x01 = ld.da p2, [p0+r] | ||
| 0x29, 0x02, 0xca, 0x05 = ld.da p2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x80, 0x00 = ld.h d2, [p0+r] | ||
| 0x29, 0x02, 0x8a, 0x04 = ld.h d2, [p0+c]#0xa | ||
| 0x29, 0x02, 0xc0, 0x00 = ld.hu d2, [p0+r] | ||
| 0x29, 0x02, 0xca, 0x04 = ld.hu d2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x00, 0x02 = ld.q d2, [p0+r] | ||
| 0x29, 0x02, 0x0a, 0x06 = ld.q d2, [p0+c]#0xa | ||
| 0x29, 0x02, 0x00, 0x01 = ld.w d2, [p0+r] | ||
| 0x29, 0x02, 0x0a, 0x05 = ld.w d2, [p0+c]#0xa | ||
| 0x69, 0x02, 0x40, 0x00 = ldmst [p0+r], e2 | ||
| 0x69, 0x02, 0x4a, 0x04 = ldmst [p0+c]#0xa, e2 | ||
| 0xa9, 0x02, 0x80, 0x01 = st.a [p0+r], a2 | ||
| 0xa9, 0x02, 0x8a, 0x05 = st.a [p0+c]#0xa, a2 | ||
| 0xa9, 0x02, 0x00, 0x00 = st.b [p0+r], d2 | ||
| 0xa9, 0x02, 0x0a, 0x04 = st.b [p0+c]#0xa, d2 | ||
| 0xa9, 0x02, 0x40, 0x01 = st.d [p0+r], e2 | ||
| 0xa9, 0x02, 0x4a, 0x05 = st.d [p0+c]#0xa, e2 | ||
| 0xa9, 0x02, 0xc0, 0x01 = st.da [p0+r], p2 | ||
| 0xa9, 0x02, 0xca, 0x05 = st.da [p0+c]#0xa, p2 | ||
| 0xa9, 0x02, 0x80, 0x00 = st.h [p0+r], d2 | ||
| 0xa9, 0x02, 0x8a, 0x04 = st.h [p0+c]#0xa, d2 | ||
| 0xa9, 0x02, 0x00, 0x02 = st.q [p0+r], d2 | ||
| 0xa9, 0x02, 0x0a, 0x06 = st.q [p0+c]#0xa, d2 | ||
| 0xa9, 0x02, 0x00, 0x01 = st.w [p0+r], d2 | ||
| 0xa9, 0x02, 0x0a, 0x05 = st.w [p0+c]#0xa, d2 | ||
| 0x69, 0x02, 0x00, 0x00 = swap.w [p0+r], d2 | ||
| 0x69, 0x02, 0x0a, 0x04 = swap.w [p0+c]#0xa, d2 | ||
| 0x69, 0x02, 0x80, 0x00 = swapmsk.w [p0+r], e2 | ||
| 0x69, 0x02, 0x8a, 0x04 = swapmsk.w [p0+c]#0xa, e2 |
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,6 @@ | ||
| # CS_ARCH_TRICORE, CS_MODE_TRICORE_131, None | ||
| 0x0b, 0x20, 0xc0, 0x01 = abs d0, d2 | ||
| 0x0b, 0x60, 0xc0, 0x05 = abs.b d0, d6 | ||
| 0x0b, 0x40, 0xc0, 0x27 = abs.h d2, d4 | ||
| 0x0b, 0x10, 0xd0, 0x01 = abss d0, d1 | ||
| 0x0b, 0x10, 0xd0, 0x07 = abss.h d0, d1 |
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.
I checked and found that you still haven't fully fixed it here.
Can you please double-check the following instructions?
d, s2[, s1[, n]]ADDSC.A
ADDSC.AT
MOV.A
MOV.AA
MOV.D
CRC32.B
CRC32B.W
CRC32L.W
aUPDFL
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.
They have been correct before. Not sure why. These are the insns I sent to capstone as well as GNU objdump and they agree.
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.
I remembered that we can also change the order of operands in the td file.