Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub-optimal math functions #92

Closed
sbc100 opened this issue Aug 19, 2019 · 1 comment
Closed

sub-optimal math functions #92

sbc100 opened this issue Aug 19, 2019 · 1 comment

Comments

@sbc100
Copy link
Member

sbc100 commented Aug 19, 2019

Currently we are including the C implementations of several math function:

  • rint
  • rintf
  • copysignf
  • floor
  • ceil
  • trunc
  • fabs
  • copysign
  • sqrt

This means that any code compiled with -fno-builtin will end up with sub-optimal implementations and because wasi-libc itself is compiled with -fno-builtin any internal references to these functions will be sub-optimal.

This was recently fixed in emscripten via: emscripten-core/emscripten#9239 emscripten-core/emscripten#9250

However, a cleaner fix might be to use arch-specific implementations like, for example:
./libc-top-half/musl/src/math/i386/rintf.s

@sunfishcode
Copy link
Member

This was fixed in 1645076.

@sbc100
Copy link
Member Author

sbc100 commented Aug 19, 2019

Ah thanks, sorry couldn't find the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants