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

Subversion Repositories yacc

[/] [yacc/] [trunk/] [syn/] [c_src/] [pi/] [pi2.s] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tak.sugawa
        .file   1 "pi2.c"
2
 
3
 # -G value = 8, Cpu = 3000, ISA = 1
4
 # GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release) (sde) [AL 1.1, MM 40] Algorithmics SDE-MIPS v4.0.5 compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
5
 # options passed:  -O2 -O -Wall
6
 # options enabled:  -fdefer-pop -fomit-frame-pointer -fthread-jumps
7
 # -fpeephole -finline -fkeep-static-consts -fpcc-struct-return
8
 # -fdelayed-branch -fcommon -fverbose-asm -fgnu-linker -falias-check
9
 # -fargument-alias -msplit-addresses -mgas -mrnames -mgpOPT -mgpopt
10
 # -membedded-data -meb -mmad -marg32 -mdebugh -mdebugi -mmadd -mno-gpconst
11
 # -mcpu=3000
12
 
13
gcc2_compiled.:
14
        .globl  a
15
        .sdata
16
        .align  0
17
        .align  2
18
a:
19
        .size   a,4
20
        .word   10000
21
        .globl  c
22
        .align  2
23
c:
24
        .size   c,4
25
        .word   2800
26
        .rdata
27
        .align  0
28
        .align  2
29
.LC0:
30
        .ascii  "Calculating pi 800 digits\n\000"
31
        .align  2
32
.LC1:
33
        .ascii  "\n"
34
        .ascii  " Done.\n\000"
35
 
36
        .comm   b,4
37
 
38
        .comm   d,4
39
 
40
        .comm   e,4
41
 
42
        .comm   f,11204
43
 
44
        .comm   g,4
45
 
46
        .text
47
        .text
48
        .align  2
49
        .globl  print_uart
50
        .ent    print_uart
51
print_uart:
52
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
53
        .mask   0x00000000,0
54
        .fmask  0x00000000,0
55
        lbu     $v0,0($a0)
56
        beq     $v0,$zero,.L3
57
        li      $v1,16380                       # 0x00003ffc
58
.L5:
59
        #.set   volatile
60
        lw      $v0,0($v1)
61
        #.set   novolatile
62
        andi    $v0,$v0,0x0100
63
        bne     $v0,$zero,.L5
64
        lbu     $v0,0($a0)
65
        #.set   volatile
66
        sb      $v0,0($v1)
67
        #.set   novolatile
68
        addu    $a0,$a0,1
69
        lbu     $v0,0($a0)
70
        bne     $v0,$zero,.L5
71
.L3:
72
        j       $ra
73
        .end    print_uart
74
        .size   print_uart,.-print_uart
75
        .align  2
76
        .globl  putc_uart
77
        .ent    putc_uart
78
putc_uart:
79
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
80
        .mask   0x00000000,0
81
        .fmask  0x00000000,0
82
        andi    $a0,$a0,0x00ff
83
        li      $v1,16380                       # 0x00003ffc
84
.L11:
85
        #.set   volatile
86
        lw      $v0,0($v1)
87
        #.set   novolatile
88
        andi    $v0,$v0,0x0100
89
        .set    noreorder
90
        .set    nomacro
91
        bne     $v0,$zero,.L11
92
        li      $v0,16380                       # 0x00003ffc
93
        .set    macro
94
        .set    reorder
95
 
96
        #.set   volatile
97
        sb      $a0,0($v0)
98
        #.set   novolatile
99
        j       $ra
100
        .end    putc_uart
101
        .size   putc_uart,.-putc_uart
102
        .align  2
103
        .globl  print
104
        .ent    print
105
print:
106
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
107
        .mask   0x00000000,0
108
        .fmask  0x00000000,0
109
        lbu     $v0,0($a0)
110
        .set    noreorder
111
        .set    nomacro
112
        beq     $v0,$zero,.L17
113
        move    $v1,$v0
114
        .set    macro
115
        .set    reorder
116
 
117
        li      $a1,16368                       # 0x00003ff0
118
        move    $v0,$v1
119
.L20:
120
        #.set   volatile
121
        sb      $v0,0($a1)
122
        #.set   novolatile
123
        addu    $a0,$a0,1
124
        lbu     $v1,0($a0)
125
        .set    noreorder
126
        .set    nomacro
127
        bne     $v1,$zero,.L20
128
        move    $v0,$v1
129
        .set    macro
130
        .set    reorder
131
 
132
.L17:
133
        li      $v0,16368                       # 0x00003ff0
134
        #.set   volatile
135
        sb      $zero,0($v0)
136
        #.set   novolatile
137
        j       $ra
138
        .end    print
139
        .size   print,.-print
140
        .align  2
141
        .globl  print_char
142
        .ent    print_char
143
print_char:
144
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
145
        .mask   0x00000000,0
146
        .fmask  0x00000000,0
147
        andi    $a0,$a0,0x00ff
148
        li      $v0,16368                       # 0x00003ff0
149
        #.set   volatile
150
        sb      $a0,0($v0)
151
        #.set   novolatile
152
        j       $ra
153
        .end    print_char
154
        .size   print_char,.-print_char
155
        .align  2
156
        .globl  print_num
157
        .ent    print_num
158
print_num:
159
        .frame  $sp,40,$ra              # vars= 0, regs= 5/0, args= 16, extra= 0
160
        .mask   0x800f0000,-8
161
        .fmask  0x00000000,0
162
        subu    $sp,$sp,40
163
        sw      $ra,32($sp)
164
        sw      $s3,28($sp)
165
        sw      $s2,24($sp)
166
        sw      $s1,20($sp)
