Skip to content

Commit 5219af6

Browse files
committed
add more missing simd intrinsics
1 parent d96f0c3 commit 5219af6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

library/core/src/intrinsics/simd.rs

+32
Original file line numberDiff line numberDiff line change
@@ -481,4 +481,36 @@ extern "platform-intrinsic" {
481481
///
482482
/// `T` must be a vector of integers.
483483
pub fn simd_cttz<T>(x: T) -> T;
484+
485+
/// Round up each element to the next highest integer.
486+
///
487+
/// `T` must be a vector of floats.
488+
pub fn simd_ceil<T>(x: T) -> T;
489+
490+
/// Round down each element to the next lowest integer.
491+
///
492+
/// `T` must be a vector of floats.
493+
pub fn simd_floor<T>(x: T) -> T;
494+
495+
/// Round each element to the closest integer.
496+
/// Ties are resolving by rounding away from 0.
497+
///
498+
/// `T` must be a vector of floats.
499+
pub fn simd_round<T>(x: T) -> T;
500+
501+
/// Return the integer part of each element.
502+
/// This means that non-integer numbers are always truncated towards zero.
503+
///
504+
/// `T` must be a vector of floats.
505+
pub fn simd_trunc<T>(x: T) -> T;
506+
507+
/// Takes the square root of each element.
508+
///
509+
/// `T` must be a vector of floats.
510+
pub fn simd_fsqrt<T>(x: T) -> T;
511+
512+
/// Computes `(x*y) + z` for each element, but without any intermediate rounding.
513+
///
514+
/// `T` must be a vector of floats.
515+
pub fn simd_fma<T>(x: T, y: T, z: T) -> T;
484516
}

0 commit comments

Comments
 (0)