Skip to content

Commit

Permalink
Add fmaf16 and fmaf128
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 3, 2025
1 parent e6907f5 commit e272a5d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/math/fmaf128.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fmaf128(x: f128, y: f128, z: f128) -> f128 {
super::generic::fma(x, y, z)
}
4 changes: 4 additions & 0 deletions src/math/fmaf16.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fmaf16(x: f16, y: f16, z: f16) -> f16 {
super::generic::fma(x, y, z)
}
6 changes: 6 additions & 0 deletions src/math/generic/fma.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use super::super::Float;

/// Fused multiply add.
pub fn fma<F: Float>(_x: F, _y: F, _z: F) -> F {
todo!()
}
2 changes: 2 additions & 0 deletions src/math/generic/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mod copysign;
mod fabs;
mod fma;

pub use copysign::copysign;
pub use fabs::fabs;
pub use fma::fma;
4 changes: 4 additions & 0 deletions src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,23 @@ cfg_if! {
if #[cfg(f16_enabled)] {
mod copysignf16;
mod fabsf16;
mod fmaf16;

pub use self::copysignf16::copysignf16;
pub use self::fabsf16::fabsf16;
pub use self::fmaf16::fmaf16;
}
}

cfg_if! {
if #[cfg(f128_enabled)] {
mod copysignf128;
mod fabsf128;
mod fmaf128;

pub use self::copysignf128::copysignf128;
pub use self::fabsf128::fabsf128;
pub use self::fmaf128::fmaf128;
}
}

Expand Down

0 comments on commit e272a5d

Please sign in to comment.