-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Implement some missing maths-related intrinsics #4095
Conversation
llvm_log_f32: 'Math_log', | ||
llvm_log_f64: 'Math_log', | ||
llvm_exp_f32: 'Math_exp', | ||
llvm_exp_f64: 'Math_exp', | ||
llvm_trunc_f64: 'Math_trunc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there such things as llvm_trunc_f32
and llvm_floor_f32
? If so, could add those as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Is |
@juj Oh I didn't realize these functions were part of an asm.js standard library. I just looked at a reference for the standard javascript |
It also looks like |
Emscripten side makes sense for things that are not asm.js builtins (then other projects can use them too). See e.g. For things that are asm.js builtins, adding them to library.js makes them work, but to make them fast we'd need them in the asm.js backend in LLVM. (But that can be done later, if needed.) |
I don't think we should reuse anything from |
Yes, that does look out of date. @lukewagner, do you know what the correct list is? |
Looks like |
@@ -1764,6 +1764,7 @@ var Math_imul = Math.imul; | |||
var Math_fround = Math.fround; | |||
var Math_min = Math.min; | |||
var Math_clz32 = Math.clz32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since trunc
is fairly new in ES6, we should have a pollyfill.
Ok, given the optimization discussion, this looks good to go aside from needing a |
What's the status here? Anything I can do to help? |
Sorry, I was taken by the release of Vulkan. It should be good now. |
Thanks, merged! This uncovered a backend bug with |
These intrinsics are used by the Rust compiler.