From 7ec426b5a8e8c79149a99c88e96a3fb7ce0374d0 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Wed, 3 Feb 2021 08:31:33 +0100 Subject: [PATCH] add more fast intrinsics --- sbp/src/operators/algos/fastfloat.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbp/src/operators/algos/fastfloat.rs b/sbp/src/operators/algos/fastfloat.rs index efad00b..f4e4e8b 100644 --- a/sbp/src/operators/algos/fastfloat.rs +++ b/sbp/src/operators/algos/fastfloat.rs @@ -4,7 +4,7 @@ use super::*; #[derive(Copy, Clone, Debug, PartialEq, Default)] pub(crate) struct FastFloat(Float); -use core::intrinsics::{fadd_fast, fmul_fast}; +use core::intrinsics::{fadd_fast, fdiv_fast, fmul_fast, fsub_fast}; impl core::ops::Mul for FastFloat { type Output = Self; @@ -58,7 +58,7 @@ impl core::ops::Sub for FastFloat { type Output = Self; #[inline(always)] fn sub(self, o: FastFloat) -> Self::Output { - unsafe { Self(fadd_fast(self.0, -o.0)) } + unsafe { Self(fsub_fast(self.0, o.0)) } } } @@ -66,7 +66,7 @@ impl core::ops::Div for FastFloat { type Output = Self; #[inline(always)] fn div(self, o: FastFloat) -> Self::Output { - Self(self.0 / o.0) + unsafe { Self(fdiv_fast(self.0, o.0)) } } }