OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [sparc/] [solaris/] [tst/] [sort.sbk] - Blame information for rev 112

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
.section ".data"
2
.global in
3
.type in,#object
4
.align 4
5
in:
6
.word 0xa
7
.word 0x20
8
.word 0xffffffff
9
.word 0x237
10
.word 0x3
11
.word 0x12
12
.word 0x1
13
.word 0xffffffcd
14
.word 0x315
15
.word 0x0
16
.size in,40
17
.global main
18
.section ".text"
19
.align 4
20
main:
21
save %sp,-96,%sp
22
set in,%o0
23
set 10,%o1
24
call sort; nop
25
mov %g0,%i5
26
ba .L5; nop
27
.L2:
28
sll %i5,2,%i4
29
set in,%i3
30
ld [%i4+%i3],%o0
31
call putd; nop
32
set 10,%o0
33
call putchar; nop
34
.L3:
35
add %i5,1,%i5
36
.L5:
37
mov %i5,%i4
38
set 10,%i3
39
cmp %i4,%i3; blu .L2; nop
40
mov %g0,%i0
41
.L1:
42
ret; restore
43
.type main,#function
44
.size main,.-main
45
.global putd
46
.align 4
47
putd:
48
save %sp,-96,%sp
49
cmp %i0,0; bge .L7; nop
50
set 45,%o0
51
call putchar; nop
52
neg %i0,%i0
53
.L7:
54
sra %i0,31,%g1; wr %g0,%g1,%y; nop; nop; nop; sdiv %i0,10,%i5
55
cmp %i5,0; be .L9; nop
56
sra %i0,31,%g1; wr %g0,%g1,%y; nop; nop; nop; sdiv %i0,10,%o0
57
call putd; nop
58
.L9:
59
sra %i0,31,%g1; wr %g0,%g1,%y; nop; nop; nop; sdiv %i0,10,%g1
60
; smul %g1,10,%g1; sub %i0,%g1,%i5
61
add %i5,48,%o0
62
call putchar; nop
63
mov %g0,%i0
64
.L6:
65
ret; restore
66
.type putd,#function
67
.size putd,.-putd
68
.global sort
69
.align 4
70
sort:
71
save %sp,-96,%sp
72
set xx,%i5
73
st %i0,[%i5]
74
mov %i0,%o0
75
mov %g0,%o1
76
sub %i1,1,%i5
77
mov %i5,%i1
78
mov %i5,%o2
79
call quick; nop
80
mov %g0,%i0
81
.L11:
82
ret; restore
83
.type sort,#function
84
.size sort,.-sort
85
.global quick
86
.align 4
87
quick:
88
save %sp,-96,%sp
89
cmp %i1,%i2; bl .L13; nop
90
mov %g0,%i0
91
ba .L12; nop
92
.L13:
93
mov %i0,%o0
94
mov %i1,%o1
95
mov %i2,%o2
96
call partition; nop
97
mov %o0,%i5
98
mov %i0,%o0
99
mov %i1,%o1
100
sub %i5,1,%o2
101
call quick; nop
102
mov %i0,%o0
103
add %i5,1,%o1
104
mov %i2,%o2
105
call quick; nop
106
mov %g0,%i0
107
.L12:
108
ret; restore
109
.type quick,#function
110
.size quick,.-quick
111
.global partition
112
.align 4
113
partition:
114
save %sp,-96,%sp
115
add %i2,1,%i2
116
mov %i1,%i4
117
sll %i4,2,%i3
118
ld [%i3+%i0],%i5
119
ba .L17; nop
120
.L16:
121
add %i1,1,%i1
122
ba .L20; nop
123
.L19:
124
add %i1,1,%i1
125
.L20:
126
sll %i1,2,%i3
127
ld [%i3+%i0],%i3
128
cmp %i3,%i5; bl .L19; nop
129
sub %i2,1,%i2
130
ba .L23; nop
131
.L22:
132
sub %i2,1,%i2
133
.L23:
134
sll %i2,2,%i3
135
ld [%i3+%i0],%i3
136
cmp %i3,%i5; bg .L22; nop
137
cmp %i1,%i2; bge .L25; nop
138
sll %i1,2,%i3
139
add %i3,%i0,%o0
140
sll %i2,2,%i3
141
add %i3,%i0,%o1
142
call exchange; nop
143
.L25:
144
.L17:
145
cmp %i1,%i2; bl .L16; nop
146
sll %i4,2,%i3
147
add %i3,%i0,%o0
148
sll %i2,2,%i3
149
add %i3,%i0,%o1
150
call exchange; nop
151
mov %i2,%i0
152
.L15:
153
ret; restore
154
.type partition,#function
155
.size partition,.-partition
156
.global exchange
157
.align 4
158
exchange:
159
save %sp,-96,%sp
160
set .L28,%o0
161
set xx,%i4
162
ld [%i4],%i4
163
mov %i0,%i3
164
sub %i3,%i4,%i3
165
sra %i3,31,%g1; wr %g0,%g1,%y; nop; nop; nop; sdiv %i3,4,%o1
166
mov %i1,%i3
167
sub %i3,%i4,%i4
168
sra %i4,31,%g1; wr %g0,%g1,%y; nop; nop; nop; sdiv %i4,4,%o2
169
call printf; nop
170
ld [%i0],%i5
171
ld [%i1],%i4
172
st %i4,[%i0]
173
st %i5,[%i1]
174
mov %g0,%i0
175
.L27:
176
ret; restore
177
.type exchange,#function
178
.size exchange,.-exchange
179
.section ".bss"
180
.global xx
181
.type xx,#object
182
.size xx,4
183
.common xx,4,4
184
.section ".rodata"
185
.align 1
186
.L28:
187
.byte 101
188
.byte 120
189
.byte 99
190
.byte 104
191
.byte 97
192
.byte 110
193
.byte 103
194
.byte 101
195
.byte 40
196
.byte 37
197
.byte 100
198
.byte 44
199
.byte 37
200
.byte 100
201
.byte 41
202
.byte 10
203
.byte 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.