Skip to content

Commit 39be83a

Browse files
committed
Add ceq for arm
1 parent 0e85e1b commit 39be83a

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"workbench.colorCustomizations": {}
3+
}

crates/core_arch/src/arm/neon.rs

+54
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,60 @@ arm_simd_eor!(veorq_u32, uint32x4_t);
782782
arm_simd_eor!(veor_u64, uint64x1_t);
783783
arm_simd_eor!(veorq_u64, uint64x2_t);
784784

785+
macro_rules! arm_simd_ceq {
786+
($name:ident, $type:ty) => {
787+
/// Vector bitwise exclusive or (vector).
788+
arm_simd_2!($name, $type, simd_eq, cmeq, cmeq);
789+
};
790+
}
791+
792+
arm_simd_ceq!(vceq_s8, int8x8_t);
793+
arm_simd_ceq!(vceqq_s8, int8x16_t);
794+
arm_simd_ceq!(vceq_s16, int16x4_t);
795+
arm_simd_ceq!(vceqq_s16, int16x8_t);
796+
arm_simd_ceq!(vceq_s32, int32x2_t);
797+
arm_simd_ceq!(vceqq_s32, int32x4_t);
798+
arm_simd_ceq!(vceq_u8, uint8x8_t);
799+
arm_simd_ceq!(vceqq_u8, uint8x16_t);
800+
arm_simd_ceq!(vceq_u16, uint16x4_t);
801+
arm_simd_ceq!(vceqq_u16, uint16x8_t);
802+
arm_simd_ceq!(vceq_u32, uint32x2_t);
803+
arm_simd_ceq!(vceqq_u32, uint32x4_t);
804+
805+
806+
// arm_simd_ceq!(vceq_f32, float32x2_t); // we have a different return type
807+
#[inline]
808+
#[target_feature(enable = "neon")]
809+
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
810+
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmeq))]
811+
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmeq))]
812+
pub unsafe fn vceq_f32(a: float32x2_t, b: float32x2_t) -> uint32x2_t {
813+
simd_eq(a, b)
814+
}
815+
816+
// arm_simd_ceq!(vceqq_f32, float32x4_t); we have a different return type
817+
#[inline]
818+
#[target_feature(enable = "neon")]
819+
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
820+
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(fcmeq))]
821+
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fcmeq))]
822+
pub unsafe fn vceqq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
823+
simd_eq(a, b)
824+
}
825+
826+
arm_simd_ceq!(vceq_p8, poly8x8_t);
827+
arm_simd_ceq!(vceqq_p8, poly8x16_t);
828+
829+
// TODO:
830+
// uint64x1_t vceq_s64 (int64x1_t a, int64x1_t b)Compare bitwise equal
831+
// uint64x2_t vceqq_s64 (int64x2_t a, int64x2_t b)Compare bitwise equal
832+
// uint64x1_t vceq_u64 (uint64x1_t a, uint64x1_t b)Compare bitwise equal
833+
// uint64x2_t vceqq_u64 (uint64x2_t a, uint64x2_t b)Compare bitwise equal
834+
// uint64x1_t vceq_p64 (poly64x1_t a, poly64x1_t b)Compare bitwise equal
835+
// uint64x2_t vceqq_p64 (poly64x2_t a, poly64x2_t b)Compare bitwise equal
836+
// ui nt64x1_t vceq_f64 (float64x1_t a, float64x1_t b)Floating-point compare equal
837+
// uint64x2_t vceqq_f64 (float64x2_t a, float64x2_t b)Floating-point compare equal
838+
785839
/// Folding minimum of adjacent pairs
786840
#[inline]
787841
#[target_feature(enable = "neon")]

0 commit comments

Comments
 (0)