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