-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[MC] Honour alignment directive fill value for non-intel #100136
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 2 commits
Commits
Show all changes
3 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // RUN: llvm-mc -triple aarch64 %s -o - | FileCheck %s --check-prefix=ASM | ||
| // RUN: llvm-mc -triple aarch64 -filetype obj %s -o - | \ | ||
| // RUN: llvm-objdump -dz - | FileCheck %s --check-prefix=OBJ | ||
|
|
||
| // llvm.org/pr30955 - LLVM was handling `.balign <alignment>, 0` strangely on | ||
| // non-x86 targets. | ||
|
|
||
| .text | ||
|
|
||
| // ASM: add x14, x14, #1 | ||
| // OBJ: 910005ce add x14, x14, #0x1 | ||
| add x14, x14, 0x1 | ||
|
|
||
| // ASM: .p2align 4, 0x0 | ||
| // OBJ-NEXT: 00000000 udf #0x0 | ||
| // OBJ-NEXT: 00000000 udf #0x0 | ||
| // OBJ-NEXT: 00000000 udf #0x0 | ||
| .balign 0x10, 0 | ||
|
|
||
| // ASM: add x14, x14, #1 | ||
| // OBJ-NEXT: 910005ce add x14, x14, #0x1 | ||
| add x14, x14, 0x1 |
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,40 @@ | ||
| // RUN: llvm-mc -triple armv7a %s -o - | FileCheck %s --check-prefix=ASM-ARM | ||
| // RUN: llvm-mc -triple armv7a -filetype obj %s -o - | \ | ||
| // RUN: llvm-objdump --triple=armv7a -dz - | FileCheck %s --check-prefix=OBJ-ARM | ||
|
|
||
| // RUN: llvm-mc -triple thumbv7a %s -o - | FileCheck %s --check-prefix=ASM-THUMB | ||
| // RUN: llvm-mc -triple thumbv7a -filetype obj %s -o - | \ | ||
| // RUN: llvm-objdump --triple=thumbv7a -dz - | FileCheck %s --check-prefix=OBJ-THUMB | ||
|
|
||
| // llvm.org/pr30955 - LLVM was handling `.balign <alignment>, 0` strangely on | ||
| // non-x86 targets. | ||
|
|
||
| .text | ||
|
|
||
| // ASM-ARM: add r0, r0, #1 | ||
| // OBJ-ARM: e2800001 add r0, r0, #1 | ||
|
|
||
| // ASM-THUMB: add.w r0, r0, #1 | ||
| // OBJ-THUMB: f100 0001 add.w r0, r0, #0x1 | ||
| add r0, r0, 0x1 | ||
|
|
||
| // ASM-ARM: .p2align 4, 0x0 | ||
| // OBJ-ARM-NEXT: 00000000 andeq r0, r0, r0 | ||
| // OBJ-ARM-NEXT: 00000000 andeq r0, r0, r0 | ||
| // OBJ-ARM-NEXT: 00000000 andeq r0, r0, r0 | ||
|
|
||
| // ASM-THUMB: .p2align 4, 0x0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| // OBJ-THUMB-NEXT: 0000 movs r0, r0 | ||
| .balign 0x10, 0 | ||
|
|
||
| // ASM-ARM: add r0, r0, #1 | ||
| // OBJ-ARM-NEXT: e2800001 add r0, r0, #1 | ||
|
|
||
| // ASM-THUMB: add.w r0, r0, #1 | ||
| // OBJ-THUMB-NEXT: f100 0001 add.w r0, r0, #0x1 | ||
| add r0, r0, 0x1 |
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 |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| .text | ||
| f0: | ||
| .long 0 | ||
| .align 8, 0x90 | ||
| .align 8 | ||
| .long 0 | ||
| .align 8 | ||
|
|
||
|
|
||
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,29 @@ | ||
| // RUN: llvm-mc -triple riscv32 %s -o - | FileCheck %s --check-prefix=ASM | ||
| // RUN: llvm-mc -triple riscv32 -filetype obj %s -o - | \ | ||
| // RUN: llvm-objdump -dz - | FileCheck %s --check-prefix=OBJ | ||
|
|
||
| // RUN: llvm-mc -triple riscv64 %s -o - | FileCheck %s --check-prefix=ASM | ||
| // RUN: llvm-mc -triple riscv64 -filetype obj %s -o - | \ | ||
| // RUN: llvm-objdump -dz - | FileCheck %s --check-prefix=OBJ | ||
|
|
||
| // llvm.org/pr30955 - LLVM was handling `.balign <alignment>, 0` strangely on | ||
| // non-x86 targets. | ||
|
|
||
| .text | ||
|
|
||
| // ASM: addi a0, a0, 1 | ||
| // OBJ: 00150513 addi a0, a0, 0x1 | ||
| addi a0, a0, 0x1 | ||
|
|
||
| // ASM: .p2align 4, 0x0 | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| // OBJ-NEXT: 0000 <unknown> | ||
| .balign 0x10, 0 | ||
|
|
||
| // ASM: addi a0, a0, 1 | ||
| // OBJ-NEXT: 00150513 addi a0, a0, 0x1 | ||
| addi a0, a0, 0x1 | ||
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.
Best to use a descriptive name instead of
PRxxxxx.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.
align-zero.s might be a good name
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 chose
align-fill-byte-zero.sto show that it's really about byte alignment directives, and not wider alignment directives (.{b,p2,}align{l,w})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.
Sounds great!