NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-mips/57680: printf("%.1f") shows wrong resultsonR3000mipseb
The following reply was made to PR port-mips/57680; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: riastradh%NetBSD.org@localhost
Cc: gnats-bugs%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: port-mips/57680: printf("%.1f") shows wrong resultsonR3000mipseb
Date: Tue, 7 Nov 2023 23:11:47 +0900
> mirage-% /s/netbsd-9/src/obj.newsmips/tooldir.NetBSD-10.0_BETA-i386/bin/mipseb--netbsd-objdump -dr obj.newsmips/dtoa.pico
Ah, bad pasto..
obj.newsmips/dtoa.pico: file format elf32-tradbigmips
Disassembly of section .text:
00000000 <__dtoa>:
0: 3c1c0000 lui gp,0x0
0: R_MIPS_HI16 _gp_disp
4: 279c0000 addiu gp,gp,0
4: R_MIPS_LO16 _gp_disp
8: 0399e021 addu gp,gp,t9
c: 27bdff88 addiu sp,sp,-120
10: afbc0010 sw gp,16(sp)
14: afb20058 sw s2,88(sp)
18: afbf0074 sw ra,116(sp)
1c: afbe0070 sw s8,112(sp)
20: afb7006c sw s7,108(sp)
24: afb60068 sw s6,104(sp)
28: afb50064 sw s5,100(sp)
2c: afb40060 sw s4,96(sp)
30: afb3005c sw s3,92(sp)
34: afb10054 sw s1,84(sp)
38: afb00050 sw s0,80(sp)
3c: e7ac007c swc1 $f12,124(sp)
40: e7ad0078 swc1 $f13,120(sp)
44: 00c09025 move s2,a2
48: afa70084 sw a3,132(sp)
4c: 8fa3008c lw v1,140(sp)
50: 4442f800 cfc1 v0,$31
54: 00000000 nop
58: 30420003 andi v0,v0,0x3
5c: 2442ffff addiu v0,v0,-1
60: 2c440003 sltiu a0,v0,3
64: 108000cb beqz a0,394 <__dtoa+0x394>
68: 24140001 li s4,1
6c: 8f840000 lw a0,0(gp)
6c: R_MIPS_GOT16 .rodata
70: 00021080 sll v0,v0,0x2
74: 24840000 addiu a0,a0,0
74: R_MIPS_LO16 .rodata
78: 00441021 addu v0,v0,a0
7c: 8fa5007c lw a1,124(sp)
80: 8fa40078 lw a0,120(sp)
84: 8fb00078 lw s0,120(sp)
88: 8c540000 lw s4,0(v0)
8c: afa50024 sw a1,36(sp)
90: 060000c6 bltz s0,3ac <__dtoa+0x3ac>
94: afa40020 sw a0,32(sp)
98: 3c027ff0 lui v0,0x7ff0
9c: 02022024 and a0,s0,v0
a0: 108200cb beq a0,v0,3d0 <__dtoa+0x3d0>
a4: ac600000 sw zero,0(v1)
a8: c7a00024 lwc1 $f0,36(sp)
ac: c7a10020 lwc1 $f1,32(sp)
b0: e7a0002c swc1 $f0,44(sp)
b4: e7a10028 swc1 $f1,40(sp)
b8: c7a2002c lwc1 $f2,44(sp)
bc: 44800000 mtc1 zero,$f0
c0: c7a30028 lwc1 $f3,40(sp)
c4: 44800800 mtc1 zero,$f1
c8: 00000000 nop
cc: 46201032 c.eq.d $f2,$f0
d0: 00000000 nop
d4: 45010120 bc1t 558 <__dtoa+0x558>
d8: 2a820002 slti v0,s4,2
dc: 14400008 bnez v0,100 <__dtoa+0x100>
e0: 00000000 nop
e4: 8c620000 lw v0,0(v1)
e8: 00000000 nop
ec: 10400125 beqz v0,584 <__dtoa+0x584>
f0: 24020002 li v0,2
f4: 12820002 beq s4,v0,100 <__dtoa+0x100>
f8: 0000a025 move s4,zero
fc: 24140002 li s4,2
100: c7ac002c lwc1 $f12,44(sp)
104: 8f990000 lw t9,0(gp)
104: R_MIPS_CALL16 __d2b_D2A
108: c7ad0028 lwc1 $f13,40(sp)
10c: 27a7001c addiu a3,sp,28
110: 0320f809 jalr t9
110: R_MIPS_JALR __d2b_D2A
114: 27a60018 addiu a2,sp,24
118: 8fbc0010 lw gp,16(sp)
11c: 10400146 beqz v0,638 <__dtoa+0x638>
120: 0040f025 move s8,v0
124: 00102502 srl a0,s0,0x14
128: 8fb6001c lw s6,28(sp)
12c: 108000ea beqz a0,4d8 <__dtoa+0x4d8>
130: 3c06000f lui a2,0xf
134: 8fa50028 lw a1,40(sp)
138: 34c6ffff ori a2,a2,0xffff
13c: 00a62824 and a1,a1,a2
140: 8fa3002c lw v1,44(sp)
144: 3c063ff0 lui a2,0x3ff0
148: 00a61025 or v0,a1,a2
14c: 2484fc01 addiu a0,a0,-1023
150: afa00030 sw zero,48(sp)
154: 8f850000 lw a1,0(gp)
154: R_MIPS_GOT16 $LC4
158: 44831000 mtc1 v1,$f2
15c: c4a00004 lwc1 $f0,4(a1)
15c: R_MIPS_LO16 $LC4
160: 44821800 mtc1 v0,$f3
164: c4a10000 lwc1 $f1,0(a1)
164: R_MIPS_LO16 $LC4
168: 8f820000 lw v0,0(gp)
168: R_MIPS_GOT16 $LC5
16c: 46201001 sub.d $f0,$f2,$f0
170: c4420004 lwc1 $f2,4(v0)
170: R_MIPS_LO16 $LC5
174: c4430000 lwc1 $f3,0(v0)
174: R_MIPS_LO16 $LC5
178: 8f820000 lw v0,0(gp)
178: R_MIPS_GOT16 $LC7
17c: 46220002 mul.d $f0,$f0,$f2
180: c4440004 lwc1 $f4,4(v0)
180: R_MIPS_LO16 $LC7
184: 44841000 mtc1 a0,$f2
188: c4450000 lwc1 $f5,0(v0)
188: R_MIPS_LO16 $LC7
18c: 8f820000 lw v0,0(gp)
18c: R_MIPS_GOT16 $LC6
190: 468010a1 cvt.d.w $f2,$f2
194: 46241082 mul.d $f2,$f2,$f4
198: c4440004 lwc1 $f4,4(v0)
198: R_MIPS_LO16 $LC6
19c: c4450000 lwc1 $f5,0(v0)
19c: R_MIPS_LO16 $LC6
1a0: 46240000 add.d $f0,$f0,$f4
1a4: 46220000 add.d $f0,$f0,$f2
1a8: 44801000 mtc1 zero,$f2
1ac: 44801800 mtc1 zero,$f3
1b0: 00000000 nop
1b4: 4622003c c.lt.d $f0,$f2
1b8: 4442f800 cfc1 v0,$31
1bc: 4442f800 cfc1 v0,$31
1c0: 00000000 nop
1c4: 34410003 ori at,v0,0x3
1c8: 38210002 xori at,at,0x2
1cc: 44c1f800 ctc1 at,$31
1d0: 00000000 nop
1d4: 462000a4 cvt.w.d $f2,$f0
1d8: 44c2f800 ctc1 v0,$31
1dc: 00000000 nop
1e0: 44101000 mfc1 s0,$f2
1e4: 45010116 bc1t 640 <__dtoa+0x640>
1e8: 00000000 nop
1ec: 2e020017 sltiu v0,s0,23
1f0: 10400095 beqz v0,448 <__dtoa+0x448>
1f4: 24020001 li v0,1
1f8: 8f820000 lw v0,0(gp)
1f8: R_MIPS_GOT16 __tens_D2A
1fc: 001018c0 sll v1,s0,0x3
200: 00431021 addu v0,v0,v1
204: c4400004 lwc1 $f0,4(v0)
208: c7a20024 lwc1 $f2,36(sp)
20c: c4410000 lwc1 $f1,0(v0)
210: c7a30020 lwc1 $f3,32(sp)
214: 4620103c c.lt.d $f2,$f0
218: 00000000 nop
21c: 450000e6 bc1f 5b8 <__dtoa+0x5b8>
220: 00000000 nop
224: 02c4b023 subu s6,s6,a0
228: 26d3ffff addiu s3,s6,-1
22c: 2610ffff addiu s0,s0,-1
230: 0661008a bgez s3,45c <__dtoa+0x45c>
234: afa0003c sw zero,60(sp)
238: 24020001 li v0,1
23c: 0056b023 subu s6,v0,s6
240: 06010088 bgez s0,464 <__dtoa+0x464>
244: 00009825 move s3,zero
248: 2e42000a sltiu v0,s2,10
24c: 02d0b023 subu s6,s6,s0
250: 0010a823 negu s5,s0
254: 14400088 bnez v0,478 <__dtoa+0x478>
258: afa00038 sw zero,56(sp)
25c: 00009025 move s2,zero
260: 8f990000 lw t9,0(gp)
260: R_MIPS_CALL16 __rv_alloc_D2A
264: 00000000 nop
268: 0320f809 jalr t9
268: R_MIPS_JALR __rv_alloc_D2A
26c: 24040012 li a0,18
270: 8fbc0010 lw gp,16(sp)
274: 104000f0 beqz v0,638 <__dtoa+0x638>
278: 00408825 move s1,v0
27c: 8fa20018 lw v0,24(sp)
280: 00000000 nop
284: 044001a8 bltz v0,928 <__dtoa+0x928>
288: 2a03000f slti v1,s0,15
28c: 106001a7 beqz v1,92c <__dtoa+0x92c>
290: 2403ffff li v1,-1
294: 8f820000 lw v0,0(gp)
294: R_MIPS_GOT16 __tens_D2A
298: 001018c0 sll v1,s0,0x3
29c: 00431021 addu v0,v0,v1
2a0: c4440004 lwc1 $f4,4(v0)
2a4: c4450000 lwc1 $f5,0(v0)
2a8: 2402ffff li v0,-1
2ac: afa20028 sw v0,40(sp)
2b0: 8f820000 lw v0,0(gp)
2b0: R_MIPS_GOT16 $LC9
2b4: 44803000 mtc1 zero,$f6
2b8: c4480004 lwc1 $f8,4(v0)
2b8: R_MIPS_LO16 $LC9
2bc: c7a00024 lwc1 $f0,36(sp)
2c0: c4490000 lwc1 $f9,0(v0)
2c0: R_MIPS_LO16 $LC9
2c4: 8fa20028 lw v0,40(sp)
2c8: 44803800 mtc1 zero,$f7
2cc: c7a10020 lwc1 $f1,32(sp)
2d0: 26250001 addiu a1,s1,1
2d4: 10000004 b 2e8 <__dtoa+0x2e8>
2d8: 02229821 addu s3,s1,v0
2dc: 127703bd beq s3,s7,11d4 <__dtoa+0x11d4>
2e0: 24a50001 addiu a1,a1,1
2e4: 46280002 mul.d $f0,$f0,$f8
2e8: 46240083 div.d $f2,$f0,$f4
2ec: 4442f800 cfc1 v0,$31
2f0: 4442f800 cfc1 v0,$31
2f4: 00000000 nop
2f8: 34410003 ori at,v0,0x3
2fc: 38210002 xori at,at,0x2
300: 44c1f800 ctc1 at,$31
304: 00000000 nop
308: 462010a4 cvt.w.d $f2,$f2
30c: 44c2f800 ctc1 v0,$31
310: 00000000 nop
314: 44041000 mfc1 a0,$f2
318: 468010a1 cvt.d.w $f2,$f2
31c: 46241082 mul.d $f2,$f2,$f4
320: 46220001 sub.d $f0,$f0,$f2
324: 4626003c c.lt.d $f0,$f6
> 328: 00000000 nop
> 32c: 45000003 bc1f 33c <__dtoa+0x33c>
> 330: 00a0b825 move s7,a1
> 334: 46240000 add.d $f0,$f0,$f4
> 338: 2484ffff addiu a0,a0,-1
> 33c: 24820030 addiu v0,a0,48
:
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index