BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002204 [uClibc] Math Library major always 02-17-08 04:51 10-19-08 10:39
Reporter ambro View Status public  
Assigned To uClibc
Priority normal Resolution unable to reproduce  
Status closed   Product Version
Summary 0002204: fpclassify and similar functions assume wrong double format
Description On ARM, little endian, softfloat, OABI,
the __fpclassify function assumes wrong double format, the regular little endian format also used on x86. However the actual float format (at least on my system) is different. This leads to fpclassify and related macros failing miserably. E.g. valid values like 6250.47070227514860000 are being reported as NAN by isnan().

I've been looking into this hard and found out what double format is in use on my system and what uClibc expects:

s = sign bit
e1,e2 = exponent
m1,m2,m3 = mantissa

uClibc code expets:
< LOW PART > < HIGH PART >
-------- -------- -------- -------- -------- -------- -------- --------
< m3 > < m2 > <e2><m1> s< e1 >

REALITY in softfloat ARM little endian, OABI:
< LOW PART > < HIGH PART >
-------- -------- -------- -------- -------- -------- -------- --------
< m2 > <e2><m1> s< e1 > < m3 >

meaning that low and high part are reversed. I've come across this bug quite some time in the past but now I've tracked it down.

I've attached a workaround that seems to work, however I do not know the exact circumstances when the format is reversed.
Additional Information
Attached Files  140-float-arm.patch [^] (402 bytes) 02-17-08 04:51
 double-arm [^] (553 bytes) 02-17-08 04:54

- Relationships

- Notes
(0004974)
ambro
02-17-08 04:54

I'm attaching the text file describing the format, it got messed up
 
(0005264)
vapier
02-22-08 22:18

yes, this will break some combinations as some floating point is big endian on arm even if the cpu is little endian

try looking in glibc and/or gcc and/or the uClibc/.../arm directory to see if you can find a good combination
 
(0012404)
bernhardf
09-29-08 06:36

This was supposedly fixe on trunk. Please verify and report back.
 

- Issue History
Date Modified Username Field Change
02-17-08 04:51 ambro New Issue
02-17-08 04:51 ambro Status new => assigned
02-17-08 04:51 ambro Assigned To  => uClibc
02-17-08 04:51 ambro File Added: 140-float-arm.patch
02-17-08 04:54 ambro File Added: double-arm
02-17-08 04:54 ambro Note Added: 0004974
02-22-08 22:18 vapier Note Added: 0005264
09-29-08 06:36 bernhardf Note Added: 0012404
09-29-08 06:36 bernhardf Status assigned => feedback
09-29-08 07:00 egtvedt Status feedback => assigned
10-19-08 10:39 bernhardf Status assigned => closed
10-19-08 10:39 bernhardf Resolution open => unable to reproduce
10-19-08 10:39 bernhardf Fixed in Version  => 0.9.30


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker