-
Notifications
You must be signed in to change notification settings - Fork 13.4k
NVPTX support for new asm! #72439
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
NVPTX support for new asm! #72439
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
58fdc43
NVPTX support for new asm!
westernmagic d77f73e
Formatted correctly
westernmagic baa801a
Minor fixes, as requested in PR review
westernmagic 1070f08
Deduplicated macro code
westernmagic 6d74e09
Added comment on there being no predefined registers
westernmagic 5ec6b5e
Fixed tests
westernmagic ed559b3
Updated documentation
westernmagic 70cd375
Corrected statement about zero-extension in docs.
westernmagic 83a5cdf
Update src/doc/unstable-book/src/library-features/asm.md
westernmagic e18054d
Added comment about static variables
westernmagic 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,49 @@ | ||
use super::{InlineAsmArch, InlineAsmType}; | ||
use rustc_macros::HashStable_Generic; | ||
|
||
def_reg_class! { | ||
Nvptx NvptxInlineAsmRegClass { | ||
reg16, | ||
reg32, | ||
reg64, | ||
} | ||
} | ||
|
||
impl NvptxInlineAsmRegClass { | ||
pub fn valid_modifiers(self, _arch: InlineAsmArch) -> &'static [char] { | ||
&[] | ||
} | ||
|
||
pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> { | ||
None | ||
} | ||
|
||
pub fn suggest_modifier( | ||
self, | ||
_arch: InlineAsmArch, | ||
_ty: InlineAsmType, | ||
) -> Option<(char, &'static str)> { | ||
None | ||
} | ||
|
||
pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> { | ||
None | ||
} | ||
|
||
pub fn supported_types( | ||
self, | ||
_arch: InlineAsmArch, | ||
) -> &'static [(InlineAsmType, Option<&'static str>)] { | ||
match self { | ||
Self::reg16 => types! { _: I8, I16; }, | ||
Self::reg32 => types! { _: I8, I16, I32, F32; }, | ||
Self::reg64 => types! { _: I8, I16, I32, F32, I64, F64; }, | ||
} | ||
} | ||
} | ||
|
||
def_regs! { | ||
// Registers in PTX are declared in the assembly. | ||
// There are no predefined registers that one can use. | ||
Nvptx NvptxInlineAsmReg NvptxInlineAsmRegClass {} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.