Skip to content

Commit 1c27b04

Browse files
committed
Optimize mul_sum_i8_pairs_float for LoongArch ASX
1 parent d2ab776 commit 1c27b04

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ggml/src/ggml-cpu/ggml-cpu-quants.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,8 @@ static inline __m256 mul_sum_us8_pairs_float(const __m256i ax, const __m256i sy)
691691

692692
// multiply int8_t, add results pairwise twice and return as float vector
693693
static inline __m256 mul_sum_i8_pairs_float(const __m256i x, const __m256i y) {
694-
695-
// Get absolute values of x vectors
696-
const __m256i ax = __lasx_xvsigncov_b(x, x);
697-
// Sign the values of the y vectors
698-
const __m256i sy = __lasx_xvsigncov_b(x, y);
699-
700-
return mul_sum_us8_pairs_float(ax, sy);
694+
const __m256i dot = lasx_madd_h_b(x, y);
695+
return sum_i16_pairs_float(dot);
701696
}
702697

703698
static inline __m128i packNibbles( __m256i bytes ) {

0 commit comments

Comments
 (0)