fast image operations
Diffstat (limited to 'src/math.rs')
| -rw-r--r-- | src/math.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/math.rs b/src/math.rs new file mode 100644 index 0000000..212798c --- /dev/null +++ b/src/math.rs @@ -0,0 +1,8 @@ +/// Calculates `a * b + c`, with hardware support if possible. +pub fn madd(a: f32, b: f32, c: f32) -> f32 { + if cfg!(target_feature = "fma") { + a.mul_add(b, c) + } else { + a * b + c + } +} |