1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
3 use rustc_span::Symbol;
7 Mips MipsInlineAsmRegClass {
13 impl MipsInlineAsmRegClass {
14 pub fn valid_modifiers(self, _arch: super::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, InlineAsmArch::Mips64) => types! { _: I8, I16, I32, I64, F32, F64; },
40 (Self::reg, _) => types! { _: I8, I16, I32, F32; },
41 (Self::freg, _) => types! { _: F32, F64; },
46 // The reserved registers are somewhat taken from
47 // <https://github.com/llvm/llvm-project/blob/deb8f8bcf31540c657716ea5242183b0792702a1/llvm/lib/Target/Mips/MipsRegisterInfo.cpp#L150>.
49 Mips MipsInlineAsmReg MipsInlineAsmRegClass {
56 // FIXME: Reserve $t0, $t1 if in mips16 mode.
100 f25: freg = ["$f25"],
101 f26: freg = ["$f26"],
102 f27: freg = ["$f27"],
103 f28: freg = ["$f28"],
104 f29: freg = ["$f29"],
105 f30: freg = ["$f30"],
106 f31: freg = ["$f31"],
108 "constant zero cannot be used as an operand for inline asm",
110 "reserved for assembler (Assembler Temp)",
112 "OS-reserved register cannot be used as an operand for inline asm",
114 "OS-reserved register cannot be used as an operand for inline asm",
116 "the global pointer cannot be used as an operand for inline asm",
118 "the stack pointer cannot be used as an operand for inline asm",
120 "the frame pointer cannot be used as an operand for inline asm",
122 "the return address register cannot be used as an operand for inline asm",
126 impl MipsInlineAsmReg {
129 out: &mut dyn fmt::Write,
130 _arch: InlineAsmArch,
131 _modifier: Option<char>,
133 out.write_str(self.name())