167
        sw      $s0,16($sp)
168
        move    $s2,$a0
169
        li      $s1,1000                        # 0x000003e8
170
        li      $s3,-858993459                  # 0xcccccccd
171
.L26:
172
        divu    $s0,$s2,$s1
173
        addu    $a0,$s0,48
174
        .set    noreorder
175
        .set    nomacro
176
        jal     putc_uart
177
        andi    $a0,$a0,0x00ff
178
        .set    macro
179
        .set    reorder
180
 
181
        mult    $s0,$s1
182
        mflo    $v0
183
        subu    $s2,$s2,$v0
184
        multu   $s1,$s3
185
        mfhi    $v0
186
        srl     $s1,$v0,3
187
        bne     $s1,$zero,.L26
188
        lw      $ra,32($sp)
189
        lw      $s3,28($sp)
190
        lw      $s2,24($sp)
191
        lw      $s1,20($sp)
192
        lw      $s0,16($sp)
193
        .set    noreorder
194
        .set    nomacro
195
        j       $ra
196
        addu    $sp,$sp,40
197
        .set    macro
198
        .set    reorder
199
 
200
        .end    print_num
201
        .size   print_num,.-print_num
202
        .text
203
        .align  2
204
        .globl  main2
205
        .ent    main2
206
main2:
207
        .frame  $sp,24,$ra              # vars= 0, regs= 2/0, args= 16, extra= 0
208
        .mask   0x80010000,-4
209
        .fmask  0x00000000,0
210
        subu    $sp,$sp,24
211
        sw      $ra,20($sp)
212
        sw      $s0,16($sp)
213
        lui     $a0,%hi(.LC0) # high
214
        .set    noreorder
215
        .set    nomacro
216
        jal     print
217
        addiu   $a0,$a0,%lo(.LC0) # low
218
        .set    macro
219
        .set    reorder
220
 
221
        lw      $v1,b
222
        lw      $v0,c
223
        .set    noreorder
224
        .set    nomacro
225
        beq     $v1,$v0,.L30
226
        lui     $v0,%hi(f) # high
227
        .set    macro
228
        .set    reorder
229
 
230
        addiu   $a2,$v0,%lo(f) # low
231
        lw      $v0,a
232
        li      $v1,1717960704                  # 0x66660000
233
        ori     $v1,$v1,0x6667
234
        mult    $v0,$v1
235
        mfhi    $t0
236
        sra     $v1,$t0,1
237
        sra     $v0,$v0,31
238
        subu    $a1,$v1,$v0
239
        lw      $a0,c
240
.L32:
241
        lw      $v1,b
242
        sll     $v0,$v1,2
243
        addu    $v0,$v0,$a2
244
        sw      $a1,0($v0)
245
        addu    $v1,$v1,1
246
        sw      $v1,b
247
        bne     $v1,$a0,.L32
248
.L30:
249
        sw      $zero,d
250
        lw      $v0,c
251
        sll     $v0,$v0,1
252
        sw      $v0,g
253
        .set    noreorder
254
        .set    nomacro
255
        beq     $v0,$zero,.L44
256
        lui     $v0,%hi(f) # high
257
        .set    macro
258
        .set    reorder
259
 
260
        addiu   $s0,$v0,%lo(f) # low
261
.L37:
262
        lw      $v0,c
263
        sw      $v0,b
264
        lw      $a3,a
265
        b       .L38
266
.L40:
267
        lw      $v1,d
268
        lw      $v0,b
269
        mult    $v1,$v0
270
        mflo    $t0
271
        sw      $t0,d
272
.L38:
273
        lw      $a2,b
274
        sll     $a1,$a2,2
275
        addu    $a1,$a1,$s0
276
        lw      $v0,0($a1)
277
        mult    $v0,$a3
278
        mflo    $v0
279
        lw      $v1,d
280
        addu    $v1,$v0,$v1
281
        sw      $v1,d
282
        lw      $a0,g
283
        addu    $v0,$a0,-1
284
        sw      $v0,g
285
        div     $v1,$v1,$v0
286
        mfhi    $v0
287
        sw      $v0,0($a1)
288
        sw      $v1,d
289
        addu    $a0,$a0,-2
290
        sw      $a0,g
291
        addu    $a2,$a2,-1
292
        sw      $a2,b
293
        bne     $a2,$zero,.L40
294
        lw      $v0,c
295
        addu    $v0,$v0,-14
296
        sw      $v0,c
297
        lw      $v0,a
298
        div     $v1,$v1,$v0
299
        lw      $a0,e
300
        .set    noreorder
301
        .set    nomacro
302
        jal     print_num
303
        addu    $a0,$v1,$a0
304
        .set    macro
305
        .set    reorder
306
 
307
        lw      $v1,d
308
        lw      $v0,a
309
        rem     $v0,$v1,$v0
310
        sw      $v0,e
311
        sw      $zero,d
312
        lw      $v0,c
313
        sll     $v0,$v0,1
314
        sw      $v0,g
315
        bne     $v0,$zero,.L37
316
.L44:
317
        lui     $a0,%hi(.LC1) # high
318
        .set    noreorder
319
        .set    nomacro
320
        jal     print_uart
321
        addiu   $a0,$a0,%lo(.LC1) # low
322
        .set    macro
323
        .set    reorder
324
 
325
        lw      $ra,20($sp)
326
        lw      $s0,16($sp)
327
        .set    noreorder
328
        .set    nomacro
329
        j       $ra
330
        addu    $sp,$sp,24
331
        .set    macro
332
        .set    reorder
333
 
334
        .end    main2
335
        .size   main2,.-main2

powered by: WebSVN 2.1.0

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