Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Buethe <jbuethe@amazon.de>2023-07-22 21:11:49 +0300
committerJan Buethe <jbuethe@amazon.de>2023-07-22 21:11:49 +0300
commitbe5f58d6790117a1ac7056b4fffa7240efa1347d (patch)
tree78cc69953e5d80b9ef77da3aa535e591698912e9
parentcfc118d52e8b6611a54676d4cc6c6d1b7e867d91 (diff)
neon related alignment requirement warning fixopus-ng-neonwarningfix
-rw-r--r--dnn/vec_neon.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/dnn/vec_neon.h b/dnn/vec_neon.h
index 6bf2cbbe..38c20d7b 100644
--- a/dnn/vec_neon.h
+++ b/dnn/vec_neon.h
@@ -320,7 +320,8 @@ static inline int32x4_t vdotprod(int32x4_t acc, int8x16_t a, int8x16_t b)
static inline void cgemv8x4(float *_out, const opus_int8 *w, const float *scale, int rows, int cols, const float *_x)
{
int i, j;
- opus_int8 x[MAX_INPUTS];
+ opus_int32 x_int[MAX_INPUTS/4];
+ opus_int8 *x = (opus_int8*) x_int;
const float32x4_t const127 = vdupq_n_f32(127.);
for (i=0;i<cols;i+=8) {
int32x4_t xi0, xi4;
@@ -338,7 +339,7 @@ static inline void cgemv8x4(float *_out, const opus_int8 *w, const float *scale,
for (j=0;j<cols;j+=4)
{
int8x16_t vw0, vw1, vx;
- vx = (int8x16_t)vld1q_dup_s32((int*)&x[j]);
+ vx = (int8x16_t)vld1q_dup_s32((int*)(void*)&x[j]);
vw0 = vld1q_s8(w);
vw1 = vld1q_s8(&w[16]);
acc0 = vdotprod(acc0, vw0, vx);
@@ -353,7 +354,8 @@ static inline void cgemv8x4(float *_out, const opus_int8 *w, const float *scale,
static inline void sparse_cgemv8x4(float *_out, const opus_int8 *w, const int *idx, const float *scale, int rows, int cols, const float *_x)
{
int i, j;
- opus_int8 x[MAX_INPUTS];
+ opus_int32 x_int[MAX_INPUTS/4];
+ opus_int8 *x = (opus_int8*) x_int;
const float32x4_t const127 = vdupq_n_f32(127.);
for (i=0;i<cols;i+=8) {
int32x4_t xi0, xi4;
@@ -375,7 +377,7 @@ static inline void sparse_cgemv8x4(float *_out, const opus_int8 *w, const int *i
int pos;
pos = (*idx++);
int8x16_t vw0, vw1, vx;
- vx = (int8x16_t)vld1q_dup_s32((int*)&x[pos]);
+ vx = (int8x16_t)vld1q_dup_s32((int*)(void*)&x[pos]);
vw0 = vld1q_s8(w);
vw1 = vld1q_s8(&w[16]);
acc0 = vdotprod(acc0, vw0, vx);