H8300: converting unsigned int to float
Manfred Metzger
ManfredMetzger@gmx.de
Tue Aug 31 22:45:00 GMT 1999
Klaus Pedersen wrote:
> Pretty strange - did you compile a new set of "newlibs"? Did you compile a new set
> of binutils?
I recompiled newlib 1.8.1 and binutils 2.9.5.0.5 with GCC 2.95.
Also i downloaded gcc-2.95.tar.gz and recompiled everything yesterday
(with the same result) because i allways used patches to upgrade
from one compiler version to another, in case somthing went wrong with
the patches.
> Not that those things can be a problem, when the assembly output is wrong. - Strange.
And my glibc can also not be the problem, since all my compilers use it.
> Please try to send your code so that we can see what goes wrong.
With
h8300-hms-gcc -Os -fomit-frame-pointer -mh -S test.c
i get:
; GCC For the Hitachi H8/300
; By Hitachi America Ltd and Cygnus Support
; release F-1
; -O2
.h8300h
.file "test.c"
.global _b
.section .data
.align 1
_b:
.word 192
.section .rodata
.LC1:
.ascii "adjk %f skjd\12\0"
.align 2
.LC0:
.float 1.18305218616677471097e-269
.section .text
.align 1
.global _main
_main:
push.l er4
mov.w @_b,r4
mov.w r4,r0
exts.l er0
jsr @___floatsisf
mov.w r4,r4
bge .L3
mov.l @.LC0,er1
jsr @___addsf3
.L3:
mov.l er0,@_a
mov.l @_a,er2
mov.l er2,@-er7
mov.l #.LC1,er2
mov.l er2,@-er7
jsr @_printf
sub.w r0,r0
adds #4,er7
adds #4,er7
pop.l er4
rts
.comm _a,4
.end
That's the same as Your's, exept for the float constant.
Please let me know, if you need more information, but i
will be in holliday in France from this night until sunday
next week.
More information about the Gcc-bugs
mailing list