24 #ifndef ARM_COMPUTE_WRAPPER_SCALAR_ADD_H
25 #define ARM_COMPUTE_WRAPPER_SCALAR_ADD_H
33 inline uint8_t
add_sat(
const uint8_t &a,
const uint8_t &
b)
35 const uint8x8_t va = { a, 0, 0, 0, 0, 0, 0, 0 };
36 const uint8x8_t vb = {
b, 0, 0, 0, 0, 0, 0, 0 };
37 return vget_lane_u8(vqadd_u8(va, vb), 0);
40 inline int16_t
add_sat(
const int16_t &a,
const int16_t &
b)
42 const int16x4_t va = { a, 0, 0, 0 };
43 const int16x4_t vb = {
b, 0, 0, 0 };
44 return vget_lane_s16(vqadd_s16(va, vb), 0);
47 inline int32_t
add_sat(
const int32_t &a,
const int32_t &
b)
49 const int32x2_t va = { a, 0 };
50 const int32x2_t vb = {
b, 0 };
51 return vget_lane_s32(vqadd_s32(va, vb), 0);
54 inline float add_sat(
const float &a,
const float &
b)
60 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
61 inline float16_t
add_sat(
const float16_t &a,
const float16_t &
b)
66 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC