Skip to content

Support MulAdd and MulAddAssign for no_std #102

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

Closed
Schultzer opened this issue Feb 26, 2019 · 4 comments
Closed

Support MulAdd and MulAddAssign for no_std #102

Schultzer opened this issue Feb 26, 2019 · 4 comments

Comments

@Schultzer
Copy link

Schultzer commented Feb 26, 2019

Is MulAdd and MulAddAssign supported for no_std?

I looked at the docs for for f64 and as far as I understand there shouldn't be any problem in making these traits no_std.

Looking at the code for mul_add it looks like only std is supported?

https://doc.rust-lang.org/core/intrinsics/fn.fmaf32.html
https://doc.rust-lang.org/core/intrinsics/fn.fmaf64.html

@cuviper
Copy link
Member

cuviper commented Feb 26, 2019

The core impl f64 does not include mul_add, nor anything else based on intrinsics. We can't call the intrinsics directly because they are marked unstable, for use only with nightly versions of rustc. So while the MulAdd traits do exist under no_std, we don't have a way to implement them for floats.

I think core doesn't use intrinsics because LLVM may lower them to external calls on some targets.

@Schultzer
Copy link
Author

I guess this can only be done with libm with the F32Ext and F64Ext

@cuviper
Copy link
Member

cuviper commented Feb 26, 2019

Oh, #99 actually does include this!

@cuviper
Copy link
Member

cuviper commented Nov 13, 2019

The libm feature is now supported in 2.0.9.

@cuviper cuviper closed this as completed Nov 13, 2019
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