00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
00037 void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack)
00038 {
00039 int i;
00040 for (i=0;i<shape_cb_size;i++)
00041 {
00042 __asm__ __volatile__ (
00043 "P0 = %0;\n\t"
00044 "LC0 = P0;\n\t"
00045 "P1 = %1;\n\t"
00046 "P2 = %2;\n\t"
00047 "P3 = %3;\n\t"
00048 "P0 = 1;\n\t"
00049 "L0 = 0;\n\t"
00050 "L1 = 0;\n\t"
00051 "R2 = 0;\n\t"
00052 "A1 = 0;\n\t"
00053 "LOOP outter%= LC0;\n\t"
00054 "LOOP_BEGIN outter%=;\n\t"
00055 "A0 = 0;\n\t"
00056 "P4 = P1;\n\t"
00057 "I1 = P2;\n\t"
00058 "R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
00059 "LOOP inner%= LC1 = P0;\n\t"
00060 "LOOP_BEGIN inner%=;\n\t"
00061 "A0 += R0.L*R1.L (IS) || R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
00062 "LOOP_END inner%=;\n\t"
00063 "R0 = A0;\n\t"
00064 "R0 >>>= 11;\n\t"
00065 "A1 += R0.L*R0.L (IS);\n\t"
00066 "W[P3++] = R0;\n\t"
00067 "P0 += 1;\n\t"
00068 "P2 += 2;\n\t"
00069 "LOOP_END outter%=;\n\t"
00070 "P4 = %4;\n\t"
00071 "R1 = A1;\n\t"
00072 "[P4] = R1;\n\t"
00073 :
00074 : "m" (subvect_size), "m" (shape_cb), "m" (r), "m" (resp), "m" (E)
00075 : "A0", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "I0", "I1", "L0", "L1", "A0", "A1", "memory"
00076 );
00077 shape_cb += subvect_size;
00078 resp += subvect_size;
00079 E++;
00080 }
00081 }
00082
00083 #define OVERRIDE_TARGET_UPDATE
00084 static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)
00085 {
00086 __asm__ __volatile__
00087 (
00088 "I0 = %0;\n\t"
00089 "I1 = %1;\n\t"
00090 "L0 = 0;\n\t"
00091 "L1 = 0;\n\t"
00092 "LOOP tupdate%= LC0 = %3;\n\t"
00093 "LOOP_BEGIN tupdate%=;\n\t"
00094 "R0.L = W[I0] || R1.L = W[I1++];\n\t"
00095 "R1 = (A1 = R1.L*%2.L) (IS);\n\t"
00096 "R1 >>>= 11;\n\t"
00097 "R0.L = R0.L - R1.L;\n\t"
00098 "W[I0++] = R0.L;\n\t"
00099 "LOOP_END tupdate%=;\n\t"
00100 :
00101 : "a" (t), "a" (r), "d" (g), "a" (len)
00102 : "R0", "R1", "A1", "I0", "I1", "L0", "L1"
00103 );
00104 }
00105