Skip to content

Commit

Permalink
feat(arch): add MIPS register defs
Browse files Browse the repository at this point in the history
  • Loading branch information
SK83RJOSH committed Jan 14, 2024
1 parent ee0262a commit 4fd0ee8
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions src/arch.rs
Expand Up @@ -509,6 +509,116 @@ aliases {
FS7 = (63, "$fs7"),
});

/// MIPS architecture specific definitions.
///
/// See [MIPS Details](https://en.wikibooks.org/wiki/MIPS_Assembly/MIPS_Details).
#[derive(Debug, Clone, Copy)]
pub struct MIPS;

registers!(MIPS, {
R0 = (0, "$0"),
R1 = (1, "$1"),
R2 = (2, "$2"),
R3 = (3, "$3"),
R4 = (4, "$4"),
R5 = (5, "$5"),
R6 = (6, "$6"),
R7 = (7, "$7"),
R8 = (8, "$8"),
R9 = (9, "$9"),
R10 = (10, "$10"),
R11 = (11, "$11"),
R12 = (12, "$12"),
R13 = (13, "$13"),
R14 = (14, "$14"),
R15 = (15, "$15"),
R16 = (16, "$16"),
R17 = (17, "$17"),
R18 = (18, "$18"),
R19 = (19, "$19"),
R20 = (20, "$20"),
R21 = (21, "$21"),
R22 = (22, "$22"),
R23 = (23, "$23"),
R24 = (24, "$24"),
R25 = (25, "$25"),
R26 = (26, "$26"),
R27 = (27, "$27"),
R28 = (28, "$28"),
R29 = (29, "$29"),
R30 = (30, "$30"),
R31 = (31, "$31"),

F0 = (32, "$f0"),
F1 = (33, "$f1"),
F2 = (34, "$f2"),
F3 = (35, "$f3"),
F4 = (36, "$f4"),
F5 = (37, "$f5"),
F6 = (38, "$f6"),
F7 = (39, "$f7"),
F8 = (40, "$f8"),
F9 = (41, "$f9"),
F10 = (42, "$f10"),
F11 = (43, "$f11"),
F12 = (44, "$f12"),
F13 = (45, "$f13"),
F14 = (46, "$f14"),
F15 = (47, "$f15"),
F16 = (48, "$f16"),
F17 = (49, "$f17"),
F18 = (50, "$f18"),
F19 = (51, "$f19"),
F20 = (52, "$f20"),
F21 = (53, "$f21"),
F22 = (54, "$f22"),
F23 = (55, "$f23"),
F24 = (56, "$f24"),
F25 = (57, "$f25"),
F26 = (58, "$f26"),
F27 = (59, "$f27"),
F28 = (60, "$f28"),
F29 = (61, "$f29"),
F30 = (62, "$f30"),
F31 = (63, "$f31"),
},
aliases {
ZERO = (0, "$zero"),
AT = (1, "$at"),
V0 = (2, "$v0"),
V1 = (3, "$v1"),
A0 = (4, "$a0"),
A1 = (5, "$a1"),
A2 = (6, "$a2"),
A3 = (7, "$a3"),
T0 = (8, "$t0"),
T1 = (9, "$t1"),
T2 = (10, "$t2"),
T3 = (11, "$t3"),
T4 = (12, "$t4"),
T5 = (13, "$t5"),
T6 = (14, "$t6"),
T7 = (15, "$t7"),
S0 = (16, "$s0"),
S1 = (17, "$s1"),
S2 = (18, "$s2"),
S3 = (19, "$s3"),
S4 = (20, "$s4"),
S5 = (21, "$s5"),
S6 = (22, "$s6"),
S7 = (23, "$s7"),
T8 = (24, "$t8"),
T9 = (25, "$t9"),
K0 = (26, "$k0"),
K1 = (27, "$k1"),
GP = (28, "$gp"),
SP = (29, "$sp"),
FP = (30, "$fp"),
RA = (31, "$ra"),

S8 = (29, "$s8")
});

/// RISC-V architecture specific definitions.
///
/// See [RISC-V ELF psABI specification](https://github.com/riscv/riscv-elf-psabi-doc).
Expand Down

0 comments on commit 4fd0ee8

Please sign in to comment.