aom: mem_neon.h: Define vld1q_u16_x4 until GCC 8.5.0

From 0b2a8639c2aef7494d333fae47b3817d3c08e3d4 Mon Sep 17 00:00:00 2001
From: George Steed <[EMAIL REDACTED]>
Date: Wed, 7 Feb 2024 15:40:34 +0000
Subject: [PATCH] mem_neon.h: Define vld1q_u16_x4 until GCC 8.5.0

When trying to build the library with GCC 8.3.0 the vld1q_u16_x4
intrinsic is not available, leading to the code failing to compile.

We already provide a definition for this helper for earlier versions of
GCC, so adjust the checks so we also provide it until GCC 8.5.0 instead.

Bug: aomedia:3543
Change-Id: I98a32ae6abd068f326a1075dd6782b190e2eac1d
---
 aom_dsp/arm/mem_neon.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/aom_dsp/arm/mem_neon.h b/aom_dsp/arm/mem_neon.h
index 52c7a34e3e..5be60a611a 100644
--- a/aom_dsp/arm/mem_neon.h
+++ b/aom_dsp/arm/mem_neon.h
@@ -56,17 +56,10 @@ static INLINE uint16x8x4_t vld1q_u16_x4(const uint16_t *ptr) {
 
 #elif defined(__GNUC__) && !defined(__clang__)  // GCC 64-bit.
 #if __GNUC__ < 8
-
 static INLINE uint8x16x2_t vld1q_u8_x2(const uint8_t *ptr) {
   uint8x16x2_t res = { { vld1q_u8(ptr + 0 * 16), vld1q_u8(ptr + 1 * 16) } };
   return res;
 }
-
-static INLINE uint16x8x4_t vld1q_u16_x4(const uint16_t *ptr) {
-  uint16x8x4_t res = { { vld1q_u16(ptr + 0 * 8), vld1q_u16(ptr + 1 * 8),
-                         vld1q_u16(ptr + 2 * 8), vld1q_u16(ptr + 3 * 8) } };
-  return res;
-}
 #endif  // __GNUC__ < 8
 
 #if __GNUC__ < 9
@@ -76,6 +69,15 @@ static INLINE uint8x16x3_t vld1q_u8_x3(const uint8_t *ptr) {
   return res;
 }
 #endif  // __GNUC__ < 9
+
+// vld1q_u16_x4 is defined from GCC 8.5.0 and onwards.
+#if ((__GNUC__ << 8) | __GNUC_MINOR__) < 0x805
+static INLINE uint16x8x4_t vld1q_u16_x4(const uint16_t *ptr) {
+  uint16x8x4_t res = { { vld1q_u16(ptr + 0 * 8), vld1q_u16(ptr + 1 * 8),
+                         vld1q_u16(ptr + 2 * 8), vld1q_u16(ptr + 3 * 8) } };
+  return res;
+}
+#endif  // ((__GNUC__ << 8) | __GNUC_MINOR__) < 0x805
 #endif  // defined(__GNUC__) && !defined(__clang__)
 
 static INLINE void store_u8_8x2(uint8_t *s, ptrdiff_t p, const uint8x8_t s0,