Skip to content

Commit 5800ef3

Browse files
matthiaskrgrgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#133395 - calebzulawski:simd_relaxed_fma, r=workingjubilee
Add simd_relaxed_fma intrinsic Adds compiler support for rust-lang/portable-simd#387 (comment) r? `@workingjubilee` cc `@RalfJung` is this kind of nondeterminism a problem for miri/opsem?
2 parents 65593e3 + 37f979f commit 5800ef3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/src/intrinsics/simd.rs

+14
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,20 @@ extern "rust-intrinsic" {
612612
#[rustc_nounwind]
613613
pub fn simd_fma<T>(x: T, y: T, z: T) -> T;
614614

615+
/// Computes `(x*y) + z` for each element, non-deterministically executing either
616+
/// a fused multiply-add or two operations with rounding of the intermediate result.
617+
///
618+
/// The operation is fused if the code generator determines that target instruction
619+
/// set has support for a fused operation, and that the fused operation is more efficient
620+
/// than the equivalent, separate pair of mul and add instructions. It is unspecified
621+
/// whether or not a fused operation is selected, and that may depend on optimization
622+
/// level and context, for example.
623+
///
624+
/// `T` must be a vector of floats.
625+
#[cfg(not(bootstrap))]
626+
#[rustc_nounwind]
627+
pub fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T;
628+
615629
// Computes the sine of each element.
616630
///
617631
/// `T` must be a vector of floats.

0 commit comments

Comments
 (0)