From 8b3208fa35bd8e3c2f2d902e2b7e0d5e16957e3f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 17 Feb 2024 08:51:37 +0100 Subject: [PATCH] import LLVM SIMD intrinsics from core rather than declaring them locally --- crates/core_arch/src/simd_llvm.rs | 67 +------------------------------ 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/crates/core_arch/src/simd_llvm.rs b/crates/core_arch/src/simd_llvm.rs index 5b6cd0b93b..9a0820eb7e 100644 --- a/crates/core_arch/src/simd_llvm.rs +++ b/crates/core_arch/src/simd_llvm.rs @@ -1,76 +1,13 @@ //! LLVM's SIMD platform intrinsics -extern "platform-intrinsic" { - //pub fn simd_select_bitmask - pub fn simd_eq(x: T, y: T) -> U; - pub fn simd_ne(x: T, y: T) -> U; - pub fn simd_lt(x: T, y: T) -> U; - pub fn simd_le(x: T, y: T) -> U; - pub fn simd_gt(x: T, y: T) -> U; - pub fn simd_ge(x: T, y: T) -> U; - - pub fn simd_shuffle(x: T, y: T, idx: U) -> V; +pub use crate::intrinsics::simd::*; +extern "platform-intrinsic" { #[rustc_const_unstable(feature = "const_simd_insert", issue = "none")] pub fn simd_insert(x: T, idx: u32, val: U) -> T; #[rustc_const_unstable(feature = "const_simd_extract", issue = "none")] pub fn simd_extract(x: T, idx: u32) -> U; - //pub fn simd_select - pub fn simd_bitmask(x: T) -> U; - - pub fn simd_cast(x: T) -> U; - - pub fn simd_add(x: T, y: T) -> T; - pub fn simd_sub(x: T, y: T) -> T; - pub fn simd_mul(x: T, y: T) -> T; - pub fn simd_div(x: T, y: T) -> T; - pub fn simd_rem(x: T, y: T) -> T; - pub fn simd_shl(x: T, y: T) -> T; - pub fn simd_shr(x: T, y: T) -> T; - pub fn simd_and(x: T, y: T) -> T; - pub fn simd_or(x: T, y: T) -> T; - pub fn simd_xor(x: T, y: T) -> T; - - pub fn simd_neg(x: T) -> T; - - pub fn simd_saturating_add(x: T, y: T) -> T; - pub fn simd_saturating_sub(x: T, y: T) -> T; - - pub fn simd_gather(values: T, pointers: U, mask: V) -> T; - pub fn simd_scatter(values: T, pointers: U, mask: V); pub fn simd_reduce_add_unordered(x: T) -> U; pub fn simd_reduce_mul_unordered(x: T) -> U; - pub fn simd_reduce_add_ordered(x: T, acc: U) -> U; - pub fn simd_reduce_mul_ordered(x: T, acc: U) -> U; - pub fn simd_reduce_min(x: T) -> U; - pub fn simd_reduce_max(x: T) -> U; - pub fn simd_reduce_min_nanless(x: T) -> U; - pub fn simd_reduce_max_nanless(x: T) -> U; - pub fn simd_reduce_and(x: T) -> U; - pub fn simd_reduce_or(x: T) -> U; - pub fn simd_reduce_xor(x: T) -> U; - pub fn simd_reduce_all(x: T) -> bool; - pub fn simd_reduce_any(x: T) -> bool; - - pub fn simd_select(m: M, a: T, b: T) -> T; - pub fn simd_select_bitmask(m: M, a: T, b: T) -> T; - - pub fn simd_fmin(a: T, b: T) -> T; - pub fn simd_fmax(a: T, b: T) -> T; - - pub fn simd_fsqrt(a: T) -> T; - pub fn simd_fsin(a: T) -> T; - pub fn simd_fcos(a: T) -> T; - pub fn simd_fabs(a: T) -> T; - pub fn simd_floor(a: T) -> T; - pub fn simd_ceil(a: T) -> T; - pub fn simd_fexp(a: T) -> T; - pub fn simd_fexp2(a: T) -> T; - pub fn simd_flog10(a: T) -> T; - pub fn simd_flog2(a: T) -> T; - pub fn simd_flog(a: T) -> T; - //pub fn simd_fpowi - //pub fn simd_fpow - pub fn simd_fma(a: T, b: T, c: T) -> T; }