24 #ifndef ARM_COMPUTE_SVESYMM_H 25 #define ARM_COMPUTE_SVESYMM_H 29 #if defined(__ARM_FEATURE_SVE2) 43 inline svfloat32x2_t svdequantize_qsymm16_z(svbool_t pg,
const svint16_t &qv,
float scale)
45 const auto vscale = svdup_n_f32(scale);
46 const svfloat32x2_t vdequantized_input =
49 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlb_s32(qv)), vscale),
50 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlt_s32(qv)), vscale)
54 return vdequantized_input;
65 inline svint16_t svquantize_qsymm16_z(svbool_t pg,
const svfloat32x2_t qv,
float scale)
67 const svfloat32_t vinvscale = svdup_n_f32(1.f / scale);
69 const auto rf_0 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget2_f32(qv, 0), vinvscale));
70 const auto rf_1 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget2_f32(qv, 1), vinvscale));
71 const auto pa = svqxtnt_s32(svqxtnb_s32(rf_0), rf_1);
84 inline svfloat32x4_t svdequantize_z(svbool_t pg,
const svint16x2_t qv,
const UniformQuantizationInfo &qi)
86 const float scale = qi.scale;
87 const auto vscale = svdup_n_f32(scale);
88 const svfloat32x4_t vdequantized_input =
91 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlb_s32(svget2_s16(qv, 0))), vscale),
92 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlt_s32(svget2_s16(qv, 0))), vscale),
93 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlb_s32(svget2_s16(qv, 1))), vscale),
94 svmul_f32_z(pg, svcvt_f32_s32_z(pg, svmovlt_s32(svget2_s16(qv, 1))), vscale),
98 return vdequantized_input;
109 inline svint16x2_t svquantize_qsymm16_z(svbool_t pg,
const svfloat32x4_t qv,
const UniformQuantizationInfo &qi)
111 const float scale = qi.scale;
113 const auto vinvscale = svdup_n_f32(1.f / scale);
114 const auto rf_0 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget4_f32(qv, 0), vinvscale));
115 const auto rf_1 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget4_f32(qv, 1), vinvscale));
116 const auto rf_2 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget4_f32(qv, 2), vinvscale));
117 const auto rf_3 = svcvt_s32_f32_z(pg, svmul_f32_z(pg, svget4_f32(qv, 3), vinvscale));
119 const auto pa = svqxtnt_s32(svqxtnb_s32(rf_0), rf_1);
120 const auto pb = svqxtnt_s32(svqxtnb_s32(rf_2), rf_3);
122 return svcreate2_s16(pa, pb);
127 #endif // ARM_COMPUTE_NESYMM_H
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Copyright (c) 2017-2021 Arm Limited.