-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SPARC][IAS] Add definitions for UA 2007 instructions #138401
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 4 commits into
main
from
users/koachan/spr/sparcias-add-definitions-for-ua-2007-instructions
May 12, 2025
Merged
Changes from all commits
Commits
Show all changes
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
! RUN: not llvm-mc %s -triple=sparcv9 -show-encoding 2>&1 | FileCheck %s --check-prefixes=NO-UA2007 --implicit-check-not=error: | ||
! RUN: llvm-mc %s -triple=sparcv9 -mattr=+ua2007 -show-encoding | FileCheck %s --check-prefixes=UA2007 | ||
|
||
!! UA 2007 instructions. | ||
|
||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fmadds %f1, %f3, %f5, %f7 ! encoding: [0x8f,0xb8,0x4a,0x23] | ||
fmadds %f1, %f3, %f5, %f7 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fmaddd %f0, %f2, %f4, %f6 ! encoding: [0x8d,0xb8,0x08,0x42] | ||
fmaddd %f0, %f2, %f4, %f6 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fmsubs %f1, %f3, %f5, %f7 ! encoding: [0x8f,0xb8,0x4a,0xa3] | ||
fmsubs %f1, %f3, %f5, %f7 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fmsubd %f0, %f2, %f4, %f6 ! encoding: [0x8d,0xb8,0x08,0xc2] | ||
fmsubd %f0, %f2, %f4, %f6 | ||
|
||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fnmadds %f1, %f3, %f5, %f7 ! encoding: [0x8f,0xb8,0x4b,0xa3] | ||
fnmadds %f1, %f3, %f5, %f7 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fnmaddd %f0, %f2, %f4, %f6 ! encoding: [0x8d,0xb8,0x09,0xc2] | ||
fnmaddd %f0, %f2, %f4, %f6 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fnmsubs %f1, %f3, %f5, %f7 ! encoding: [0x8f,0xb8,0x4b,0x23] | ||
fnmsubs %f1, %f3, %f5, %f7 | ||
! NO-UA2007: error: instruction requires a CPU feature not currently enabled | ||
! UA2007: fnmsubd %f0, %f2, %f4, %f6 ! encoding: [0x8d,0xb8,0x09,0x42] | ||
fnmsubd %f0, %f2, %f4, %f6 |
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.
These are essentially VIS instructions, I would argue they should be placed in
SparcInstrInfoVIS.td
.I'm not sure I understand the motivation for putting this handful of instructions into a separate file. What are the benefits?
They share encoding space with other related instructions, so it seems logical to me to put them together with those 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 basically go by how Sun/Oracle classifies the extensions, meaning that basically anything introduced in an ISA revision that isn't a VIS instruction go here.
In case of FMAf, it sits in the weird spot in that it's introduced between VIS2 and VIS3, and since Sun doesn't classify it as a VIS instruction, that's also the approach I took here.
This also goes for the one in the other PR, I suppose for crypto it makes sense to separate it out since it is tagged separately in the documentations, but for all others I think it's tidier if it's kept in this file?