fast image operations
Diffstat (limited to 'src/math.rs')
| -rw-r--r-- | src/math.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/math.rs b/src/math.rs deleted file mode 100644 index 08e8457..0000000 --- a/src/math.rs +++ /dev/null @@ -1,22 +0,0 @@ -//! utility math -/// Calculates `a * b + c`, with hardware support if possible. -#[allow(clippy::suboptimal_flops)] -pub fn madd(a: f32, b: f32, c: f32) -> f32 { - if cfg!(target_feature = "fma") { - a.mul_add(b, c) - } else { - a * b + c - } -} - -/// helps -pub trait FExt { - /// Calculates `a * b + c`, with hardware support if possible. - fn madd(self, a: f32, b: f32) -> Self; -} - -impl FExt for f32 { - fn madd(self, a: f32, b: f32) -> Self { - madd(self, a, b) - } -} |