-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] Support -Wa, options -mmsa and -mno-msa #99615
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 all commits
Commits
Show all changes
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: %clang -### -c --target=mips64el-unknown-linux-gnuabi64 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need -fno-integrated-as tests. They are just forwarded. The -mmsa test needs a NOT. I'll push a commit to improve the test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK,Thanks! |
||
// RUN: -Wa,-mmsa %s -Werror 2>&1 | FileCheck %s --check-prefix=CHECK-MMSA | ||
// CHECK-MMSA: "-cc1" {{.*}}"-mmsa" | ||
|
||
// RUN: %clang -### -c --target=mips64el-unknown-linux-gnuabi64 \ | ||
// RUN: -Wa,-mmsa,-mno-msa %s -Werror 2>&1 | FileCheck %s --check-prefix=CHECK-NOMMSA | ||
// CHECK-NOMMSA: "-cc1" | ||
// CHECK-NOMMSA-NOT: "-mssa" | ||
|
||
// RUN: not %clang -### -c --target=x86_64 -Wa,-mmsa -Wa,-mno-msa %s 2>&1 | FileCheck %s --check-prefix=ERR | ||
// ERR: error: unsupported argument '-mmsa' to option '-Wa,' | ||
// ERR: error: unsupported argument '-mno-msa' to option '-Wa,' |
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.
std::optional<bool> Msa
.-mno-msa
should lead to an error even on non-mips targets.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 added bool NoMsa and lead to "unsupported" error when it is on non-mips, were I understanding correctly?
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.
bool Msa, NoMsa
encodes 4 states whereMsa&&NoMsa
is meaningless but not checked.std::optional<bool> Msa
encodes the desired 3 states: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.
OK, I updated.
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.
Please do use
std::optional<bool> Msa
and please don't adderr_drv_msa_and_nomsa
. It's common for-Wa,--foo
to override a previous-Wa,--no-foo
. There shouldn't be an error.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.
Uh oh!
There was an error while loading. Please reload this page.
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.
What error need I add in this 444cd83, and what is *Msa?
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.
Assemblers accept this option, so I don't think we should throw an error when
-mno-msa
is used with MIPS targets.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.
Sorry, I didn't realize you were asking me to use an option type bool MSA on the first version of the modification.
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.
BTW using
std::Optional<bool>
makes more sense since it does distinguish betweenNone
(totally not set) and Booleanfalse
(disabled). Your initial thought is thatfalse
stands for 1) MSA flag is not set and 2) MSA is disabled, but if we target a non-MIPS machine, then we must know if the-mno-msa
is actually set - that's why using plainbool
in this context is not a good idea,false
can not mean two states.