-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add sincosf function #7267
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
Add sincosf function #7267
Conversation
Me neither. It just happens somewhere in > 5000 LOC where code uses a lot of sin and cos |
Here's the man page, some tests are needed to make sure this implementation matches the libc one (wrt nan/infinity inputs, the errno part should be honored too?). Adding the |
great question. At first I thought so, but then I saw that e.g. |
Calm your tits, LLVM is smart. The optimization kicks in iff |
Reproducer: const std = @import("std");
extern var foo: f32;
pub fn main() !void {
var y = @sin(foo);
var z = @cos(foo);
std.mem.doNotOptimizeAway(y);
std.mem.doNotOptimizeAway(z);
} Compile with: |
Tested with const std = @import("std");
export fn myfunc(foo: f32) f32 {
var y = @sin(foo);
var z = @cos(foo);
return y + z;
}
and looks correct.... will re-kick CI because error message is gone now. |
* Add sincosf function * also add sincos Co-authored-by: Veikka Tuominen <[email protected]>
Fixes #7260
@MasterQ32 I have no idea how to test this, you didn't leave a reproducer.