]> git.lizzy.rs Git - rust.git/blob - crates/core_simd/src/intrinsics.rs
Implement `core::ops` (#10)
[rust.git] / crates / core_simd / src / intrinsics.rs
1 //! This module contains the LLVM intrinsics bindings that provide the functionality for this
2 //! crate.
3 //!
4 //! The LLVM assembly language is documented here: https://llvm.org/docs/LangRef.html
5
6 /// These intrinsics aren't linked directly from LLVM and are mostly undocumented, however they are
7 /// simply lowered to the matching LLVM instructions by the compiler.  The associated instruction
8 /// is documented alongside each intrinsic.
9 extern "platform-intrinsic" {
10     /// add/fadd
11     pub(crate) fn simd_add<T>(x: T, y: T) -> T;
12
13     /// sub/fsub
14     pub(crate) fn simd_sub<T>(x: T, y: T) -> T;
15
16     /// mul/fmul
17     pub(crate) fn simd_mul<T>(x: T, y: T) -> T;
18
19     /// udiv/sdiv/fdiv
20     pub(crate) fn simd_div<T>(x: T, y: T) -> T;
21
22     /// urem/srem/frem
23     pub(crate) fn simd_rem<T>(x: T, y: T) -> T;
24
25     /// shl
26     pub(crate) fn simd_shl<T>(x: T, y: T) -> T;
27
28     /// lshr/ashr
29     pub(crate) fn simd_shr<T>(x: T, y: T) -> T;
30
31     /// and
32     pub(crate) fn simd_and<T>(x: T, y: T) -> T;
33
34     /// or
35     pub(crate) fn simd_or<T>(x: T, y: T) -> T;
36
37     /// xor
38     pub(crate) fn simd_xor<T>(x: T, y: T) -> T;
39 }