This is the mail archive of the mailing list for the eCos 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]

[Bug 1001539] Single precision floating point math library

Please do not reply to this email, use the link below.

--- Comment #46 from Ilija Kocho <> ---
I just posted a collection of patches that apply changes announced in comments

Ref: Comment #33
The inlining option CYGSEM_LIBM_IEEE_API_INLINE is applied to most of
ieee754-api functions. This had an impact on math.h, but although it looks very
different, with default CDL settings, after macro expansion, the legacy
declarations are same as before.
The inlining may suppress generation of GCC builtin functions so there is an
override provision. The overriding is typically enforced by architecture HAL.
As an example, overriding is implemented in Cortex-M architecture (precidely
Cortex-M4F) for sqrtf() (Attachment 2295). For backward compatibility inlining
is disabled by default.

In reply to comment #25
Now all tests pass for IEEE mode. With CYGOPT_LIBM_COMPAT_POSIX_IEEE option
enabled they pass for POSIX as well.
The problem with frexpf() was a wrong test vector (the exponent part). I got
the test generation program, adapted output to eCos port and generated correct
test vectors.

In reply to comment #28 and comment #30
I added option CYGOPT_LIBM_COMPAT_POSIX_IEEE so now user can select whether on
out-of-domain error functions return 0 or NaN. In order to provide same
behavior for all double and single precision functions, the code from
standard.c has moved in standard.inl, which is then included in bot standard.c
and standard_float.c
When CYGOPT_LIBM_COMPAT_POSIX_IEEE is enabled POSIX mode passes the test.
When CYGOPT_LIBM_COMPAT_POSIX_IEEE is disabled i.e. functions return 0.0 the
test fails. Following code snippet can make test pass (example acosf.h).
Please advise.

--- acosf.h------

+#define EDOM_RETVAL (2143289344u)
+#define EDOM_RETVAL (0)

 static const Cyg_libm_test_float_vec_t acosf_vec[] = {

-{0, 3214514586u, 1115684864u, 2143289344u, EDOM, ACOS_TOLERANCE, 0},
+{0, 3214514586u, 1115684864u, EDOM_RETVAL, EDOM, ACOS_TOLERANCE, 0},


Ref comment #33 (again)
Complex functions are added in attachment 2294. I have nothing to add to my
discussion in comment 33 except a question: "Should we change the title of this

Bottom line:
Considering the size of this patches, I would invite all who had already
commented (other people are welcome of course), to steal some time to do it
again. I am testing on Cortex-M4 and it would be good if somebody could test on
other platforms. Perhaps there may be interest to test this patches in a course
of Gnutools test release tests?


You are receiving this mail because:
You are the assignee for the bug.

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