]> git.proxmox.com Git - rustc.git/blame - src/librustc_target/asm/nvptx.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_target / asm / nvptx.rs
CommitLineData
f9f354fc
XL
1use super::{InlineAsmArch, InlineAsmType};
2use rustc_macros::HashStable_Generic;
3
4def_reg_class! {
5 Nvptx NvptxInlineAsmRegClass {
6 reg16,
7 reg32,
8 reg64,
9 }
10}
11
12impl 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
45def_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}