From 5219af6ae0a71c20dc5fa25520ef2b2927e37f7e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 28 Dec 2023 13:21:02 +0100 Subject: [PATCH] add more missing simd intrinsics --- library/core/src/intrinsics/simd.rs | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs index 1483be2a699..d52f04bf3e0 100644 --- a/library/core/src/intrinsics/simd.rs +++ b/library/core/src/intrinsics/simd.rs @@ -481,4 +481,36 @@ extern "platform-intrinsic" { /// /// `T` must be a vector of integers. pub fn simd_cttz(x: T) -> T; + + /// Round up each element to the next highest integer. + /// + /// `T` must be a vector of floats. + pub fn simd_ceil(x: T) -> T; + + /// Round down each element to the next lowest integer. + /// + /// `T` must be a vector of floats. + pub fn simd_floor(x: T) -> T; + + /// Round each element to the closest integer. + /// Ties are resolving by rounding away from 0. + /// + /// `T` must be a vector of floats. + pub fn simd_round(x: T) -> T; + + /// Return the integer part of each element. + /// This means that non-integer numbers are always truncated towards zero. + /// + /// `T` must be a vector of floats. + pub fn simd_trunc(x: T) -> T; + + /// Takes the square root of each element. + /// + /// `T` must be a vector of floats. + pub fn simd_fsqrt(x: T) -> T; + + /// Computes `(x*y) + z` for each element, but without any intermediate rounding. + /// + /// `T` must be a vector of floats. + pub fn simd_fma(x: T, y: T, z: T) -> T; }