repo.or.cz
/
open-ps2-loader.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git]
/
modules
/
iopcore
/
cdvdman
/
smsutils.s
blob
11eb997c8055132821b521afc789844c8b064bf0
1
/*
2
# ___ _ _ ___
3
# | | | | |
4
# ___| | | ___| PS2DEV Open Source Project.
5
#----------------------------------------------------------
6
# Highly optimized versions of memcpy/memset.
7
# Pulled out 'sde' library from MIPS.
8
# by Eugene Plotnikov
9
*/
10
.set noreorder
11
.set noat
12
.set nomacro
13
14
.globl mips_memcpy
15
.globl mips_memset
16
17
.text
18
mips_memcpy
:
19
move $v0
,
$a0
20
beqz $a2
,
1
f
21
sltiu $t2
,
$a2
,
12
22
bnez $t2
,
2
f
23
xor
$v1
,
$a1
,
$a0
24
andi $v1
,
$v1
,
3
25
negu $a3
,
$a0
26
beqz $v1
,
3
f
27
andi $a3
,
$a3
,
3
28
beqz $a3
,
4
f
29
subu $a2
,
$a2
,
$a3
30
lwr $v1
,
0
(
$a1
)
31
lwl $v1
,
3
(
$a1
)
32
addu $a1
,
$a1
,
$a3
33
swr $v1
,
0
(
$a0
)
34
addu $a0
,
$a0
,
$a3
35
4
:
36
andi $v1
,
$a2
,
15
37
subu $a3
,
$a2
,
$v1
38
beqz $a3
,
5
f
39
move $a2
,
$v1
40
addu $a3
,
$a3
,
$a1
41
6
:
42
lwr $v1
,
0
(
$a1
)
43
lwl $v1
,
3
(
$a1
)
44
lwr $t0
,
4
(
$a1
)
45
lwl $t0
,
7
(
$a1
)
46
lwr $t1
,
8
(
$a1
)
47
lwl $t1
,
11
(
$a1
)
48
lwr $t2
,
12
(
$a1
)
49
lwl $t2
,
15
(
$a1
)
50
sw $v1
,
0
(
$a0
)
51
sw $t0
,
4
(
$a0
)
52
sw $t1
,
8
(
$a0
)
53
addiu $a1
,
$a1
,
16
54
addiu $a0
,
$a0
,
16
55
bne
$a1
,
$a3
,
6
b
56
sw $t2
, -
4
(
$a0
)
57
5
:
58
andi $v1
,
$a2
,
3
59
subu $a3
,
$a2
,
$v1
60
beqz $a3
,
2
f
61
move $a2
,
$v1
62
addu $a3
,
$a3
,
$a1
63
7
:
64
lwr $v1
,
0
(
$a1
)
65
lwl $v1
,
3
(
$a1
)
66
addiu $a1
,
$a1
,
4
67
addiu $a0
,
$a0
,
4
68
bne
$a1
,
$a3
,
7
b
69
sw $v1
, -
4
(
$a0
)
70
b
2
f
71
nop
72
3
:
73
beqz $a3
,
8
f
74
subu $a2
,
$a2
,
$a3
75
lwr $v1
,
0
(
$a1
)
76
addu $a1
,
$a1
,
$a3
77
swr $v1
,
0
(
$a0
)
78
addu $a0
,
$a0
,
$a3
79
8
:
80
andi $v1
,
$a2
,
15
81
subu $a3
,
$a2
,
$v1
82
beqz $a3
,
9
f
83
move $a2
,
$v1
84
addu $a3
,
$a3
,
$a1
85
10
:
86
lw $v1
,
0
(
$a1
)
87
lw $t0
,
4
(
$a1
)
88
lw $t1
,
8
(
$a1
)
89
lw $t2
,
12
(
$a1
)
90
sw $v1
,
0
(
$a0
)
91
sw $t0
,
4
(
$a0
)
92
sw $t1
,
8
(
$a0
)
93
addiu $a1
,
$a1
,
16
94
addiu $a0
,
$a0
,
16
95
bne
$a1
,
$a3
,
10
b
96
sw $t2
, -
4
(
$a0
)
97
9
:
98
andi $v1
,
$a2
,
3
99
subu $a3
,
$a2
,
$v1
100
beqz $a3
,
2
f
101
move $a2
,
$v1
102
addu $a3
,
$a3
,
$a1
103
11
:
104
lw $v1
,
0
(
$a1
)
105
addiu $a1
,
$a1
,
4
106
addiu $a0
,
$a0
,
4
107
bne
$a1
,
$a3
,
11
b
108
sw $v1
, -
4
(
$a0
)
109
2
:
110
beqz $a2
,
1
f
111
addu $a3
,
$a2
,
$a1
112
12
:
113
lbu $v1
,
0
(
$a1
)
114
addiu $a1
,
$a1
,
1
115
addiu $a0
,
$a0
,
1
116
bne
$a1
,
$a3
,
12
b
117
sb $v1
, -
1
(
$a0
)
118
1
:
119
jr $ra
120
121
mips_memset
:
122
move $v0
,
$a0
123
beqz $a2
,
1
f
124
sltiu $t2
,
$a2
,
16
125
bnez $t2
,
2
f
126
andi $a1
,
$a1
,
255
127
sll $t2
,
$a1
,
8
128
or
$a1
,
$a1
,
$t2
129
sll $t2
,
$a1
,
16
130
or
$a1
,
$a1
,
$t2
131
andi $v1
,
$a0
,
3
132
beqz $v1
,
3
f
133
li
$a3
,
4
134
subu $a3
,
$a3
,
$v1
135
subu $a2
,
$a2
,
$a3
136
swr $a1
,
0
(
$a0
)
137
addu $a0
,
$a0
,
$a3
138
3
:
139
andi $v1
,
$a2
,
15
140
subu $a3
,
$a2
,
$v1
141
beqz $a3
,
4
f
142
move $a2
,
$v1
143
addu $a3
,
$a3
,
$a0
144
5
:
145
sw $a1
,
0
(
$a0
)
146
sw $a1
,
4
(
$a0
)
147
sw $a1
,
8
(
$a0
)
148
addiu $a0
,
$a0
,
16
149
bne
$a0
,
$a3
,
5
b
150
sw $a1
, -
4
(
$a0
)
151
4
:
152
andi $v1
,
$a2
,
3
153
subu $a3
,
$a2
,
$v1
154
beqz $a3
,
2
f
155
move $a2
,
$v1
156
addu $a3
,
$a3
,
$a0
157
6
:
158
addiu $a0
,
$a0
,
4
159
bne
$a0
,
$a3
,
6
b
160
sw $a1
, -
4
(
$a0
)
161
2
:
162
beqz $a2
,
1
f
163
addu $a3
,
$a2
,
$a0
164
7
:
165
addiu $a0
,
$a0
,
1
166
bne
$a0
,
$a3
,
7
b
167
sb $a1
, -
1
(
$a0
)
168
1
:
169
_dummy
:
170
jr $ra
171
nop
172