CMSIS-NN icon indicating copy to clipboard operation
CMSIS-NN copied to clipboard

The mat_mul_kernel_s16 function needs __PKHTB & __PKHBT to re-order the value

Open CristXu opened this issue 1 year ago • 1 comments

Hi, I found that at below line: https://github.com/ARM-software/CMSIS-NN/blob/d071e9f70195559e7242709b8df3adeb7c50d0fb/Source/NNSupportFunctions/arm_nn_mat_mul_kernel_s16.c#L93 We use a read_and_pad to process the weights for the value expanding from q7_t to q15_t, and also a group: __PKHxx for reording the value from (a0, a2, a1, a3) to (a0, a1, a2, a3). My question is that why we add this two PKHxx operations, I think that We can still use the (a0, a2, a1, a3), if we process the input with the same way (I found that the 1x1 conv2d has the similarity operation, without __PKHxx). So that we can save two-instructs and then save the inference time.

Regards, Crist

CristXu avatar Mar 08 '23 01:03 CristXu