-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[SPARC][Driver] Add -m(no-)v8plus flags handling #98713
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,11 @@ void sparc::getSparcTargetFeatures(const Driver &D, const ArgList &Args, | |
Features.push_back("-hard-quad-float"); | ||
} | ||
|
||
if (Arg *A = Args.getLastArg(options::OPT_mv8plus, options::OPT_mno_v8plus)) { | ||
if (A->getOption().matches(options::OPT_mv8plus)) | ||
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 usually know whether a feature is default on or off. Are both 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. It is off by default, but we also want it to override features enabled implicitly by 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. This is quite confusing. 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. Either way, the order of 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. It is true that those flags primarily control the target environment, however, on GCC, It would be possible to define the flags such that 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.
Well, no. Not exactly. Whether or not V9 instructions are available is determined strictly by Also note that 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. Ah, I see. What do you think about it? (Some background: I am currently only looking to include this in clang because Linux passes 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.
AFAIK it is an ABI affecting flag, although I don't know if it changes anything except for ELF header's e_machine field compared to 32-bit V8/V9. It can't safely be ignored if we claim support for V8+. If we don't, and V8+ is otherwise compatible with 32-bit ABI, I think ignoring it and generating instructions should be fine, probably with a warning.
I have little experience in target feature bits. It could be helpful to have a draft that adds some V8+ support to the backend and the corresponding feature bits. 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.
AFAICT the main ABI change is widening the G and O registers to 64-bits, which is compatible with legacy ABI:
Backend bits are in #101367 (incl. ELF e_machine type setting), that should be merged first before this PR. |
||
Features.push_back("+v8plus"); | ||
} | ||
|
||
if (Args.hasArg(options::OPT_ffixed_g1)) | ||
Features.push_back("+reserve-g1"); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.