-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[ms] [llvm-ml] Allow PTR casting of registers to their own size #132751
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 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0d0c008
[ms] [llvm-ml] Allow PTR casting of registers to their own size
ericastor 5fbf8b6
Fix includes
ericastor 2bbaea7
Fix include order
ericastor edef7c1
Address feedback
ericastor ec457bd
Remove unused variable
ericastor d9d0517
Remove trailing return (after llvm_unreachable)
ericastor e253de4
Merge related register-class lines
ericastor 07c67a3
Improve error messages on mismatched PTR casts
ericastor ab863ce
Update the errors test file
ericastor 23ac381
Remove cast support for vector registers, and improve error tests
ericastor e6002d2
Remove cast support for extended-float registers as well
ericastor 35a6463
Merge branch 'main' into register-cast
ericastor 4282b2b
Merge branch 'main' into register-cast
ericastor 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ; RUN: llvm-ml -m64 -filetype=s %s /Fo - | FileCheck %s | ||
ericastor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| .code | ||
|
|
||
| mov byte ptr al, al | ||
| mov al, byte ptr al | ||
| ; CHECK: mov al, al | ||
| ; CHECK-NEXT: mov al, al | ||
|
|
||
| mov word ptr ax, ax | ||
| mov ax, word ptr ax | ||
| ; CHECK: mov ax, ax | ||
| ; CHECK-NEXT: mov ax, ax | ||
|
|
||
| mov dword ptr eax, eax | ||
| mov eax, dword ptr eax | ||
| ; CHECK: mov eax, eax | ||
| ; CHECK-NEXT: mov eax, eax | ||
|
|
||
| mov qword ptr rax, rax | ||
| mov rax, qword ptr rax | ||
| ; CHECK: mov rax, rax | ||
| ; CHECK-NEXT: mov rax, rax | ||
|
|
||
| END | ||
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,41 @@ | ||
| ; RUN: not llvm-ml -m64 -filetype=s %s /Fo /dev/null 2>&1 | FileCheck %s | ||
|
|
||
| .code | ||
|
|
||
| mov word ptr al, ax | ||
| ; CHECK: error: cannot cast register 'AL' to 'word'; size does not match | ||
|
|
||
| mov dword ptr al, eax | ||
| ; CHECK: error: cannot cast register 'AL' to 'dword'; size does not match | ||
|
|
||
| mov qword ptr al, rax | ||
| ; CHECK: error: cannot cast register 'AL' to 'qword'; size does not match | ||
|
|
||
| mov byte ptr ax, al | ||
| ; CHECK: error: cannot cast register 'AX' to 'byte'; size does not match | ||
|
|
||
| mov dword ptr ax, eax | ||
| ; CHECK: error: cannot cast register 'AX' to 'dword'; size does not match | ||
|
|
||
| mov qword ptr ax, rax | ||
| ; CHECK: error: cannot cast register 'AX' to 'qword'; size does not match | ||
|
|
||
| mov byte ptr eax, al | ||
| ; CHECK: error: cannot cast register 'EAX' to 'byte'; size does not match | ||
|
|
||
| mov word ptr eax, ax | ||
| ; CHECK: error: cannot cast register 'EAX' to 'word'; size does not match | ||
|
|
||
| mov qword ptr eax, rax | ||
| ; CHECK: error: cannot cast register 'EAX' to 'qword'; size does not match | ||
|
|
||
| mov byte ptr rax, al | ||
| ; CHECK: error: cannot cast register 'RAX' to 'byte'; size does not match | ||
|
|
||
| mov word ptr rax, ax | ||
| ; CHECK: error: cannot cast register 'RAX' to 'word'; size does not match | ||
|
|
||
| mov dword ptr rax, eax | ||
| ; CHECK: error: cannot cast register 'RAX' to 'dword'; size does not match | ||
|
|
||
| END |
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.