[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] float replace addsf3.S subfs3.S mulsf3.S divsf3.S flo
From: |
Dmitry K. |
Subject: |
Re: [avr-libc-dev] float replace addsf3.S subfs3.S mulsf3.S divsf3.S floatsi.S |
Date: |
Wed, 21 Feb 2007 17:01:52 +1000 |
User-agent: |
KMail/1.5 |
On Wednesday 21 February 2007 13:26, address@hidden wrote:
[...]
> What is definition of behavior if some wants to add sub mul div
> +Inf ( 0x7f8000000) -Inf (0xff800000) NaN (0x7fc00000)
>
> Can we forget to handle -NaN ( 0xffc00000) if none of our programs never
> creates such floats
>
> What should happen with -0 (x80000000)
>
> Do we need to handle denormized values as 0x03445566 or 0x00000001 ? How ?
> Do we need to handle other forms of NaN as 0x7f800200 or 0x7f800002 ?
[...]
Today, the CVS avr-libc float arithmetic and math library are very
close to i386 gcc/glibc ones. It operates subnormals, -0.0, +Inf
and -Inf. All other numbers (0x7f800001-0x7fffffff and 0xff800001-
0xffffffff) are treated as NaNs.
For example:
Inf + Inf --> Inf
Inf - Inf --> NaN
NaN == NaN --> false
0.0 == -0.0 --> true
1/-0.0 --> -Inf
sqrt(-0.0) --> -0.0 (Yes!)
...
A good info about all unnormal cases is in files from
tests/simulate/fplib and math directories. All lines
(except a very small number of cases in fuctions) are
true with i386 gcc/glibc.
Dmitry.