Skip to content

Commit 2f58bbc

Browse files
committed
ggml-cpu: better variable names
Signed-off-by: Aaron Teo <[email protected]>
1 parent ff70b3a commit 2f58bbc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ggml/src/ggml-cpu/simd-mappings.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@ static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
964964

965965
static inline float32x4_t __lzs_f16cx4_load(const ggml_fp16_t * x) {
966966
#ifdef __NNPA__
967-
uint16x8_t tmp = vec_xl(0, (const ggml_fp16_t *)x);
968-
uint16x8_t nnpa = vec_convert_from_fp16(tmp, 0);
969-
return vec_extend_to_fp32_hi(nnpa, 0);
967+
uint16x8_t v_x = vec_xl(0, (const ggml_fp16_t *)x);
968+
uint16x8_t nnpa_dlf16 = vec_convert_from_fp16(v_x, 0);
969+
return vec_extend_to_fp32_hi(nnpa_dlf16, 0);
970970
#else
971971
float tmp[4];
972972

@@ -980,20 +980,20 @@ static inline float32x4_t __lzs_f16cx4_load(const ggml_fp16_t * x) {
980980
#endif
981981
}
982982

983-
static inline void __lzs_f16cx4_store(ggml_fp16_t * x, float32x4_t y) {
983+
static inline void __lzs_f16cx4_store(ggml_fp16_t * x, float32x4_t v_y) {
984984
#ifdef __NNPA__
985985
float32x4_t zero = vec_splats(0.0f);
986-
uint16x8_t nnpa = vec_round_from_fp32(y, zero, 0);
987-
x[0] = nnpa[0];
988-
x[1] = nnpa[1];
989-
x[2] = nnpa[2];
990-
x[3] = nnpa[3];
986+
uint16x8_t v_x = vec_round_from_fp32(v_y, zero, 0);
987+
x[0] = vec_extract(v_x, 0);
988+
x[1] = vec_extract(v_x, 1);
989+
x[2] = vec_extract(v_x, 2);
990+
x[3] = vec_extract(v_x, 3);
991991
#else
992992
float arr[4];
993993

994994
// note: keep type-cast here to prevent compiler bugs
995995
// see: https://github.com/ggml-org/llama.cpp/issues/12846
996-
vec_xst(y, 0, (float *)(arr));
996+
vec_xst(v_y, 0, (float *)(arr));
997997

998998
for (int i = 0; i < 4; i++) {
999999
x[i] = GGML_FP32_TO_FP16(arr[i]);

0 commit comments

Comments
 (0)