From 04bb0c2a06cfe94b76c3f6f29322f7a353313173 Mon Sep 17 00:00:00 2001 From: mehendarkarprajwal Date: Tue, 8 Apr 2025 05:30:25 -0500 Subject: [PATCH 1/2] Including limits file on AIX --- common/arg.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/arg.cpp b/common/arg.cpp index cdf8970254446..642fefb57548f 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -163,6 +163,8 @@ struct common_hf_file_res { # if !defined(PATH_MAX) # define PATH_MAX MAX_PATH # endif +#elif defined(_AIX) +#include #else #include #endif From 9653d4c0d2b024126ffe78617030db7827b70a89 Mon Sep 17 00:00:00 2001 From: mehendarkarprajwal Date: Tue, 8 Apr 2025 08:41:55 -0500 Subject: [PATCH 2/2] Fixes #12823 --- ggml/src/ggml-cpu/simd-mappings.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/simd-mappings.h b/ggml/src/ggml-cpu/simd-mappings.h index e0b5fc38dd49e..d7db9209f13a5 100644 --- a/ggml/src/ggml-cpu/simd-mappings.h +++ b/ggml/src/ggml-cpu/simd-mappings.h @@ -392,7 +392,11 @@ static inline void __avx_f32cx8_store(ggml_fp16_t *x, __m256 y) { #define GGML_F16_VEC_LOAD(p, i) (i & 0x1) ? \ vec_extract_fp32_from_shorth(vec_xl(0, p - GGML_F16_EPR)) : \ vec_extract_fp32_from_shortl(vec_xl(0, p)) -#define GGML_ENDIAN_BYTE(i) ((unsigned char *)&(uint16_t){1})[i] +static inline unsigned char ggml_endian_byte(int i) { + uint16_t tmp_val = 1; + return ((unsigned char *)&tmp_val)[i]; +} +#define GGML_ENDIAN_BYTE(i) ggml_endian_byte(i) #define GGML_F16_VEC_STORE(p, r, i) \ if (i & 0x1) \ vec_xst(vec_pack_to_short_fp32(r[i - GGML_ENDIAN_BYTE(1)], \