Switch Num.tan to a zig builtin

It should be able to share some work between sine and cosine to run faster.
This commit is contained in:
Brendan Hansknecht 2023-09-16 21:27:51 -07:00
parent 7986d6cdba
commit 108d9a54e3
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
11 changed files with 25 additions and 4 deletions

View file

@ -935,6 +935,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
| NumLogUnchecked
| NumSin
| NumCos
| NumTan
| NumCeiling
| NumFloor
| NumToFrac
@ -2655,6 +2656,7 @@ fn build_float_unary_op<'a, 'ctx>(
// trigonometry
NumSin => call_bitcode_fn(env, &[arg.into()], &bitcode::NUM_SIN[float_width]),
NumCos => call_bitcode_fn(env, &[arg.into()], &bitcode::NUM_COS[float_width]),
NumTan => call_bitcode_fn(env, &[arg.into()], &bitcode::NUM_TAN[float_width]),
NumAtan => call_bitcode_fn(env, &[arg.into()], &bitcode::NUM_ATAN[float_width]),
NumAcos => call_bitcode_fn(env, &[arg.into()], &bitcode::NUM_ACOS[float_width]),