Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for recent changes to core::simd #37

Merged
merged 2 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading