1 #include "allocator.h"
2 
3 #include <dsppp/fixed_point.hpp>
4 #include <dsppp/matrix.hpp>
5 
6 #include <cmsis_tests.h>
7 #include <iostream>
8 
9 
10 
11 #if defined(ARM_MATH_MVEI) || defined(ARM_MATH_MVEF)
external_debug(const PVector<Q15,16> & a0,const PVector<Q15,16> & a1,const PVector<Q15,16> & a2,const PVector<Q15,16> & a3,const PVector<Q15,16> & b,int l)12 Q15 external_debug(const PVector<Q15,16> &a0,
13     const PVector<Q15,16> &a1,
14     const PVector<Q15,16> &a2,
15     const PVector<Q15,16> &a3,
16                    const PVector<Q15,16> &b,
17                     int l)
18 {
19    int nb = l;
20    Q<33,30> acc0;
21    Q<33,30> acc1;
22    Q<33,30> acc2;
23    Q<33,30> acc3;
24    for(index_t i=0; i<nb; i+=8)
25    {
26         acc0 = inner::vmacc(acc0,a0.vector_op_tail(i,nb-i),b.vector_op_tail(i,nb-i),inner::vctpq<Q15>::mk(nb-i));
27         acc1 = inner::vmacc(acc1,a1.vector_op_tail(i,nb-i),b.vector_op_tail(i,nb-i),inner::vctpq<Q15>::mk(nb-i));
28         acc2 = inner::vmacc(acc2,a2.vector_op_tail(i,nb-i),b.vector_op_tail(i,nb-i),inner::vctpq<Q15>::mk(nb-i));
29         acc3 = inner::vmacc(acc3,a3.vector_op_tail(i,nb-i),b.vector_op_tail(i,nb-i),inner::vctpq<Q15>::mk(nb-i));
30    }
31    Q15 r0,r1,r2,r3;
32 
33    r0 = inner::from_accumulator(acc0);
34    r1 = inner::from_accumulator(acc1);
35    r2 = inner::from_accumulator(acc2);
36    r3 = inner::from_accumulator(acc3);
37 
38    return(r0+r1+r2+r3);
39 }
40 #else
external_debug(const PVector<Q15,16> & a0,const PVector<Q15,16> & a1,const PVector<Q15,16> & a2,const PVector<Q15,16> & a3,const PVector<Q15,16> & b,int l)41 Q15 external_debug(const PVector<Q15,16> &a0,
42     const PVector<Q15,16> &a1,
43     const PVector<Q15,16> &a2,
44     const PVector<Q15,16> &a3,
45                    const PVector<Q15,16> &b,
46                     int l)
47 {
48     (void)a0;
49     (void)a1;
50     (void)a2;
51     (void)a3;
52     (void)b;
53     (void)l;
54     return(a0[0]);
55 }
56 #endif