-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[Hexagon][llvm-objdump] Improve disassembly of Hexagon bundles #145807
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
Open
quic-areg
wants to merge
5
commits into
llvm:main
Choose a base branch
from
quic-areg:hexagon-objdump
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+297
−138
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60db144
[Hexagon][llvm-objdump] Improve disassembly of Hexagon bundles
quic-areg 6527156
fix braces style
quic-areg d12711d
add newline for test
quic-areg 09499d6
- remove getInstructionSeparator
quic-areg c5953e6
fix empty check-next
quic-areg 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
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
47 changes: 47 additions & 0 deletions
47
llvm/test/tools/llvm-objdump/ELF/Hexagon/hexagon-bundles.s
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 @@ | ||
/// Checks that various hexagon scenarios are handled correctly: | ||
/// - branch targets | ||
/// - endloops | ||
/// - inline-relocs | ||
/// - multi-insn bundles | ||
|
||
{ | ||
r6 = sub(r1, r0) | ||
r7 = and(r4, #0x0) | ||
if (p1) jump:t target1 | ||
if (p2) jump:nt target2 | ||
} | ||
|
||
{ | ||
r8 = r7 | ||
r9 = add(r8, #0) | ||
r10 = memw(r9) | ||
} :endloop0 | ||
|
||
{ jump ##sym } | ||
|
||
target1: | ||
nop | ||
|
||
target2: | ||
nop | ||
|
||
// RUN: llvm-mc %s --triple=hexagon -filetype=obj | llvm-objdump -d -r - | FileCheck %s | ||
|
||
// CHECK: 00000000 <.text>: | ||
// CHECK-NEXT: 0: 12 51 00 5c 5c005112 { if (p1) jump:t 0x24 <target1> | ||
// CHECK-NEXT: 4: 14 42 00 5c 5c004214 if (p2) jump:nt 0x28 <target2> | ||
// CHECK-NEXT: 8: 06 41 20 f3 f3204106 r6 = sub(r1,r0) | ||
// CHECK-NEXT: c: 07 c0 04 76 7604c007 r7 = and(r4,#0x0) } | ||
// CHECK-NEXT: 10: 08 80 67 70 70678008 { r8 = r7 | ||
// CHECK-NEXT: 14: 09 40 08 b0 b0084009 r9 = add(r8,#0x0) | ||
// CHECK-NEXT: 18: 0a c0 89 91 9189c00a r10 = memw(r9+#0x0) } :endloop0 | ||
// CHECK-NEXT: 1c: 00 40 00 00 00004000 { immext(#0x0) | ||
// CHECK-NEXT: 0000001c: R_HEX_B32_PCREL_X sym | ||
// CHECK-NEXT: 20: 00 c0 00 58 5800c000 jump 0x1c <.text+0x1c> } | ||
// CHECK-NEXT: 00000020: R_HEX_B22_PCREL_X sym+0x4 | ||
// CHECK-EMPTY: | ||
// CHECK-NEXT: 00000024 <target1>: | ||
// CHECK-NEXT: 24: 00 c0 00 7f 7f00c000 { nop } | ||
// CHECK-EMPTY: | ||
// CHECK-NEXT: 00000028 <target2>: | ||
// CHECK-NEXT: 28: 00 c0 00 7f 7f00c000 { nop } |
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
Oops, something went wrong.
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.
BytesToSkip += HEXAGON_INSTR_SIZE;
- is this right? Are you testing duplex instructions here too? If so that might not be the right constant to use here.if (Bytes.size() < HEXAGON_INSTR_SIZE)
is probably safe though.Aside: we should probably define independent
HEXAGON_MAX_PACKET_SIZE_BYTES
andHEXAGON_MAX_PACKET_SIZE_INSTS
to clear this up.