From 7240dafb0595e500420e24375eef6eaeadac7221 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Tue, 28 May 2019 13:24:41 -0400 Subject: [PATCH] Add test_i32x4_swizzles --- simd/src/test.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/simd/src/test.rs b/simd/src/test.rs index 962ac19b..16f34817 100644 --- a/simd/src/test.rs +++ b/simd/src/test.rs @@ -385,3 +385,12 @@ fn test_i32x4_packed_comparisons() { let b = I32x4::new(-59, 1, 5, 104); assert_eq!(a.packed_eq(b), U32x4::new(0, !0, !0, 0)); } + +#[test] +fn test_i32x4_swizzles() { + let a = I32x4::new(1, 2, 3, 4); + assert_eq!(a.xyxy(), I32x4::new(1, 2, 1, 2)); + assert_eq!(a.xwzy(), I32x4::new(1, 4, 3, 2)); + assert_eq!(a.zyxw(), I32x4::new(3, 2, 1, 4)); + assert_eq!(a.zwxy(), I32x4::new(3, 4, 1, 2)); +}