]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/asm/spirv.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / compiler / rustc_target / src / asm / spirv.rs
CommitLineData
29967ef6
XL
1use super::{InlineAsmArch, InlineAsmType};
2use rustc_macros::HashStable_Generic;
5099ac24 3use rustc_span::Symbol;
29967ef6
XL
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<(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
44def_regs! {
45 // SPIR-V is SSA-based, it does not have registers.
46 SpirV SpirVInlineAsmReg SpirVInlineAsmRegClass {}
47}