diff options
Diffstat (limited to 'apps/codecs/demac/libdemac/vector_math16_armv6.h')
-rw-r--r-- | apps/codecs/demac/libdemac/vector_math16_armv6.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/apps/codecs/demac/libdemac/vector_math16_armv6.h b/apps/codecs/demac/libdemac/vector_math16_armv6.h index 0ace6c5811..2ce62728cb 100644 --- a/apps/codecs/demac/libdemac/vector_math16_armv6.h +++ b/apps/codecs/demac/libdemac/vector_math16_armv6.h | |||
@@ -22,14 +22,14 @@ You should have received a copy of the GNU General Public License | |||
22 | along with this program; if not, write to the Free Software | 22 | along with this program; if not, write to the Free Software |
23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | 23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA |
24 | 24 | ||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define FUSED_VECTOR_MATH | 27 | #define FUSED_VECTOR_MATH |
28 | 28 | ||
29 | #if ORDER > 16 | 29 | #if ORDER > 16 |
30 | #define BLOCK_REPEAT "3" | 30 | #define REPEAT_BLOCK(x) x x x |
31 | #else | 31 | #else |
32 | #define BLOCK_REPEAT "1" | 32 | #define REPEAT_BLOCK(x) x |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* Calculate scalarproduct, then add a 2nd vector (fused for performance) | 35 | /* Calculate scalarproduct, then add a 2nd vector (fused for performance) |
@@ -77,7 +77,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) | |||
77 | "sadd16 r1, r1, r5 \n" | 77 | "sadd16 r1, r1, r5 \n" |
78 | "strd r0, [%[v1]], #8 \n" | 78 | "strd r0, [%[v1]], #8 \n" |
79 | 79 | ||
80 | ".rept " BLOCK_REPEAT "\n" | 80 | REPEAT_BLOCK( |
81 | "ldmia %[s2]!, {r5,r6} \n" | 81 | "ldmia %[s2]!, {r5,r6} \n" |
82 | "pkhtb r4, r4, r2 \n" | 82 | "pkhtb r4, r4, r2 \n" |
83 | "pkhtb r2, r2, r3 \n" | 83 | "pkhtb r2, r2, r3 \n" |
@@ -104,7 +104,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) | |||
104 | "sadd16 r0, r0, r6 \n" | 104 | "sadd16 r0, r0, r6 \n" |
105 | "sadd16 r1, r1, r5 \n" | 105 | "sadd16 r1, r1, r5 \n" |
106 | "strd r0, [%[v1]], #8 \n" | 106 | "strd r0, [%[v1]], #8 \n" |
107 | ".endr \n" | 107 | ) |
108 | 108 | ||
109 | "ldmia %[s2]!, {r5,r6} \n" | 109 | "ldmia %[s2]!, {r5,r6} \n" |
110 | "pkhtb r4, r4, r2 \n" | 110 | "pkhtb r4, r4, r2 \n" |
@@ -148,7 +148,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) | |||
148 | "sadd16 r1, r1, r7 \n" | 148 | "sadd16 r1, r1, r7 \n" |
149 | "strd r0, [%[v1]], #8 \n" | 149 | "strd r0, [%[v1]], #8 \n" |
150 | 150 | ||
151 | ".rept " BLOCK_REPEAT "\n" | 151 | REPEAT_BLOCK( |
152 | "smlad %[res], r2, r4, %[res] \n" | 152 | "smlad %[res], r2, r4, %[res] \n" |
153 | "ldrd r6, [%[s2]], #8 \n" | 153 | "ldrd r6, [%[s2]], #8 \n" |
154 | "smlad %[res], r3, r5, %[res] \n" | 154 | "smlad %[res], r3, r5, %[res] \n" |
@@ -165,7 +165,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) | |||
165 | "sadd16 r0, r0, r6 \n" | 165 | "sadd16 r0, r0, r6 \n" |
166 | "sadd16 r1, r1, r7 \n" | 166 | "sadd16 r1, r1, r7 \n" |
167 | "strd r0, [%[v1]], #8 \n" | 167 | "strd r0, [%[v1]], #8 \n" |
168 | ".endr \n" | 168 | ) |
169 | 169 | ||
170 | "smlad %[res], r2, r4, %[res] \n" | 170 | "smlad %[res], r2, r4, %[res] \n" |
171 | "ldrd r6, [%[s2]], #8 \n" | 171 | "ldrd r6, [%[s2]], #8 \n" |
@@ -246,7 +246,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) | |||
246 | "ssub16 r1, r1, r5 \n" | 246 | "ssub16 r1, r1, r5 \n" |
247 | "strd r0, [%[v1]], #8 \n" | 247 | "strd r0, [%[v1]], #8 \n" |
248 | 248 | ||
249 | ".rept " BLOCK_REPEAT "\n" | 249 | REPEAT_BLOCK( |
250 | "ldmia %[s2]!, {r5,r6} \n" | 250 | "ldmia %[s2]!, {r5,r6} \n" |
251 | "pkhtb r4, r4, r2 \n" | 251 | "pkhtb r4, r4, r2 \n" |
252 | "pkhtb r2, r2, r3 \n" | 252 | "pkhtb r2, r2, r3 \n" |
@@ -273,7 +273,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) | |||
273 | "ssub16 r0, r0, r6 \n" | 273 | "ssub16 r0, r0, r6 \n" |
274 | "ssub16 r1, r1, r5 \n" | 274 | "ssub16 r1, r1, r5 \n" |
275 | "strd r0, [%[v1]], #8 \n" | 275 | "strd r0, [%[v1]], #8 \n" |
276 | ".endr \n" | 276 | ) |
277 | 277 | ||
278 | "ldmia %[s2]!, {r5,r6} \n" | 278 | "ldmia %[s2]!, {r5,r6} \n" |
279 | "pkhtb r4, r4, r2 \n" | 279 | "pkhtb r4, r4, r2 \n" |
@@ -317,7 +317,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) | |||
317 | "ssub16 r1, r1, r7 \n" | 317 | "ssub16 r1, r1, r7 \n" |
318 | "strd r0, [%[v1]], #8 \n" | 318 | "strd r0, [%[v1]], #8 \n" |
319 | 319 | ||
320 | ".rept " BLOCK_REPEAT "\n" | 320 | REPEAT_BLOCK( |
321 | "smlad %[res], r2, r4, %[res] \n" | 321 | "smlad %[res], r2, r4, %[res] \n" |
322 | "ldrd r6, [%[s2]], #8 \n" | 322 | "ldrd r6, [%[s2]], #8 \n" |
323 | "smlad %[res], r3, r5, %[res] \n" | 323 | "smlad %[res], r3, r5, %[res] \n" |
@@ -334,7 +334,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) | |||
334 | "ssub16 r0, r0, r6 \n" | 334 | "ssub16 r0, r0, r6 \n" |
335 | "ssub16 r1, r1, r7 \n" | 335 | "ssub16 r1, r1, r7 \n" |
336 | "strd r0, [%[v1]], #8 \n" | 336 | "strd r0, [%[v1]], #8 \n" |
337 | ".endr \n" | 337 | ) |
338 | 338 | ||
339 | "smlad %[res], r2, r4, %[res] \n" | 339 | "smlad %[res], r2, r4, %[res] \n" |
340 | "ldrd r6, [%[s2]], #8 \n" | 340 | "ldrd r6, [%[s2]], #8 \n" |
@@ -400,7 +400,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) | |||
400 | #else | 400 | #else |
401 | "smuadx %[res], r0, r3 \n" | 401 | "smuadx %[res], r0, r3 \n" |
402 | #endif | 402 | #endif |
403 | ".rept " BLOCK_REPEAT "\n" | 403 | REPEAT_BLOCK( |
404 | "pkhtb r0, r6, r7 \n" | 404 | "pkhtb r0, r6, r7 \n" |
405 | "ldrd r2, [%[v1]], #8 \n" | 405 | "ldrd r2, [%[v1]], #8 \n" |
406 | "smladx %[res], r1, r0, %[res] \n" | 406 | "smladx %[res], r1, r0, %[res] \n" |
@@ -413,8 +413,8 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) | |||
413 | "pkhtb r3, r5, r6 \n" | 413 | "pkhtb r3, r5, r6 \n" |
414 | "ldrd r4, [%[v2]], #8 \n" | 414 | "ldrd r4, [%[v2]], #8 \n" |
415 | "smladx %[res], r0, r3, %[res] \n" | 415 | "smladx %[res], r0, r3, %[res] \n" |
416 | ".endr \n" | 416 | ) |
417 | 417 | ||
418 | "pkhtb r0, r6, r7 \n" | 418 | "pkhtb r0, r6, r7 \n" |
419 | "ldrd r2, [%[v1]], #8 \n" | 419 | "ldrd r2, [%[v1]], #8 \n" |
420 | "smladx %[res], r1, r0, %[res] \n" | 420 | "smladx %[res], r1, r0, %[res] \n" |
@@ -434,7 +434,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) | |||
434 | #endif | 434 | #endif |
435 | 435 | ||
436 | "b 99f \n" | 436 | "b 99f \n" |
437 | 437 | ||
438 | "20: \n" | 438 | "20: \n" |
439 | "ldrd r0, [%[v1]], #8 \n" | 439 | "ldrd r0, [%[v1]], #8 \n" |
440 | "ldmia %[v2]!, {r5-r7} \n" | 440 | "ldmia %[v2]!, {r5-r7} \n" |
@@ -446,7 +446,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) | |||
446 | #else | 446 | #else |
447 | "smuad %[res], r0, r5 \n" | 447 | "smuad %[res], r0, r5 \n" |
448 | #endif | 448 | #endif |
449 | ".rept " BLOCK_REPEAT "\n" | 449 | REPEAT_BLOCK( |
450 | "ldrd r4, [%[v2]], #8 \n" | 450 | "ldrd r4, [%[v2]], #8 \n" |
451 | "smlad %[res], r1, r6, %[res] \n" | 451 | "smlad %[res], r1, r6, %[res] \n" |
452 | "ldrd r0, [%[v1]], #8 \n" | 452 | "ldrd r0, [%[v1]], #8 \n" |
@@ -455,7 +455,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) | |||
455 | "smlad %[res], r3, r4, %[res] \n" | 455 | "smlad %[res], r3, r4, %[res] \n" |
456 | "ldrd r2, [%[v1]], #8 \n" | 456 | "ldrd r2, [%[v1]], #8 \n" |
457 | "smlad %[res], r0, r5, %[res] \n" | 457 | "smlad %[res], r0, r5, %[res] \n" |
458 | ".endr \n" | 458 | ) |
459 | 459 | ||
460 | #if ORDER > 32 | 460 | #if ORDER > 32 |
461 | "ldrd r4, [%[v2]], #8 \n" | 461 | "ldrd r4, [%[v2]], #8 \n" |