This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with printf and float


Hi Pavel, All,

On 2010-10-26 09:05, Jeppe Ledet-Pedersen wrote:
Thank you for your reply. I have tried your suggestion and both
__IEEE_LITTLE_ENDIAN and IEEE_8087 are set correctly in both vfprintf.c
and dtoa.c.

__IEEE_BYTES_LITTLE_ENDIAN is not set. I don't see where this define is
used except for endian.h? It seems to me like the current code yields
the same setting for VFP and FPA in little endian mode, or am I missing
something?

I did some further testing. If I compile an ELF toolchain (non-EABI) with crosstool-NG, I get correct output regardless of whether I use -mfpu=vfp or not (and thus defines __VFP_FP__) when compiling newlib.


This is my test output:

ARM ELF (__IEEE_BIG_ENDIAN, __IEEE_BYTES_LITTLE_ENDIAN, IEEE_MC68k):
00 00 55 c0 00 00 00 00
a is -84.000000
...

ARM ELF (__IEEE_LITTLE_ENDIAN, IEEE_8087):
00 00 00 00 00 00 55 c0
a is -84.000000
...

As soon as I compile for arm-unknown-eabi instead of arm-unknown-elf, I can only print if I convert to FPA format.

I'll continue my search. If you have any input or suggestions where to look, I'll be happy to hear from you.

Best regards,
Jeppe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]