about summary refs log tree commit diff
path: root/library/stdarch/examples
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2017-09-26 21:53:50 -0400
committerAndrew Gallant <jamslam@gmail.com>2017-09-27 11:04:23 -0400
commit6dfc65289c0ec052bb216c3dc5bf7fedf0069d3c (patch)
tree9f5ff8b9c6a8dc70690e914c3ba7f13e18e2f0f4 /library/stdarch/examples
parentff9e96062837f9b0af7825668714bdd8ea504d20 (diff)
downloadrust-6dfc65289c0ec052bb216c3dc5bf7fedf0069d3c.tar.gz
rust-6dfc65289c0ec052bb216c3dc5bf7fedf0069d3c.zip
x86: add unsafe to all x86 vendor intrinsics
Also, add missing assert_instr tests to each intrinsic, where possible.
Diffstat (limited to 'library/stdarch/examples')
-rw-r--r--library/stdarch/examples/play.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/stdarch/examples/play.rs b/library/stdarch/examples/play.rs
index 69b692fe12e..81a9d9b67ad 100644
--- a/library/stdarch/examples/play.rs
+++ b/library/stdarch/examples/play.rs
@@ -24,9 +24,11 @@ mod example {
         haystack.resize(16, 0);
         let vhaystack = vendor::__m128i::from(s::u8x16::load(&haystack, 0));
 
-        vendor::_mm_cmpestri(
-            vneedle, needle_len as i32, vhaystack, hay_len as i32,
-            vendor::_SIDD_CMP_EQUAL_ORDERED) as usize
+        unsafe {
+            vendor::_mm_cmpestri(
+                vneedle, needle_len as i32, vhaystack, hay_len as i32,
+                vendor::_SIDD_CMP_EQUAL_ORDERED) as usize
+        }
     }
 
     pub fn main() {