Skip to content

Commit

Permalink
Merge pull request #37 from caelunshun/core-simd-update
Browse files Browse the repository at this point in the history
Update for recent changes to core::simd
  • Loading branch information
burrbull authored Jan 1, 2024
2 parents cb0ec3f + da62ea8 commit bfdbb3a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
readme = "README.md"

[dependencies.doubled]
version = "0.3.1"
version = "0.3.2"
features = ["simd"]

[features]
Expand Down
6 changes: 3 additions & 3 deletions src/f32x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub(crate) use tst::*;
mod constants;
pub(crate) use constants::*;

use core::simd::prelude::*;

/// Fast functions with 350.0 ULP error bound
mod fast;
pub use fast::{cosf as cos_fast, powf as pow_fast, sinf as sin_fast};
Expand Down Expand Up @@ -49,9 +51,7 @@ pub use u35::{
use crate::common::*;
use doubled::*;

use core::simd::{
LaneCount, Mask, Simd, SimdFloat, SimdPartialEq, SimdPartialOrd, SupportedLaneCount,
};
use core::simd::{LaneCount, Mask, Simd, SupportedLaneCount};

type F32x<const N: usize> = Simd<f32, N>;
type U32x<const N: usize> = Simd<u32, N>;
Expand Down
8 changes: 2 additions & 6 deletions src/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,8 @@ pub fn ldexp(x: f64, mut exp: i32) -> f64 {
/// Integer exponent of an FP number
pub fn ilogb(d: f64) -> i32 {
let mut e = ilogbk(fabsk(d));
e = if d == 0. { SLEEF_FP_ILOGB0 as i32 } else { e };
e = if d.is_nan() {
SLEEF_FP_ILOGBNAN as i32
} else {
e
};
e = if d == 0. { SLEEF_FP_ILOGB0 } else { e };
e = if d.is_nan() { SLEEF_FP_ILOGBNAN } else { e };
if d.is_infinite() {
i32::MAX
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/f64/u10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn cos(d: f64) -> f64 {

let u = t.mul_as_f(x);

if ((ql as isize) & 2) == 0 {
if (ql & 2) == 0 {
-u
} else {
u
Expand Down
6 changes: 3 additions & 3 deletions src/f64x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub(crate) use tst::*;
mod constants;
pub(crate) use constants::*;

use core::simd::prelude::*;

/// Functions with 0.5 ULP error bound
mod u05;
pub use u05::{
Expand Down Expand Up @@ -41,9 +43,7 @@ pub use u35::{
};

use crate::common::*;
use core::simd::{
LaneCount, Mask, Simd, SimdFloat, SimdPartialEq, SimdPartialOrd, SupportedLaneCount,
};
use core::simd::{LaneCount, Mask, Simd, SupportedLaneCount};
use doubled::*;

type F64x<const N: usize> = Simd<f64, N>;
Expand Down

0 comments on commit bfdbb3a

Please sign in to comment.