File: mips16e2.s

package info (click to toggle)
binutils 2.34-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 328,380 kB
  • sloc: ansic: 1,180,155; asm: 665,310; cpp: 130,540; exp: 69,822; makefile: 57,183; sh: 22,559; yacc: 14,469; lisp: 13,785; perl: 2,112; ada: 1,681; lex: 1,650; pascal: 1,446; cs: 879; sed: 195; python: 154; xml: 95; awk: 25
file content (210 lines) | stat: -rw-r--r-- 3,241 bytes parent folder | download | duplicates (15)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
	.set	mips16

	.macro	mem9pos op, ri, base
	\op	\ri,0(\base)
	\op	\ri,1(\base)
	\op	\ri,2(\base)
	\op	\ri,3(\base)
	\op	\ri,4(\base)
	\op	\ri,8(\base)
	\op	\ri,16(\base)
	\op	\ri,32(\base)
	\op	\ri,64(\base)
	\op	\ri,128(\base)
	\op	\ri,255(\base)
	.endm

	.macro	mem9neg op, ri, base
	\op	\ri,-1(\base)
	\op	\ri,-2(\base)
	\op	\ri,-3(\base)
	\op	\ri,-4(\base)
	\op	\ri,-8(\base)
	\op	\ri,-16(\base)
	\op	\ri,-32(\base)
	\op	\ri,-64(\base)
	\op	\ri,-128(\base)
	\op	\ri,-256(\base)
	.endm

	.macro	mem9 op, ri, base
	mem9pos	\op, \ri, \base
	mem9neg	\op, \ri, \base
	.endm

	.macro	mem op, ri, base
	mem9pos	\op, \ri, \base
	\op	\ri,256(\base)
	\op	\ri,512(\base)
	\op	\ri,1024(\base)
	\op	\ri,2048(\base)
	\op	\ri,4096(\base)
	\op	\ri,8192(\base)
	\op	\ri,16384(\base)
	\op	\ri,32767(\base)
	mem9neg	\op, \ri, \base
	\op	\ri,-512(\base)
	\op	\ri,-1024(\base)
	\op	\ri,-2048(\base)
	\op	\ri,-4096(\base)
	\op	\ri,-8192(\base)
	\op	\ri,-16384(\base)
	\op	\ri,-32768(\base)
	.endm

	.macro	alupos op, args:vararg
	\op	\args, 0
	\op	\args, 1
	\op	\args, 2
	\op	\args, 4
	\op	\args, 8
	\op	\args, 16
	\op	\args, 32
	\op	\args, 64
	\op	\args, 128
	\op	\args, 256
	\op	\args, 512
	\op	\args, 1024
	\op	\args, 2048
	\op	\args, 4096
	\op	\args, 8192
	\op	\args, 16384
	\op	\args, 32767
	.endm

	.macro	aluneg op, args:vararg
	\op	\args, -1
	\op	\args, -2
	\op	\args, -4
	\op	\args, -8
	\op	\args, -16
	\op	\args, -32
	\op	\args, -64
	\op	\args, -128
	\op	\args, -256
	\op	\args, -512
	\op	\args, -1024
	\op	\args, -2048
	\op	\args, -4096
	\op	\args, -8192
	\op	\args, -16384
	\op	\args, -32768
	.endm

	.macro	aluu op, args:vararg
	alupos	\op, \args
	\op	\args, 32768
	\op	\args, 65535
	.endm

	.macro	alu op, args:vararg
	alupos	\op, \args
	aluneg	\op, \args
	.endm

	.macro	bit op, ry, rx
	\op	\ry, \rx, 0, 32
	\op	\ry, \rx, 1, 25
	\op	\ry, \rx, 2, 17
	\op	\ry, \rx, 3, 13
	\op	\ry, \rx, 4, 9
	\op	\ry, \rx, 6, 7
	\op	\ry, \rx, 8, 5
	\op	\ry, \rx, 12, 4
	\op	\ry, \rx, 16, 3
	\op	\ry, \rx, 24, 2
	\op	\ry, \rx, 31, 1
	.endm

foo:
	mem	lw, $2, $gp
	mem	lh, $2, $gp
	mem	lhu, $2, $gp
	mem	lb, $2, $gp
	mem	lbu, $2, $gp
	mem	sw, $2, $gp
	mem	sh, $2, $gp
	mem	sb, $2, $gp

	mem9	ll, $2, $3
	mem9	lwl, $2, $3
	mem9	lwr, $2, $3
	mem9	sc, $2, $3
	mem9	swl, $2, $3
	mem9	swr, $2, $3
	mem9	cache, 2, $3
	mem9	cache, 29, $3
	mem9	pref, 8, $3
	mem9	pref, 23, $3

	alu	addiu, $2, $gp
	alu	addu, $2, $gp
	aluu	lui, $2
	aluu	andi, $2
	aluu	ori, $2
	aluu	xori, $2

	bit	ext, $2, $3
	bit	ins, $2, $3
	bit	ins, $6, $0

	movn	$2, $3, $4
	movn	$4, $5, $2
	movn	$7, $6, $17
	movn	$2, $0, $4
	movz	$2, $3, $4
	movz	$4, $5, $2
	movz	$17, $6, $7
	movz	$2, $0, $4

	movtn	$2, $3
	movtn	$4, $5
	movtn	$7, $6
	movtn	$2, $0
	movtz	$2, $3
	movtz	$4, $5
	movtz	$17, $6
	movtz	$2, $0

	ehb
	pause

	sync
	sync	1
	sync	4
	sync	13
	sync	31
	sync_wmb
	sync_mb
	sync_acquire
	sync_release
	sync_rmb

	rdhwr	$2, $1
	rdhwr	$3, $5
	rdhwr	$4, $29
	rdhwr	$5, $31

	di
	di	$0
	di	$2
	ei
	ei	$0
	ei	$2

	mfc0	$3, $5
	mfc0	$5, $9, 0
	mfc0	$7, $13, 3
	mfc0	$17, $15, 1
	mfc0	$2, $17, 7
	mfc0	$6, $21
	mtc0	$3, $5
	mtc0	$5, $9, 0
	mtc0	$7, $13, 3
	mtc0	$17, $15, 1
	mtc0	$2, $17, 7
	mtc0	$6, $21

# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
	.space	16
	.align	4, 0