From 4d570fb45e7650f274853a2f47f86d17c2aa0784 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 4 Oct 2020 07:30:01 +0000 Subject: [PATCH] Removes reg aliases since there are many ABIs: o32/n32/n64 --- compiler/rustc_target/src/asm/mips.rs | 64 +++++++++---------- .../unstable-book/src/library-features/asm.md | 3 - 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/compiler/rustc_target/src/asm/mips.rs b/compiler/rustc_target/src/asm/mips.rs index 0cad241efdf18..b19489aa439bf 100644 --- a/compiler/rustc_target/src/asm/mips.rs +++ b/compiler/rustc_target/src/asm/mips.rs @@ -45,31 +45,31 @@ impl MipsInlineAsmRegClass { // The reserved registers are somewhat taken from . def_regs! { Mips MipsInlineAsmReg MipsInlineAsmRegClass { - v0: reg = ["$2", "$v0"], - v1: reg = ["$3", "$v1"], - a0: reg = ["$4", "$a0"], - a1: reg = ["$5", "$a1"], - a2: reg = ["$6", "$a2"], - a3: reg = ["$7", "$a3"], + r2: reg = ["$2"], + r3: reg = ["$3"], + r4: reg = ["$4"], + r5: reg = ["$5"], + r6: reg = ["$6"], + r7: reg = ["$7"], // FIXME: Reserve $t0, $t1 if in mips16 mode. - t0: reg = ["$8", "$t0"], - t1: reg = ["$9", "$t1"], - t2: reg = ["$10", "$t2"], - t3: reg = ["$11", "$t3"], - t4: reg = ["$12", "$t4"], - t5: reg = ["$13", "$t5"], - t6: reg = ["$14", "$t6"], - t7: reg = ["$15", "$t7"], - s0: reg = ["$16", "$s0"], - s1: reg = ["$17", "$s1"], - s2: reg = ["$18", "$s2"], - s3: reg = ["$19", "$s3"], - s4: reg = ["$20", "$s4"], - s5: reg = ["$21", "$s5"], - s6: reg = ["$22", "$s6"], - s7: reg = ["$23", "$s7"], - t8: reg = ["$24", "$t8"], - t9: reg = ["$25", "$t9"], + r8: reg = ["$8"], + r9: reg = ["$9"], + r10: reg = ["$10"], + r11: reg = ["$11"], + r12: reg = ["$12"], + r13: reg = ["$13"], + r14: reg = ["$14"], + r15: reg = ["$15"], + r16: reg = ["$16"], + r17: reg = ["$17"], + r18: reg = ["$18"], + r19: reg = ["$19"], + r20: reg = ["$20"], + r21: reg = ["$21"], + r22: reg = ["$22"], + r23: reg = ["$23"], + r24: reg = ["$24"], + r25: reg = ["$25"], f0: freg = ["$f0"], f1: freg = ["$f1"], f2: freg = ["$f2"], @@ -102,21 +102,21 @@ def_regs! { f29: freg = ["$f29"], f30: freg = ["$f30"], f31: freg = ["$f31"], - #error = ["$0", "$zero"] => + #error = ["$0"] => "constant zero cannot be used as an operand for inline asm", - #error = ["$1", "$at"] => + #error = ["$1"] => "reserved for assembler (Assembler Temp)", - #error = ["$26", "$k0"] => + #error = ["$26"] => "OS-reserved register cannot be used as an operand for inline asm", - #error = ["$27", "$k1"] => + #error = ["$27"] => "OS-reserved register cannot be used as an operand for inline asm", - #error = ["$28", "$gp"] => + #error = ["$28"] => "the global pointer cannot be used as an operand for inline asm", - #error = ["$29", "$sp"] => + #error = ["$29"] => "the stack pointer cannot be used as an operand for inline asm", - #error = ["$30", "$s8", "$fp"] => + #error = ["$30"] => "the frame pointer cannot be used as an operand for inline asm", - #error = ["$31", "$ra"] => + #error = ["$31"] => "the return address register cannot be used as an operand for inline asm", } } diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md index 47030a2ab473d..6e4e1f78b9694 100644 --- a/src/doc/unstable-book/src/library-features/asm.md +++ b/src/doc/unstable-book/src/library-features/asm.md @@ -602,7 +602,6 @@ Some registers have multiple names. These are all treated by the compiler as ide | ARM | `r13` | `sp` | | ARM | `r14` | `lr` | | ARM | `r15` | `pc` | -| MIPS32 | `$[2-25]` | Please [see the Wikipedia page][mips-regs] | | RISC-V | `x0` | `zero` | | RISC-V | `x1` | `ra` | | RISC-V | `x2` | `sp` | @@ -623,8 +622,6 @@ Some registers have multiple names. These are all treated by the compiler as ide | Hexagon | `r30` | `fr` | | Hexagon | `r31` | `lr` | -[mips-regs]: https://en.wikibooks.org/wiki/MIPS_Assembly/Register_File#Registers - Some registers cannot be used for input or output operands: | Architecture | Unsupported register | Reason |