1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
6 Mips MipsInlineAsmRegClass {
12 impl MipsInlineAsmRegClass {
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<&'static str>)] {
38 (Self::reg, InlineAsmArch::Mips64) => types! { _: I8, I16, I32, I64, F32, F64; },
39 (Self::reg, _) => types! { _: I8, I16, I32, F32; },
40 (Self::freg, _) => types! { _: F32, F64; },
45 // The reserved registers are somewhat taken from <https://git.io/JUR1k#L150>.
47 Mips MipsInlineAsmReg MipsInlineAsmRegClass {
54 // FIXME: Reserve $t0, $t1 if in mips16 mode.
100 f27: freg = ["$f27"],
101 f28: freg = ["$f28"],
102 f29: freg = ["$f29"],
103 f30: freg = ["$f30"],
104 f31: freg = ["$f31"],
106 "constant zero cannot be used as an operand for inline asm",
108 "reserved for assembler (Assembler Temp)",
110 "OS-reserved register cannot be used as an operand for inline asm",
112 "OS-reserved register cannot be used as an operand for inline asm",
114 "the global pointer cannot be used as an operand for inline asm",
116 "the stack pointer cannot be used as an operand for inline asm",
118 "the frame pointer cannot be used as an operand for inline asm",
120 "the return address register cannot be used as an operand for inline asm",
124 impl MipsInlineAsmReg {
127 out: &mut dyn fmt::Write,
128 _arch: InlineAsmArch,
129 _modifier: Option<char>,
131 out.write_str(self.name())