about summary refs log tree commit diff
path: root/example/std_example.rs
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-07-28 09:45:01 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2019-07-29 11:03:55 +0200
commit90f2b12d473e51ba16267178aeb576edda11123a (patch)
tree4cc5e4b27f1c6679e29556df08978fd90b4d3bed /example/std_example.rs
parent9e3f2391b8f9da831c8aa25ce8cdc4eb4dc300ef (diff)
downloadrust-90f2b12d473e51ba16267178aeb576edda11123a.tar.gz
rust-90f2b12d473e51ba16267178aeb576edda11123a.zip
Fix simd comparison
Diffstat (limited to 'example/std_example.rs')
-rw-r--r--example/std_example.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/example/std_example.rs b/example/std_example.rs
index 7deaddd7df7..7fe1d082e34 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -57,8 +57,12 @@ unsafe fn test_simd() {
     let x = _mm_setzero_si128();
     let y = _mm_set1_epi16(7);
     let or = _mm_or_si128(x, y);
+    let cmp_eq = _mm_cmpeq_epi8(y, y);
+    let cmp_lt = _mm_cmplt_epi8(y, y);
 
     assert_eq!(std::mem::transmute::<_, [u16; 8]>(or), [7, 7, 7, 7, 7, 7, 7, 7]);
+    assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_eq), [0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff]);
+    assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_lt), [0, 0, 0, 0, 0, 0, 0, 0]);
 }
 
 #[derive(PartialEq)]