diff --git a/crates/core_arch/src/aarch64/neon.rs b/crates/core_arch/src/aarch64/neon.rs index 8509cce28d..6376c19138 100644 --- a/crates/core_arch/src/aarch64/neon.rs +++ b/crates/core_arch/src/aarch64/neon.rs @@ -274,6 +274,73 @@ aarch64_simd_ceq!(vceq_p64, uint64x1_t); aarch64_simd_ceq!(vceqq_p64, uint64x2_t); +macro_rules! aarch64_simd_cgt { + ($name:ident, $type:ty) => { + /// Compare signed Greater than (vector) + aarch64_simd_2!($name, $type, simd_gt, cmgt); + }; +} +macro_rules! aarch64_simd_cgtu { + ($name:ident, $type:ty) => { + /// Compare Greater than (vector) + aarch64_simd_2!($name, $type, simd_gt, cmhi); + }; +} + +aarch64_simd_cgt!(vcgt_s64, int64x1_t); +aarch64_simd_cgt!(vcgtq_s64, int64x2_t); +aarch64_simd_cgtu!(vcgt_u64, uint64x1_t); +aarch64_simd_cgtu!(vcgtq_u64, uint64x2_t); + +/// Compare signed Greater than (vector) +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(test, assert_instr(fcmgt))] +pub unsafe fn vcgt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t { + simd_gt(a, b) +} + +/// Compare signed Greater than (vector) +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(test, assert_instr(fcmgt))] +pub unsafe fn vcgtq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t { + simd_gt(a, b) +} + +macro_rules! aarch64_simd_clt { + ($name:ident, $type:ty) => { + /// Compare signed Lesser than (vector) + aarch64_simd_2!($name, $type, simd_lt, cmgt); + }; +} +macro_rules! aarch64_simd_cltu { + ($name:ident, $type:ty) => { + /// Compare Lesser than (vector) + aarch64_simd_2!($name, $type, simd_lt, cmhi); + }; +} + +aarch64_simd_clt!(vclt_s64, int64x1_t); +aarch64_simd_clt!(vcltq_s64, int64x2_t); +aarch64_simd_cltu!(vclt_u64, uint64x1_t); +aarch64_simd_cltu!(vcltq_u64, uint64x2_t); + +/// Compare signed Lesser than (vector) +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(test, assert_instr(fcmgt))] +pub unsafe fn vclt_f64(a: float64x1_t, b: float64x1_t) -> uint64x1_t { + simd_lt(a, b) +} + +/// Compare signed Lesser than (vector) +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(test, assert_instr(fcmgt))] +pub unsafe fn vcltq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t { + simd_lt(a, b) +} /// Vector add. #[inline] @@ -1627,8 +1694,117 @@ mod tests { assert_eq!(r, e); } + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_s64() { + let a = i64x1::new(1); + let b = i64x1::new(0); + let c = i64x1::new(-1); + let r: i64x1 = transmute(vcgt_s64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_s64() { + let a = i64x2::new(1, 2); + let b = i64x2::new(0, 1); + let c = i64x2::new(-1, -1); + let r: i64x2 = transmute(vcgtq_s64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_u64() { + let a = u64x1::new(1); + let b = u64x1::new(0); + let c = u64x1::new(0xFFFFFFFFFFFFFFFF); + let r: u64x1 = transmute(vcgt_u64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_u64() { + let a = u64x2::new(1, 2); + let b = u64x2::new(0, 1); + let c = u64x2::new(0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF); + let r: u64x2 = transmute(vcgtq_u64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_f64() { + let a: f64 = 1.2; + let b: f64 = 0.1; + let c = u64x1::new(0xFFFFFFFFFFFFFFFF); + let r: u64x1 = transmute(vcgt_f64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_f64() { + let a = f64x2::new(1.2, 2.3); + let b = f64x2::new(0.1, 1.2); + + let c = u64x2::new(0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF); + let r: u64x2 = transmute(vcgtq_f64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_s64() { + let a = i64x1::new(0); + let b = i64x1::new(1); + let c = i64x1::new(-1); + let r: i64x1 = transmute(vclt_s64(transmute(a), transmute(b))); + assert_eq!(r, c); + } #[simd_test(enable = "neon")] + unsafe fn test_vcltq_s64() { + let a = i64x2::new(0, 1); + let b = i64x2::new(1, 2); + let c = i64x2::new(-1, -1); + let r: i64x2 = transmute(vcltq_s64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_u64() { + let a = u64x1::new(0); + let b = u64x1::new(1); + let c = u64x1::new(0xFFFFFFFFFFFFFFFF); + let r: u64x1 = transmute(vclt_u64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_u64() { + let a = u64x2::new(0, 1); + let b = u64x2::new(1, 2); + let c = u64x2::new(0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF); + let r: u64x2 = transmute(vcltq_u64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_f64() { + let a: f64 = 0.1; + let b: f64 = 1.2; + let c = u64x1::new(0xFFFFFFFFFFFFFFFF); + let r: u64x1 = transmute(vclt_f64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_f64() { + let a = f64x2::new(0.1, 1.2); + let b = f64x2::new(1.2, 2.3); + + let c = u64x2::new(0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF); + let r: u64x2 = transmute(vcltq_f64(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] unsafe fn test_vceq_s64() { let a = i64x1::new(0x0001020304050607); let b = i64x1::new(-1); @@ -1660,7 +1836,6 @@ mod tests { assert_eq!(r, b); } - #[simd_test(enable = "neon")] unsafe fn test_vceq_f64() { let a: f64 = 1.2; @@ -1670,12 +1845,13 @@ mod tests { } #[simd_test(enable = "neon")] - unsafe fn test_vceqq_f32() { + unsafe fn test_vceqq_f64() { let a = f64x2::new(1.2, 3.4); let b = u64x2::new(0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF); let r: u64x2 = transmute(vceqq_f64(transmute(a), transmute(a))); assert_eq!(r, b); } + #[simd_test(enable = "neon")] unsafe fn test_vmaxv_s8() { let r = vmaxv_s8(transmute(i8x8::new(1, 2, 3, 4, -8, 6, 7, 5))); diff --git a/crates/core_arch/src/arm/neon.rs b/crates/core_arch/src/arm/neon.rs index fba2dedf43..3027ef509a 100644 --- a/crates/core_arch/src/arm/neon.rs +++ b/crates/core_arch/src/arm/neon.rs @@ -825,6 +825,94 @@ pub unsafe fn vceqq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { arm_simd_ceq!(vceq_p8, poly8x8_t); arm_simd_ceq!(vceqq_p8, poly8x16_t); +macro_rules! arm_simd_cgt { + ($name:ident, $type:ty) => { + /// Compare signed Greater than (vector) + arm_simd_2!($name, $type, simd_gt, cmgt, cmgt); + }; +} + +macro_rules! arm_simd_cgtu { + ($name:ident, $type:ty) => { + /// Compare Greater than (vector) + arm_simd_2!($name, $type, simd_gt, cmhi, cmhi); + }; +} +arm_simd_cgt!(vcgt_s8, int8x8_t); +arm_simd_cgt!(vcgtq_s8, int8x16_t); +arm_simd_cgt!(vcgt_s16, int16x4_t); +arm_simd_cgt!(vcgtq_s16, int16x8_t); +arm_simd_cgt!(vcgt_s32, int32x2_t); +arm_simd_cgt!(vcgtq_s32, int32x4_t); +arm_simd_cgtu!(vcgt_u8, uint8x8_t); +arm_simd_cgtu!(vcgtq_u8, uint8x16_t); +arm_simd_cgtu!(vcgt_u16, uint16x4_t); +arm_simd_cgtu!(vcgtq_u16, uint16x8_t); +arm_simd_cgtu!(vcgt_u32, uint32x2_t); +arm_simd_cgtu!(vcgtq_u32, uint32x4_t); + +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmgt))] +#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))] +pub unsafe fn vcgt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t { + simd_gt(a, b) +} + +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmgt))] +#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))] +pub unsafe fn vcgtq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { + simd_gt(a, b) +} + +macro_rules! arm_simd_clt { + ($name:ident, $type:ty) => { + /// Compare signed Lesser than (vector) + arm_simd_2!($name, $type, simd_lt, cmgt, cmgt); + }; +} + +macro_rules! arm_simd_cltu { + ($name:ident, $type:ty) => { + /// Compare Lesser than (vector) + arm_simd_2!($name, $type, simd_lt, cmhi, cmhi); + }; +} +arm_simd_clt!(vclt_s8, int8x8_t); +arm_simd_clt!(vcltq_s8, int8x16_t); +arm_simd_clt!(vclt_s16, int16x4_t); +arm_simd_clt!(vcltq_s16, int16x8_t); +arm_simd_clt!(vclt_s32, int32x2_t); +arm_simd_clt!(vcltq_s32, int32x4_t); +arm_simd_cltu!(vclt_u8, uint8x8_t); +arm_simd_cltu!(vcltq_u8, uint8x16_t); +arm_simd_cltu!(vclt_u16, uint16x4_t); +arm_simd_cltu!(vcltq_u16, uint16x8_t); +arm_simd_cltu!(vclt_u32, uint32x2_t); +arm_simd_cltu!(vcltq_u32, uint32x4_t); + +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmgt))] +#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))] +pub unsafe fn vclt_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t { + simd_lt(a, b) +} + +#[inline] +#[target_feature(enable = "neon")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmgt))] +#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmgt))] +pub unsafe fn vcltq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { + simd_lt(a, b) +} + /// Folding minimum of adjacent pairs #[inline] #[target_feature(enable = "neon")] @@ -1959,7 +2047,7 @@ mod tests { assert_eq!(r, b); } - #[simd_test(enable = "neon")] + #[simd_test(enable = "neon")] unsafe fn test_vceq_s8() { let a = i8x8::new(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07); let b = i8x8::new(-1, -1, -1, -1, -1, -1, -1, -1); @@ -2074,7 +2162,259 @@ mod tests { assert_eq!(r, b); } + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_s8() { + let a = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let b = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let c = i8x8::new(-1, -1, -1, -1, -1, -1, -1, -1); + let r: i8x8 = transmute(vcgt_s8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_s8() { + let a = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + let b = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + let c = i8x16::new(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); + let r: i8x16 = transmute(vcgtq_s8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_s16() { + let a = i16x4::new(1, 2, 3, 4); + let b = i16x4::new(0, 1, 2, 3); + let c = i16x4::new(-1, -1, -1, -1); + let r: i16x4 = transmute(vcgt_s16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_s16() { + let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let b = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let c = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1); + let r: i16x8 = transmute(vcgtq_s16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_s32() { + let a = i32x2::new(1, 2); + let b = i32x2::new(0, 1); + let c = i32x2::new(-1, -1); + let r: i32x2 = transmute(vcgt_s32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_s32() { + let a = i32x4::new(1, 2, 3, 4); + let b = i32x4::new(0, 1, 2, 3); + let c = i32x4::new(-1, -1, -1, -1); + let r: i32x4 = transmute(vcgtq_s32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_u8() { + let a = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let b = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let c = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + let r: u8x8 = transmute(vcgt_u8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_u8() { + let a = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + let b = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + let c = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + let r: u8x16 = transmute(vcgtq_u8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_u16() { + let a = u16x4::new(1, 2, 3, 4); + let b = u16x4::new(0, 1, 2, 3); + let c = u16x4::new(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + let r: u16x4 = transmute(vcgt_u16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_u16() { + let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let b = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let c = u16x8::new(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + let r: u16x8 = transmute(vcgtq_u16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_u32() { + let a = u32x2::new(1, 2); + let b = u32x2::new(0, 1); + let c = u32x2::new(0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x2 = transmute(vcgt_u32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_u32() { + let a = u32x4::new(1, 2, 3, 4); + let b = u32x4::new(0, 1, 2, 3); + let c = u32x4::new(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x4 = transmute(vcgtq_u32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + + #[simd_test(enable = "neon")] + unsafe fn test_vcgt_f32() { + let a = f32x2::new(1.2, 3.4); + let b = f32x2::new(0.1, 2.3); + let c = u32x2::new(0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x2 = transmute(vcgt_f32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcgtq_f32() { + let a = f32x4::new(1.2, 3.4, 5.6, 7.8); + let b = f32x4::new(0.1, 2.3, 4.5, 6.7); + let c = u32x4::new(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x4 = transmute(vcgtq_f32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_s8() { + let a = i8x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let b = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let c = i8x8::new(-1, -1, -1, -1, -1, -1, -1, -1); + let r: i8x8 = transmute(vclt_s8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_s8() { + let a = i8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + let b = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + let c = i8x16::new(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); + let r: i8x16 = transmute(vcltq_s8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_s16() { + let a = i16x4::new(0, 1, 2, 3); + let b = i16x4::new(1, 2, 3, 4); + let c = i16x4::new(-1, -1, -1, -1); + let r: i16x4 = transmute(vclt_s16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_s16() { + let a = i16x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let b = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let c = i16x8::new(-1, -1, -1, -1, -1, -1, -1, -1); + let r: i16x8 = transmute(vcltq_s16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_s32() { + let a = i32x2::new(0, 1); + let b = i32x2::new(1, 2); + let c = i32x2::new(-1, -1); + let r: i32x2 = transmute(vclt_s32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_s32() { + let a = i32x4::new(0, 1, 2, 3); + let b = i32x4::new(1, 2, 3, 4); + let c = i32x4::new(-1, -1, -1, -1); + let r: i32x4 = transmute(vcltq_s32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_u8() { + let a = u8x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let b = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let c = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + let r: u8x8 = transmute(vclt_u8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_u8() { + let a = u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + let b = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + let c = u8x16::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + let r: u8x16 = transmute(vcltq_u8(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_u16() { + let a = u16x4::new(0, 1, 2, 3); + let b = u16x4::new(1, 2, 3, 4); + let c = u16x4::new(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + let r: u16x4 = transmute(vclt_u16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_u16() { + let a = u16x8::new(0, 1, 2, 3, 4, 5, 6, 7); + let b = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8); + let c = u16x8::new(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + let r: u16x8 = transmute(vcltq_u16(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_u32() { + let a = u32x2::new(0, 1); + let b = u32x2::new(1, 2); + let c = u32x2::new(0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x2 = transmute(vclt_u32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_u32() { + let a = u32x4::new(0, 1, 2, 3); + let b = u32x4::new(1, 2, 3, 4); + let c = u32x4::new(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x4 = transmute(vcltq_u32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + + #[simd_test(enable = "neon")] + unsafe fn test_vclt_f32() { + let a = f32x2::new(0.1, 2.3); + let b = f32x2::new(1.2, 3.4); + let c = u32x2::new(0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x2 = transmute(vclt_f32(transmute(a), transmute(b))); + assert_eq!(r, c); + } + + #[simd_test(enable = "neon")] + unsafe fn test_vcltq_f32() { + let a = f32x4::new(0.1, 2.3, 4.5, 6.7); + let b = f32x4::new(1.2, 3.4, 5.6, 7.8); + let c = u32x4::new(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); + let r: u32x4 = transmute(vcltq_f32(transmute(a), transmute(b))); + assert_eq!(r, c); + } #[simd_test(enable = "neon")] unsafe fn test_vmovn_s16() { let a = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);