Skip to content

Commit b7f81d8

Browse files
authored
LLVM intrinsic fallback (#73)
* fix: fallback to external functions when LLVM intrinsics is not available * tests: tan trigonometric test for external fallback
1 parent b236290 commit b7f81d8

File tree

2 files changed

+235
-236
lines changed

2 files changed

+235
-236
lines changed

diffsl/src/execution/compiler.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,7 @@ mod tests {
14661466
exp_function_f32: "r { exp(2) }" expect "r" vec![f32::exp(2.0_f32).into()] ; f32,
14671467
pow_function_f64: "r { pow(4.3245, 0.5) }" expect "r" vec![f64::powf(4.3245, 0.5)] ; f64,
14681468
pow_function_f32: "r { pow(4.3245, 0.5) }" expect "r" vec![f32::powf(4.3245_f32, 0.5).into()] ; f32,
1469+
tan_function_f64: "r { tan(0.234) }" expect "r" vec![f64::tan(0.234)] ; f64,
14691470
arcsinh_function_f64: "r { arcsinh(0.5) }" expect "r" vec![f64::asinh(0.5)] ; f64,
14701471
arcsinh_function_f32: "r { arcsinh(0.5) }" expect "r" vec![f32::asinh(0.5_f32).into()] ; f32,
14711472
tanh_function_f64: "r { tanh(0.5) }" expect "r" vec![f64::tanh(0.5)] ; f64,
@@ -2254,13 +2255,13 @@ mod tests {
22542255
(1..{},0..{}): 1.0
22552256
}}
22562257
u_i {{
2257-
(0:{}): 1
2258+
(0:{}): 1
22582259
}}
22592260
F_i {{
22602261
a_ij * u_j
22612262
}}
22622263
out_i {{
2263-
u_i
2264+
u_i
22642265
}}
22652266
",
22662267
n - 1,

0 commit comments

Comments
 (0)