ggml-cpu: change to typedef vector types

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
Aaron Teo
2025-06-21 17:26:20 +08:00
parent 7413dabc8c
commit 373fa28e4c

View File

@ -3145,8 +3145,8 @@ void ggml_cpu_fp32_to_fp16(const float * x, ggml_fp16_t * y, int64_t n) {
for (; i + 7 < n; i += 8) { for (; i + 7 < n; i += 8) {
float32x4_t v_xh = vec_xl(0, (const float *)(x + i + 0)); float32x4_t v_xh = vec_xl(0, (const float *)(x + i + 0));
float32x4_t v_xl = vec_xl(0, (const float *)(x + i + 4)); float32x4_t v_xl = vec_xl(0, (const float *)(x + i + 4));
__vector short unsigned int v_xd = vec_round_from_fp32(v_xh, v_xl, 0); uint16x8_t v_xd = vec_round_from_fp32(v_xh, v_xl, 0);
__vector short unsigned int v_xfp16 = vec_convert_to_fp16(v_xd, 0); uint16x8_t v_xfp16 = vec_convert_to_fp16(v_xd, 0);
vec_xst(v_xfp16, 0, (ggml_fp16_t *)(y + i)); vec_xst(v_xfp16, 0, (ggml_fp16_t *)(y + i));
} }
#endif #endif