1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
3 use rustc_span::Symbol;
7 Bpf BpfInlineAsmRegClass {
13 impl BpfInlineAsmRegClass {
14 pub fn valid_modifiers(self, _arch: InlineAsmArch) -> &'static [char] {
18 pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
22 pub fn suggest_modifier(
26 ) -> Option<(char, &'static str)> {
30 pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> {
34 pub fn supported_types(
37 ) -> &'static [(InlineAsmType, Option<Symbol>)] {
39 Self::reg => types! { _: I8, I16, I32, I64; },
40 Self::wreg => types! { alu32: I8, I16, I32; },
46 Bpf BpfInlineAsmReg BpfInlineAsmRegClass {
68 #error = ["r10", "w10"] =>
69 "the stack pointer cannot be used as an operand for inline asm",
73 impl BpfInlineAsmReg {
76 out: &mut dyn fmt::Write,
78 _modifier: Option<char>,
80 out.write_str(self.name())
83 pub fn overlapping_regs(self, mut cb: impl FnMut(BpfInlineAsmReg)) {
86 macro_rules! reg_conflicts {