-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SPARC][IAS] Add definitions for UA 2005 instructions #138400
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
koachan
merged 6 commits into
main
from
users/koachan/spr/sparcias-add-definitions-for-ua-2005-instructions
May 12, 2025
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
055fe7c
[𝘀𝗽𝗿] initial version
koachan 79ab4d1
[𝘀𝗽𝗿] changes to main this commit is based on
koachan b2e8de5
Add other instructions & fix typo
koachan 017dfac
[𝘀𝗽𝗿] changes introduced through rebase
koachan 0261c9c
Avoid using InstSP directly
koachan a2c49c5
Fix indentation
koachan 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,28 @@ | ||||||||||||||
| //=== SparcInstrUAOSA.td - UltraSPARC/Oracle SPARC Architecture extensions ===// | ||||||||||||||
| // | ||||||||||||||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||||||||||||
| // See https://llvm.org/LICENSE.txt for license information. | ||||||||||||||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||||||||||||
| // | ||||||||||||||
| //===----------------------------------------------------------------------===// | ||||||||||||||
| // | ||||||||||||||
| // This file contains instruction formats, definitions and patterns needed for | ||||||||||||||
| // UA 2005 instructions on SPARC. | ||||||||||||||
| //===----------------------------------------------------------------------===// | ||||||||||||||
|
|
||||||||||||||
| class UA2005RegWin<string asmstr, bits<5> fcn> | ||||||||||||||
| : F3_1<2, 0b110001, (outs), (ins), asmstr, []> { | ||||||||||||||
| let rd = fcn; | ||||||||||||||
| let rs1 = 0; | ||||||||||||||
| let rs2 = 0; | ||||||||||||||
|
||||||||||||||
| let rd = fcn; | |
| let rs1 = 0; | |
| let rs2 = 0; | |
| let rd = fcn; | |
| let rs1 = 0; | |
| let rs2 = 0; |
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,12 @@ | ||
| # RUN: llvm-mc --disassemble %s -triple=sparcv9-unknown-linux -mattr=+ua2005 | FileCheck %s | ||
|
|
||
| ## UA 2005 instructions. | ||
|
|
||
| # CHECK: allclean | ||
| 0x85,0x88,0x00,0x00 | ||
| # CHECK: invalw | ||
| 0x8b,0x88,0x00,0x00 | ||
| # CHECK: otherw | ||
| 0x87,0x88,0x00,0x00 | ||
| # CHECK: normalw | ||
| 0x89,0x88,0x00,0x00 |
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,17 @@ | ||
| ! RUN: not llvm-mc %s -triple=sparcv9 -show-encoding 2>&1 | FileCheck %s --check-prefixes=NO-UA2005 --implicit-check-not=error: | ||
| ! RUN: llvm-mc %s -triple=sparcv9 -mattr=+ua2005 -show-encoding | FileCheck %s --check-prefixes=UA2005 | ||
|
|
||
| !! UA 2005 instructions. | ||
|
|
||
| ! NO-UA2005: error: instruction requires a CPU feature not currently enabled | ||
| ! UA2005: allclean ! encoding: [0x85,0x88,0x00,0x00] | ||
| allclean | ||
| ! NO-UA2005: error: instruction requires a CPU feature not currently enabled | ||
| ! UA2005: invalw ! encoding: [0x8b,0x88,0x00,0x00] | ||
| invalw | ||
| ! NO-UA2005: error: instruction requires a CPU feature not currently enabled | ||
| ! UA2005: otherw ! encoding: [0x87,0x88,0x00,0x00] | ||
| otherw | ||
| ! NO-UA2005: error: instruction requires a CPU feature not currently enabled | ||
| ! UA2005: normalw ! encoding: [0x89,0x88,0x00,0x00] | ||
| normalw |
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.
Can you point me to the documentation or other resources where I can make sure these processors support these instructions?
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 usually refer to the supplement documents (T1 T2 T3 T4 are the most relevant, there also exist M5 and M7 ones if we do get around to implement optimization/ISA extension support for those processors).