]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | use super::{InlineAsmArch, InlineAsmType}; |
2 | use rustc_macros::HashStable_Generic; | |
5099ac24 | 3 | use rustc_span::Symbol; |
29967ef6 XL |
4 | |
5 | def_reg_class! { | |
6 | SpirV SpirVInlineAsmRegClass { | |
7 | reg, | |
8 | } | |
9 | } | |
10 | ||
11 | impl 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<(char, &'static str)> { | |
25 | None | |
26 | } | |
27 | ||
28 | pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> { | |
29 | None | |
30 | } | |
31 | ||
32 | pub fn supported_types( | |
33 | self, | |
34 | _arch: InlineAsmArch, | |
5099ac24 | 35 | ) -> &'static [(InlineAsmType, Option<Symbol>)] { |
29967ef6 XL |
36 | match self { |
37 | Self::reg => { | |
38 | types! { _: I8, I16, I32, I64, F32, F64; } | |
39 | } | |
40 | } | |
41 | } | |
42 | } | |
43 | ||
44 | def_regs! { | |
45 | // SPIR-V is SSA-based, it does not have registers. | |
46 | SpirV SpirVInlineAsmReg SpirVInlineAsmRegClass {} | |
47 | } |