37 return vdivq_f32(a, b);
40 float32x4_t recip = vrecpeq_f32(b);
41 recip = vmulq_f32(vrecpsq_f32(b, recip), recip);
42 recip = vmulq_f32(vrecpsq_f32(b, recip), recip);
43 return vmulq_f32(a, recip);
78 tmp[i] = base[indices[i]];
79 return vld1q_f32(tmp);
87 base[indices[i]] = tmp[i];
97 float32x4_t diff = vsubq_f32(a, b);
98 float32x4_t abs_diff = vabsq_f32(diff);
99 float32x4_t tol_vec = vdupq_n_f32(tol);
100 uint32x4_t cmp = vcleq_f32(abs_diff, tol_vec);
102 return vminvq_u32(cmp) != 0;
163 tmp[i] = base[indices[i]];
164 return vld1q_f64(tmp);
172 base[indices[i]] = tmp[i];
182 float64x2_t diff = vsubq_f64(a, b);
183 float64x2_t abs_diff = vabsq_f64(diff);
184 float64x2_t tol_vec = vdupq_n_f64(tol);
185 uint64x2_t cmp = vcleq_f64(abs_diff, tol_vec);
187 return (vgetq_lane_u64(cmp, 0) & vgetq_lane_u64(cmp, 1)) != 0;
Global configuration for the tesseract tensor library.
#define my_size_t
Size/index type used throughout the library.
Definition config.h:126
#define FORCE_INLINE
Hint the compiler to always inline a function.
Definition config.h:26
Definition neon_intrinsics.h:111
static FORCE_INLINE VecType load(const ScalarType *ptr) noexcept
Definition neon_intrinsics.h:117
static FORCE_INLINE VecType fmsub(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:143
static FORCE_INLINE VecType sub(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:130
static FORCE_INLINE VecType fmsub(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:142
static FORCE_INLINE VecType fnmadd(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:147
static constexpr my_size_t simdWidth
Definition neon_intrinsics.h:112
static FORCE_INLINE VecType max(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:156
static FORCE_INLINE void store(ScalarType *ptr, VecType val) noexcept
Definition neon_intrinsics.h:119
static FORCE_INLINE VecType fnmadd(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:146
static FORCE_INLINE VecType max(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:157
double ScalarType
Definition neon_intrinsics.h:115
static FORCE_INLINE VecType mul(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:126
static FORCE_INLINE VecType min(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:153
static FORCE_INLINE VecType gather(const ScalarType *base, const my_size_t *indices) noexcept
Definition neon_intrinsics.h:159
float64x2_t VecType
Definition neon_intrinsics.h:114
static FORCE_INLINE VecType add(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:124
static FORCE_INLINE VecType loadu(const ScalarType *ptr) noexcept
Definition neon_intrinsics.h:118
static FORCE_INLINE VecType abs(VecType v) noexcept
Definition neon_intrinsics.h:175
static FORCE_INLINE VecType fnmsub(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:151
static FORCE_INLINE VecType mul(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:127
static FORCE_INLINE VecType sub(ScalarType a, VecType b) noexcept
Definition neon_intrinsics.h:131
static FORCE_INLINE VecType fmadd(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:138
static FORCE_INLINE VecType fmadd(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:139
static FORCE_INLINE VecType sub(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:129
static FORCE_INLINE VecType div(ScalarType a, VecType b) noexcept
Definition neon_intrinsics.h:135
static constexpr my_size_t num_registers
Definition neon_intrinsics.h:113
static FORCE_INLINE void storeu(ScalarType *ptr, VecType val) noexcept
Definition neon_intrinsics.h:120
static FORCE_INLINE VecType set1(ScalarType scalar) noexcept
Definition neon_intrinsics.h:121
static FORCE_INLINE bool all_within_tolerance(VecType a, VecType b, ScalarType tol) noexcept
Definition neon_intrinsics.h:180
static FORCE_INLINE VecType div(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:134
static FORCE_INLINE VecType min(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:154
static FORCE_INLINE VecType add(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:123
static FORCE_INLINE VecType div(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:133
static FORCE_INLINE void scatter(ScalarType *base, const my_size_t *indices, VecType val) noexcept
Definition neon_intrinsics.h:167
static FORCE_INLINE VecType fnmsub(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:150
Definition neon_intrinsics.h:11
static FORCE_INLINE VecType sub(ScalarType a, VecType b) noexcept
Definition neon_intrinsics.h:31
static FORCE_INLINE VecType min(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:65
static FORCE_INLINE VecType fnmsub(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:63
static FORCE_INLINE VecType max(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:69
static FORCE_INLINE VecType fnmadd(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:58
float32x4_t VecType
Definition neon_intrinsics.h:14
static FORCE_INLINE bool all_within_tolerance(VecType a, VecType b, ScalarType tol) noexcept
Definition neon_intrinsics.h:95
static constexpr my_size_t simdWidth
Definition neon_intrinsics.h:12
static FORCE_INLINE VecType max(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:68
static FORCE_INLINE VecType load(const ScalarType *ptr) noexcept
Definition neon_intrinsics.h:17
static FORCE_INLINE VecType fmsub(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:54
static FORCE_INLINE VecType abs(VecType v) noexcept
Definition neon_intrinsics.h:90
static FORCE_INLINE VecType div(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:46
static FORCE_INLINE VecType fnmadd(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:59
static FORCE_INLINE VecType sub(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:29
static FORCE_INLINE VecType fmsub(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:55
static FORCE_INLINE VecType add(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:24
static FORCE_INLINE VecType mul(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:27
static FORCE_INLINE VecType gather(const ScalarType *base, const my_size_t *indices) noexcept
Definition neon_intrinsics.h:74
static FORCE_INLINE VecType min(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:66
float ScalarType
Definition neon_intrinsics.h:15
static FORCE_INLINE VecType loadu(const ScalarType *ptr) noexcept
Definition neon_intrinsics.h:18
static FORCE_INLINE VecType mul(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:26
static FORCE_INLINE VecType sub(VecType a, ScalarType b) noexcept
Definition neon_intrinsics.h:30
static FORCE_INLINE void storeu(ScalarType *ptr, VecType val) noexcept
Definition neon_intrinsics.h:20
static FORCE_INLINE VecType fmadd(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:50
static FORCE_INLINE void store(ScalarType *ptr, VecType val) noexcept
Definition neon_intrinsics.h:19
static FORCE_INLINE VecType add(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:23
static FORCE_INLINE VecType fmadd(VecType a, ScalarType b, VecType c) noexcept
Definition neon_intrinsics.h:51
static FORCE_INLINE VecType fnmsub(VecType a, VecType b, VecType c) noexcept
Definition neon_intrinsics.h:62
static constexpr my_size_t num_registers
Definition neon_intrinsics.h:13
static FORCE_INLINE VecType div(ScalarType a, VecType b) noexcept
Definition neon_intrinsics.h:47
static FORCE_INLINE VecType set1(ScalarType scalar) noexcept
Definition neon_intrinsics.h:21
static FORCE_INLINE VecType div(VecType a, VecType b) noexcept
Definition neon_intrinsics.h:33
static FORCE_INLINE void scatter(ScalarType *base, const my_size_t *indices, VecType val) noexcept
Definition neon_intrinsics.h:82