-
Notifications
You must be signed in to change notification settings - Fork 0
/
MipsOpcodes.h
73 lines (66 loc) · 977 Bytes
/
MipsOpcodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#pragma pack(push)
#pragma pack(1)
struct mips_opcode_alimm
{
union
{
struct
{
unsigned int uimm : 16;
unsigned int urt : 5;
unsigned int urs : 5;
unsigned int uop : 6;
};
struct
{
int simm : 16;
int srt : 5;
int srs : 5;
int sop : 6;
};
};
};
struct mips_opcode_alreg
{
unsigned int uspop : 6;
unsigned int usa : 5;
unsigned int urd : 5;
unsigned int urt : 5;
unsigned int urs : 5;
unsigned int uop : 6;
};
struct mips_opcode_alsys
{
unsigned int uspop : 6;
unsigned int ucode : 20;
unsigned int uop : 6;
};
struct mips_opcode_aljmp
{
union
{
struct
{
unsigned int uimm : 26;
unsigned int uop : 6;
};
struct
{
int simm : 26;
int sop : 6;
};
};
};
struct mips_opcode
{
mips_opcode( unsigned int _val ) : val( _val ) { }
union {
unsigned int val;
mips_opcode_alimm alimm;
mips_opcode_alreg alreg;
mips_opcode_alsys alsys;
mips_opcode_aljmp aljmp;
};
};
#pragma pack(pop)