]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/asm/nvptx.rs
Auto merge of #80339 - jyn514:no-span, r=GuillaumeGomez
[rust.git] / compiler / rustc_target / src / asm / nvptx.rs
1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
3
4 def_reg_class! {
5     Nvptx NvptxInlineAsmRegClass {
6         reg16,
7         reg32,
8         reg64,
9     }
10 }
11
12 impl NvptxInlineAsmRegClass {
13     pub fn valid_modifiers(self, _arch: InlineAsmArch) -> &'static [char] {
14         &[]
15     }
16
17     pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
18         None
19     }
20
21     pub fn suggest_modifier(
22         self,
23         _arch: InlineAsmArch,
24         _ty: InlineAsmType,
25     ) -> Option<(char, &'static str)> {
26         None
27     }
28
29     pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> {
30         None
31     }
32
33     pub fn supported_types(
34         self,
35         _arch: InlineAsmArch,
36     ) -> &'static [(InlineAsmType, Option<&'static str>)] {
37         match self {
38             Self::reg16 => types! { _: I8, I16; },
39             Self::reg32 => types! { _: I8, I16, I32, F32; },
40             Self::reg64 => types! { _: I8, I16, I32, F32, I64, F64; },
41         }
42     }
43 }
44
45 def_regs! {
46     // Registers in PTX are declared in the assembly.
47     // There are no predefined registers that one can use.
48     Nvptx NvptxInlineAsmReg NvptxInlineAsmRegClass {}
49 }