mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: Cortex-M support / single float
@ 2018-09-13 11:30 Jon Chesterfield
  2018-09-13 12:51 ` Szabolcs Nagy
  2018-09-13 15:39 ` Rich Felker
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Chesterfield @ 2018-09-13 11:30 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

> note that a large part of the float code in libc is in the
> math library which expects efficient double arithmetics,
> i plan to rewrite the most important single precision math
> functions using double arithmetics, this gives significant
> benefits on all systems except ones with single precision
> only hw.
>

I'm responsible for libm on an architecture with 32bit float in hardware
and 64bit float via integer ops. It's derived from musl because I like musl.

Currently operations written in terms of double are rather slow. Would
upstream accept functions optimised for a 32bit float+int system? I haven't
written them yet but it's on the todo list.

Cheers

Jon

>

[-- Attachment #2: Type: text/html, Size: 1252 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cortex-M support / single float
  2018-09-13 11:30 Cortex-M support / single float Jon Chesterfield
@ 2018-09-13 12:51 ` Szabolcs Nagy
  2018-09-13 15:39 ` Rich Felker
  1 sibling, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2018-09-13 12:51 UTC (permalink / raw)
  To: musl

* Jon Chesterfield <jonathanchesterfield@gmail.com> [2018-09-13 12:30:45 +0100]:
> > note that a large part of the float code in libc is in the
> > math library which expects efficient double arithmetics,
> > i plan to rewrite the most important single precision math
> > functions using double arithmetics, this gives significant
> > benefits on all systems except ones with single precision
> > only hw.
> >
> 
> I'm responsible for libm on an architecture with 32bit float in hardware
> and 64bit float via integer ops. It's derived from musl because I like musl.
> 
> Currently operations written in terms of double are rather slow. Would
> upstream accept functions optimised for a 32bit float+int system? I haven't
> written them yet but it's on the todo list.
> 

the math code already has target specific code because of
different long double formats, but the policy in musl is to
minimize such variation because of maintainability.

currently we dont support hw float + soft double systems,
but i think such code is acceptable if it's for supporting a
specific target (i think what we would really like to avoid
is configurability: if users of a target can choose between
several different options and change behaviour with many
knobs, that would be hard to test/maintain)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cortex-M support / single float
  2018-09-13 11:30 Cortex-M support / single float Jon Chesterfield
  2018-09-13 12:51 ` Szabolcs Nagy
@ 2018-09-13 15:39 ` Rich Felker
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Felker @ 2018-09-13 15:39 UTC (permalink / raw)
  To: musl

On Thu, Sep 13, 2018 at 12:30:45PM +0100, Jon Chesterfield wrote:
> > note that a large part of the float code in libc is in the
> > math library which expects efficient double arithmetics,
> > i plan to rewrite the most important single precision math
> > functions using double arithmetics, this gives significant
> > benefits on all systems except ones with single precision
> > only hw.
> 
> I'm responsible for libm on an architecture with 32bit float in hardware
> and 64bit float via integer ops. It's derived from musl because I like musl.
> 
> Currently operations written in terms of double are rather slow. Would
> upstream accept functions optimised for a 32bit float+int system? I haven't
> written them yet but it's on the todo list.

If implementations with float+int can be reasonably trusted to give
comparable precision (and of course exact results for the functions
specified to be exact), I don't see a reason not to accept them. How
are exception flags handed on such archs? Are the double operations
expected to set the flags in the single-precision fpu correctly? Or
does it just have to be treated as a no-fenv arch?

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-13 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 11:30 Cortex-M support / single float Jon Chesterfield
2018-09-13 12:51 ` Szabolcs Nagy
2018-09-13 15:39 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).