Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jan 25, 2025
1 parent 07d6fd0 commit 8ebedb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/layer/loongarch/requantize_loongarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void requantize_relu(const int* intptr, signed char* ptr, const Mat& scal
{
__m128 _v = __lsx_vffint_s_w(__lsx_vld(intptr, 0));
_v = __lsx_vfmul_s(_v, _scale0);
v16i8 v = (v16i8)float2int8relu(_v, _v);
v16i8 v = (v16i8)float2int8relu(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -170,7 +170,7 @@ static void requantize_relu(const int* intptr, signed char* ptr, const Mat& scal
{
__m128 _v = __lsx_vffint_s_w(__lsx_vld(intptr, 0));
_v = __lsx_vfmadd_s(_v, _scale0, _bias0);
v16i8 v = (v16i8)float2int8relu(_v, _v);
v16i8 v = (v16i8)float2int8relu(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -269,7 +269,7 @@ static void requantize_leakyrelu(const int* intptr, signed char* ptr, const Mat&
{
__m128 _v = __lsx_vffint_s_w(__lsx_vld(intptr, 0));
_v = __lsx_vfmul_s(_v, _scale0);
v16i8 v = (v16i8)float2int8leakyrelu(_v, _v, _slope);
v16i8 v = (v16i8)float2int8leakyrelu(_v, _slope);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -331,7 +331,7 @@ static void requantize_leakyrelu(const int* intptr, signed char* ptr, const Mat&
{
__m128 _v = __lsx_vffint_s_w(__lsx_vld(intptr, 0));
_v = __lsx_vfmadd_s(_v, _scale0, _bias0);
v16i8 v = (v16i8)float2int8leakyrelu(_v, _v, _slope);
v16i8 v = (v16i8)float2int8leakyrelu(_v, _slope);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -436,7 +436,7 @@ static void requantize(const int* intptr, signed char* ptr, const Mat& scale_in_
_v = __lsx_vfmul_s(_v, _scale_in0);
_v = activation_ps(_v, activation_type, activation_params);
_v = __lsx_vfmul_s(_v, _scale_out0);
v16i8 v = (v16i8)float2int8(_v, _v);
v16i8 v = (v16i8)float2int8(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -498,7 +498,7 @@ static void requantize(const int* intptr, signed char* ptr, const Mat& scale_in_
_v = __lsx_vfmadd_s(_v, _scale_in0, _bias0);
_v = activation_ps(_v, activation_type, activation_params);
_v = __lsx_vfmul_s(_v, _scale_out0);
v16i8 v = (v16i8)float2int8(_v, _v);
v16i8 v = (v16i8)float2int8(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down
12 changes: 6 additions & 6 deletions src/layer/mips/requantize_mips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void requantize_relu(const int* intptr, signed char* ptr, const Mat& scal
{
v4f32 _v = (v4f32)__msa_ffint_s_w(__msa_ld_w(intptr, 0));
_v = __msa_fmul_w(_v, _scale0);
v16i8 v = float2int8relu(_v, _v);
v16i8 v = float2int8relu(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -170,7 +170,7 @@ static void requantize_relu(const int* intptr, signed char* ptr, const Mat& scal
{
v4f32 _v = (v4f32)__msa_ffint_s_w(__msa_ld_w(intptr, 0));
_v = __msa_fmadd_w(_bias0, _v, _scale0);
v16i8 v = float2int8relu(_v, _v);
v16i8 v = float2int8relu(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -269,7 +269,7 @@ static void requantize_leakyrelu(const int* intptr, signed char* ptr, const Mat&
{
v4f32 _v = (v4f32)__msa_ffint_s_w(__msa_ld_w(intptr, 0));
_v = __msa_fmul_w(_v, _scale0);
v16i8 v = float2int8leakyrelu(_v, _v, _slope);
v16i8 v = float2int8leakyrelu(_v, _slope);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -331,7 +331,7 @@ static void requantize_leakyrelu(const int* intptr, signed char* ptr, const Mat&
{
v4f32 _v = (v4f32)__msa_ffint_s_w(__msa_ld_w(intptr, 0));
_v = __msa_fmadd_w(_bias0, _v, _scale0);
v16i8 v = float2int8leakyrelu(_v, _v, _slope);
v16i8 v = float2int8leakyrelu(_v, _slope);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -436,7 +436,7 @@ static void requantize(const int* intptr, signed char* ptr, const Mat& scale_in_
_v = __msa_fmul_w(_v, _scale_in0);
_v = activation_ps(_v, activation_type, activation_params);
_v = __msa_fmul_w(_v, _scale_out0);
v16i8 v = float2int8(_v, _v);
v16i8 v = float2int8(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down Expand Up @@ -498,7 +498,7 @@ static void requantize(const int* intptr, signed char* ptr, const Mat& scale_in_
_v = __msa_fmadd_w(_bias0, _v, _scale_in0);
_v = activation_ps(_v, activation_type, activation_params);
_v = __msa_fmul_w(_v, _scale_out0);
v16i8 v = float2int8(_v, _v);
v16i8 v = float2int8(_v);
ptr[0] = v[0];
ptr[1] = v[1];
ptr[2] = v[2];
Expand Down

0 comments on commit 8ebedb7

Please sign in to comment.