Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Sep 13, 2023
1 parent c8af2f0 commit be21d48
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/layer/arm/convolution_im2col_gemm_int8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6480,7 +6480,7 @@ static void convolution_gemm_transB_packed_tile_int8(const Mat& AT_tile, const M
}

outptr += 4;
#else // __ARM_NEON
#else // __ARM_NEON
int sum00;
int sum10;
int sum01;
Expand All @@ -6503,22 +6503,6 @@ static void convolution_gemm_transB_packed_tile_int8(const Mat& AT_tile, const M

const signed char* pA = pAT;
int kk = 0;
#if __ARM_NEON
for (; kk + 1 < max_kk; kk += 2)
{
sum00 += pA[0] * pB[0];
sum00 += pA[1] * pB[1];
sum10 += pA[2] * pB[0];
sum10 += pA[3] * pB[1];
sum01 += pA[0] * pB[2];
sum01 += pA[1] * pB[3];
sum11 += pA[2] * pB[2];
sum11 += pA[3] * pB[3];

pA += 4;
pB += 4;
}
#endif // __ARM_NEON
#if __ARM_FEATURE_SIMD32 && NCNN_GNU_INLINE_ASM
for (; kk + 1 < max_kk; kk += 2)
{
Expand Down Expand Up @@ -6556,6 +6540,8 @@ static void convolution_gemm_transB_packed_tile_int8(const Mat& AT_tile, const M
int _pB0 = *((int*)pB);
int _pA1;
int _pB1;
// clang-format off
// *INDENT-OFF*
asm volatile("ror %0, %1, #8" : "=r"(_pA1) : "r"(_pA0) :);
asm volatile("ror %0, %1, #8" : "=r"(_pB1) : "r"(_pB0) :);
asm volatile("sxtb16 %0, %0" : "=r"(_pA0) : "0"(_pA0) :);
Expand All @@ -6566,6 +6552,8 @@ static void convolution_gemm_transB_packed_tile_int8(const Mat& AT_tile, const M
asm volatile("smlad %0, %2, %3, %0" : "=r"(sum10) : "0"(sum10), "r"(_pA1), "r"(_pB0) :);
asm volatile("smlad %0, %2, %3, %0" : "=r"(sum01) : "0"(sum01), "r"(_pA0), "r"(_pB1) :);
asm volatile("smlad %0, %2, %3, %0" : "=r"(sum11) : "0"(sum11), "r"(_pA1), "r"(_pB1) :);
// *INDENT-ON*
// clang-format on
pA += 4;
pB += 4;
#endif
Expand Down

0 comments on commit be21d48

Please sign in to comment.