ref: 55b3ec0bab55921f5c35ddec92de4742aa0ee346
parent: 719a61a653646e781b2024da890c7c6b378a6f1e
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Oct 24 14:57:13 EDT 2021
LD*/ST*: make it work with 7l (thanks cinap_lenrek)
--- a/codec/common/inc/ls_defines.h
+++ b/codec/common/inc/ls_defines.h
@@ -35,6 +35,15 @@
#include "typedefs.h"
+#ifdef __arm64__
+#define LD16(a) (((uint8_t*)(a))[0] | ((uint8_t*)(a))[1]<<8)
+#define LD32(a) (((uint8_t*)(a))[0] | ((uint8_t*)(a))[1]<<8 | ((uint8_t*)(a))[2]<<16 | ((uint8_t*)(a))[3]<<24)
+#define LD64(a) (((uint8_t*)(a))[0] | ((uint8_t*)(a))[1]<<8 | ((uint8_t*)(a))[2]<<16 | ((uint8_t*)(a))[3]<<24 | (uvlong)((uint8_t*)(a))[4]<<32 | (uvlong)((uint8_t*)(a))[5]<<40 | (uvlong)((uint8_t*)(a))[6]<<48 | (uvlong)((uint8_t*)(a))[7]<<56)
+
+#define ST16(a, b) do{ uint16_t *p = (void*)(a); *p = (b); }while(0)
+#define ST32(a, b) do{ uint32_t *p = (void*)(a); *p = (b); }while(0)
+#define ST64(a, b) do{ uint64_t *p = (void*)(a); *p = (b); }while(0)
+#else
#define LD16(a) (*((uint16_t*)(a)))
#define LD32(a) (*((uint32_t*)(a)))
#define LD64(a) (*((uint64_t*)(a)))
@@ -42,6 +51,8 @@
#define ST16(a, b) *((uint16_t*)(a)) = (b)
#define ST32(a, b) *((uint32_t*)(a)) = (b)
#define ST64(a, b) *((uint64_t*)(a)) = (b)
+#endif
+
#define LD16A2 LD16
#define LD32A2 LD32
#define LD32A4 LD32