From 73bc34b27875933a10a1cebfcfa21310ce3bbfa7 Mon Sep 17 00:00:00 2001
From: Tsung-Yu Chan <Tsung-Yu.Chan@eurecom.fr>
Date: Tue, 1 Aug 2023 13:22:36 +0200
Subject: [PATCH] fix / compile on ARM

---
 openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++--
 openair1/PHY/TOOLS/cmult_sv.c        | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index 5b1436a5556..305a90d819d 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -1268,9 +1268,9 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
     for (int group=0;group<ngroup;group++) {
       // each group has 8*nc_group_size elements, compute 1 complex correlation with DMRS per group
       // non-coherent combining across groups
-      __m64 dmrs_re = byte2m64_re[sGold8[(group & 1) << 1]];
+      simde__m64 dmrs_re = byte2m64_re[sGold8[(group & 1) << 1]];
       int16_t *dmrs_re16 = (int16_t *)&dmrs_re;
-      __m64 dmrs_im = byte2m64_im[sGold8[(group & 1) << 1]];
+      simde__m64 dmrs_im = byte2m64_im[sGold8[(group & 1) << 1]];
       int16_t *dmrs_im16 = (int16_t *)&dmrs_im;
 #ifdef DEBUG_NR_PUCCH_RX
       printf("Group %d: s %x x2 %x ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
diff --git a/openair1/PHY/TOOLS/cmult_sv.c b/openair1/PHY/TOOLS/cmult_sv.c
index 6cbf6ccd975..c967e1ac9ff 100644
--- a/openair1/PHY/TOOLS/cmult_sv.c
+++ b/openair1/PHY/TOOLS/cmult_sv.c
@@ -80,6 +80,7 @@ void rotate_cpx_vector(const c16_t *const x, const c16_t *const alpha, c16_t *y,
   // stores result in y
   // N is the number of complex numbers
   // output_shift reduces the result of the multiplication by this number of bits
+#if defined(__x86_64__) || defined (__i386__)
   if ( __builtin_cpu_supports("avx2")) {
     // output is 32 bytes aligned, but not the input
 
@@ -137,6 +138,7 @@ void rotate_cpx_vector(const c16_t *const x, const c16_t *const alpha, c16_t *y,
       *yLast=c16mulShift(*xTail,*alpha16,output_shift);
     }
   } else {
+#endif
     // Multiply elementwise two complex vectors of N elements
     // x        - input 1    in the format  |Re0  Im0 |,......,|Re(N-1) Im(N-1)|
     //            We assume x1 with a dynamic of 15 bit maximum
@@ -184,7 +186,9 @@ void rotate_cpx_vector(const c16_t *const x, const c16_t *const alpha, c16_t *y,
       xd+=4;
       y_128+=1;
     }
+#if defined(__x86__) || defined(__x86_64__)
   }
+#endif
 }
 
 #ifdef MAIN
-- 
GitLab