1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
3 use rustc_span::Symbol;
7 Msp430 Msp430InlineAsmRegClass {
12 impl Msp430InlineAsmRegClass {
13 pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] {
17 pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
21 pub fn suggest_modifier(
25 ) -> Option<(char, &'static str)> {
29 pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> {
33 pub fn supported_types(
36 ) -> &'static [(InlineAsmType, Option<Symbol>)] {
38 (Self::reg, _) => types! { _: I8, I16; },
43 // The reserved registers are taken from:
44 // https://github.com/llvm/llvm-project/blob/36cb29cbbe1b22dcd298ad65e1fabe899b7d7249/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp#L73.
46 Msp430 Msp430InlineAsmReg Msp430InlineAsmRegClass {
59 #error = ["r0", "pc"] =>
60 "the program counter cannot be used as an operand for inline asm",
61 #error = ["r1", "sp"] =>
62 "the stack pointer cannot be used as an operand for inline asm",
63 #error = ["r2", "sr"] =>
64 "the status register cannot be used as an operand for inline asm",
65 #error = ["r3", "cg"] =>
66 "the constant generator cannot be used as an operand for inline asm",
67 #error = ["r4", "fp"] =>
68 "the frame pointer cannot be used as an operand for inline asm",
72 impl Msp430InlineAsmReg {
75 out: &mut dyn fmt::Write,
77 _modifier: Option<char>,
79 out.write_str(self.name())