Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ggml/src/ggml-cpu/simd-mappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,10 +944,8 @@ static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
for (int i = 0; i < offset; ++i) { \
x[i] = vec_add(x[i], x[offset + i]); \
} \
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a brief comment explaining that vec_reve(x[0]) reverses the vector so that summing with the original yields pairwise partial sums, which clarifies the reduction logic.

Suggested change
} \
} \
// Reverse the vector x[0] and sum it with the original to compute pairwise partial sums.

Copilot uses AI. Check for mistakes.
res = vec_extract(x[0], 0) + \
vec_extract(x[0], 1) + \
vec_extract(x[0], 2) + \
vec_extract(x[0], 3); \
float32x4_t tmp = x[0] + vec_reve(x[0]); \
res = tmp[0] + tmp[1]; \
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your platform provides a vector reduction intrinsic (e.g., vec_reduce_add), using that can make the horizontal sum intent clearer and may leverage hardware acceleration.

Copilot uses AI. Check for mistakes.
}

#define GGML_F32_VEC GGML_F32x4
Expand Down
Loading