From be21d538e6487c5f649a3424d8799d6d15bc6042 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 13 Apr 2023 18:19:20 +0300 Subject: [PATCH] ggml : implement vminvq and vmaxvq when missing --- ggml.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ggml.c b/ggml.c index bfb22b715..f6833da97 100644 --- a/ggml.c +++ b/ggml.c @@ -531,6 +531,18 @@ inline static float vaddvq_f32(float32x4_t v) { return vgetq_lane_f32(v, 0) + vgetq_lane_f32(v, 1) + vgetq_lane_f32(v, 2) + vgetq_lane_f32(v, 3); } +inline float vminvq_f32(float32x4_t v) { + return + MIN(MIN(vgetq_lane_f32(v, 0), vgetq_lane_f32(v, 1)), + MIN(vgetq_lane_f32(v, 2), vgetq_lane_f32(v, 3))); +} + +inline float vmaxvq_f32(float32x4_t v) { + return + MAX(MAX(vgetq_lane_f32(v, 0), vgetq_lane_f32(v, 1)), + MAX(vgetq_lane_f32(v, 2), vgetq_lane_f32(v, 3))); +} + #endif #endif