]> git.proxmox.com Git - rustc.git/blob - src/stdsimd/coresimd/ppsv/api/partial_eq.rs
New upstream version 1.26.0+dfsg1
[rustc.git] / src / stdsimd / coresimd / ppsv / api / partial_eq.rs
1 //! Implements `PartialEq` for vector types.
2
3 macro_rules! impl_partial_eq {
4 ($id:ident) => {
5 impl PartialEq<$id> for $id {
6 #[inline]
7 fn eq(&self, other: &Self) -> bool {
8 $id::eq(*self, *other).all()
9 }
10 #[inline]
11 fn ne(&self, other: &Self) -> bool {
12 $id::ne(*self, *other).all()
13 }
14 }
15 }
16 }
17
18 #[cfg(test)]
19 #[macro_export]
20 macro_rules! test_partial_eq {
21 ($id:ident, $true:expr, $false:expr) => {
22 #[test]
23 fn partial_eq() {
24 use ::coresimd::simd::*;
25
26 let a = $id::splat($false);
27 let b = $id::splat($true);
28
29 assert!(a != b);
30 assert!(!(a == b));
31 assert!(a == a);
32 assert!(!(a != a));
33 }
34 }
35 }