Skip to content

Commit 0fed24c

Browse files
taronaeoAleksei Nikiforov
andauthored
ggml: fix compilation error s390x (#12848)
* ggml: fixes #12846 compilation error Signed-off-by: Aaron Teo <[email protected]> Co-authored-by: Aleksei Nikiforov <[email protected]> * ggml: add documentation for code change Signed-off-by: Aaron Teo <[email protected]> Co-authored-by: Aleksei Nikiforov <[email protected]> * ggml: refactor to type-cast and update documentation Signed-off-by: Aaron Teo <[email protected]> Co-authored-by: Aleksei Nikiforov <[email protected]> * ggml: update documentation to provide full issue link Signed-off-by: Aaron Teo <[email protected]> Co-authored-by: Aleksei Nikiforov <[email protected]> --------- Co-authored-by: Aleksei Nikiforov <[email protected]>
1 parent 47ba87d commit 0fed24c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,17 @@ static inline __vector float __lzs_f16cx4_load(const ggml_fp16_t * x) {
855855
tmp[i] = GGML_FP16_TO_FP32(x[i]);
856856
}
857857

858-
return vec_xl(0, tmp);
858+
// note: keep type-cast here to prevent compiler bugs
859+
// see: https://github.com/ggml-org/llama.cpp/issues/12846
860+
return vec_xl(0, (const float *)(tmp));
859861
}
860862

861863
static inline void __lzs_f16cx4_store(ggml_fp16_t * x, __vector float y) {
862864
float arr[4];
863865

864-
vec_xst(y, 0, arr);
866+
// note: keep type-cast here to prevent compiler bugs
867+
// see: https://github.com/ggml-org/llama.cpp/issues/12846
868+
vec_xst(y, 0, (float *)(arr));
865869

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

0 commit comments

Comments
 (0)