-
Notifications
You must be signed in to change notification settings - Fork 0
/
encoding.py
133 lines (132 loc) · 2.67 KB
/
encoding.py
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def get_reg_encode():
reg = dict()
reg['x0'] = 0
reg['zero'] = 0
reg['x1'] = 1
reg['ra'] = 1
reg['x2'] = 2
reg['sp'] = 2
reg['x3'] = 3
reg['gp'] = 3
reg['x4'] = 4
reg['tp'] = 4
reg['x5'] = 5
reg['t0'] = 5
reg['x6'] = 6
reg['t1'] = 6
reg['x7'] = 7
reg['t2'] = 7
reg['x8'] = 8
reg['s0'] = 8
reg['fp'] = 8
reg['x9'] = 9
reg['s1'] = 9
reg['x10'] = 10
reg['a0'] = 10
reg['x11'] = 11
reg['a1'] = 11
reg['x12'] = 12
reg['a2'] = 12
reg['x13'] = 13
reg['a3'] = 13
reg['x14'] = 14
reg['a4'] = 14
reg['x15'] = 15
reg['a5'] = 15
reg['x16'] = 16
reg['a6'] = 16
reg['x17'] = 17
reg['a7'] = 17
reg['x18'] = 18
reg['s2'] = 18
reg['x19'] = 19
reg['s3'] = 19
reg['x20'] = 20
reg['s4'] = 20
reg['x21'] = 21
reg['s5'] = 21
reg['x22'] = 22
reg['s6'] = 22
reg['x23'] = 23
reg['s7'] = 23
reg['x24'] = 24
reg['s8'] = 24
reg['x25'] = 25
reg['s9'] = 25
reg['x26'] = 26
reg['s10'] = 26
reg['x27'] = 27
reg['s11'] = 27
reg['x28'] = 28
reg['t3'] = 28
reg['x29'] = 29
reg['t4'] = 29
reg['x30'] = 30
reg['t5'] = 30
reg['x31'] = 31
reg['t6'] = 31
reg['v0'] = 0
reg['v1'] = 1
reg['v2'] = 2
reg['v3'] = 3
reg['v4'] = 4
reg['v5'] = 5
reg['v6'] = 6
reg['v7'] = 7
reg['v8'] = 8
reg['v9'] = 9
reg['v10'] = 10
reg['v11'] = 11
reg['v12'] = 12
reg['v13'] = 13
reg['v14'] = 14
reg['v15'] = 15
reg['v16'] = 16
reg['v17'] = 17
reg['v18'] = 18
reg['v19'] = 19
reg['v20'] = 20
reg['v21'] = 21
reg['v22'] = 22
reg['v23'] = 23
reg['v24'] = 24
reg['v25'] = 25
reg['v26'] = 26
reg['v27'] = 27
reg['v28'] = 28
reg['v29'] = 29
reg['v30'] = 30
reg['v31'] = 31
reg['v0.s'] = 0
reg['v1.s'] = 1
reg['v2.s'] = 2
reg['v3.s'] = 3
reg['v4.s'] = 4
reg['v5.s'] = 5
reg['v6.s'] = 6
reg['v7.s'] = 7
reg['v8.s'] = 8
reg['v9.s'] = 9
reg['v10.s'] = 10
reg['v11.s'] = 11
reg['v12.s'] = 12
reg['v13.s'] = 13
reg['v14.s'] = 14
reg['v15.s'] = 15
reg['v16.s'] = 16
reg['v17.s'] = 17
reg['v18.s'] = 18
reg['v19.s'] = 19
reg['v20.s'] = 20
reg['v21.s'] = 21
reg['v22.s'] = 22
reg['v23.s'] = 23
reg['v24.s'] = 24
reg['v25.s'] = 25
reg['v26.s'] = 26
reg['v27.s'] = 27
reg['v28.s'] = 28
reg['v29.s'] = 29
reg['v30.s'] = 30
reg['v31.s'] = 31
return reg