about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-10-18 10:30:29 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-11-25 11:03:13 -0800
commitfe53a8106dfb54b5fe04d2ce7e8ee6472b0d5b16 (patch)
treeda4d366dc1d68821db4af9ad3213c7481e7064dd /src/libcore
parentcc6b88ccb2fd10c2ad04a30ba648a1e9abf7ba4b (diff)
downloadrust-fe53a8106dfb54b5fe04d2ce7e8ee6472b0d5b16.tar.gz
rust-fe53a8106dfb54b5fe04d2ce7e8ee6472b0d5b16.zip
rustc: Add support for some more x86 SIMD ops
This commit adds compiler support for two basic operations needed for binding
SIMD on x86 platforms:

* First, a `nontemporal_store` intrinsic was added for the `_mm_stream_ps`, seen
  in rust-lang-nursery/stdsimd#114. This was relatively straightforward and is
  quite similar to the volatile store intrinsic.

* Next, and much more intrusively, a new type to the backend was added. The
  `x86_mmx` type is used in LLVM for a 64-bit vector register and is used in
  various intrinsics like `_mm_abs_pi8` as seen in rust-lang-nursery/stdsimd#74.
  This new type was added as a new layout option as well as having support added
  to the trans backend. The type is enabled with the `#[repr(x86_mmx)]`
  attribute which is intended to just be an implementation detail of SIMD in
  Rust.

I'm not 100% certain about how the `x86_mmx` type was added, so any extra eyes
or thoughts on that would be greatly appreciated!
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 0136273ebc9..f1e51e995c2 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -1387,4 +1387,9 @@ extern "rust-intrinsic" {
     /// # } }
     /// ```
     pub fn align_offset(ptr: *const (), align: usize) -> usize;
+
+    /// Emits a `!nontemporal` store according to LLVM (see their docs).
+    /// Probably will never become stable.
+    #[cfg(not(stage0))]
+    pub fn nontemporal_store<T>(ptr: *mut T, val: T);
 }