rustc_target/asm/
spirv.rs

1use rustc_span::Symbol;
2
3use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
4
5def_reg_class! {
6    SpirV SpirVInlineAsmRegClass {
7        reg,
8    }
9}
10
11impl SpirVInlineAsmRegClass {
12    pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] {
13        &[]
14    }
15
16    pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
17        None
18    }
19
20    pub fn suggest_modifier(
21        self,
22        _arch: InlineAsmArch,
23        _ty: InlineAsmType,
24    ) -> Option<ModifierInfo> {
25        None
26    }
27
28    pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<ModifierInfo> {
29        None
30    }
31
32    pub fn supported_types(
33        self,
34        _arch: InlineAsmArch,
35    ) -> &'static [(InlineAsmType, Option<Symbol>)] {
36        match self {
37            Self::reg => {
38                types! { _: I8, I16, I32, I64, F32, F64; }
39            }
40        }
41    }
42}
43
44def_regs! {
45    // SPIR-V is SSA-based, it does not have registers.
46    SpirV SpirVInlineAsmReg SpirVInlineAsmRegClass {}
47}