summaryrefslogtreecommitdiff
path: root/apps/codecs/libspc/spc_dsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspc/spc_dsp.c')
-rw-r--r--apps/codecs/libspc/spc_dsp.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/apps/codecs/libspc/spc_dsp.c b/apps/codecs/libspc/spc_dsp.c
index 0d07e5f04e..a5ad1ff877 100644
--- a/apps/codecs/libspc/spc_dsp.c
+++ b/apps/codecs/libspc/spc_dsp.c
@@ -840,7 +840,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
840 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), 840 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1),
841 [_2]"=&r"(_2), [_3]"=&r"(_3) 841 [_2]"=&r"(_2), [_3]"=&r"(_3)
842 : [fwd]"r"(fwd), [rev]"r"(rev), 842 : [fwd]"r"(fwd), [rev]"r"(rev),
843 [interp]"r"(interp)); 843 [interp]"r"(interp)
844 : "memory");
844 /* Apply voice envelope */ 845 /* Apply voice envelope */
845 asm volatile ( 846 asm volatile (
846 "mov %[_2], %[out], asr #(11-5) \r\n" /* To do >> 16 later */ 847 "mov %[_2], %[out], asr #(11-5) \r\n" /* To do >> 16 later */
@@ -876,7 +877,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
876 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), 877 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1),
877 [_2]"=&r"(_2), [_3]"=&r"(_3) 878 [_2]"=&r"(_2), [_3]"=&r"(_3)
878 : [fwd]"r"(fwd), [rev]"r"(rev), 879 : [fwd]"r"(fwd), [rev]"r"(rev),
879 [interp]"r"(interp)); 880 [interp]"r"(interp)
881 : "memory");
880 /* Apply voice envelope */ 882 /* Apply voice envelope */
881 asm volatile ( 883 asm volatile (
882 "mov %[_2], %[out], asr #11 \r\n" 884 "mov %[_2], %[out], asr #11 \r\n"
@@ -932,7 +934,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
932 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), 934 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1),
933 [_2]"=&r"(_2), [_3]"=&r"(_3) 935 [_2]"=&r"(_2), [_3]"=&r"(_3)
934 : [fwd]"r"(fwd), [rev]"r"(rev), 936 : [fwd]"r"(fwd), [rev]"r"(rev),
935 [interp]"r"(interp)); 937 [interp]"r"(interp)
938 : "memory");
936 asm volatile ( 939 asm volatile (
937 "mov %[out], %[out], asr#12 \r\n" 940 "mov %[out], %[out], asr#12 \r\n"
938 "add %[_0], %[out], %[_0], asr #12 \r\n" 941 "add %[_0], %[out], %[_0], asr #12 \r\n"
@@ -993,7 +996,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
993 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), 996 [_0]"=&r"(amp_0), [_1]"=&r"(amp_1),
994 [_2]"=&r"(_2), [_3]"=&r"(_3) 997 [_2]"=&r"(_2), [_3]"=&r"(_3)
995 : [fwd]"r"(fwd), [rev]"r"(rev), 998 : [fwd]"r"(fwd), [rev]"r"(rev),
996 [interp]"r"(interp)); 999 [interp]"r"(interp)
1000 : "memory");
997 1001
998 output = CLAMP16(output); 1002 output = CLAMP16(output);
999 } 1003 }
@@ -1128,7 +1132,9 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
1128 "sub %[y1], %[y1], %[y0] \r\n" 1132 "sub %[y1], %[y1], %[y0] \r\n"
1129 "mul %[f], %[y1], %[f] \r\n" 1133 "mul %[f], %[y1], %[f] \r\n"
1130 "add %[y0], %[y0], %[f], asr #12 \r\n" 1134 "add %[y0], %[y0], %[f], asr #12 \r\n"
1131 : [f]"+r"(f), [y0]"+r"(amp_0), [y1]"=&r"(amp_1)); 1135 : [f]"+r"(f), [y0]"+r"(amp_0), [y1]"=&r"(amp_1)
1136 :
1137 : "memory");
1132 } 1138 }
1133 1139
1134 voice->position += rate; 1140 voice->position += rate;
@@ -1347,7 +1353,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
1347 /* duplicate at +8 eliminates wrap checking below */ 1353 /* duplicate at +8 eliminates wrap checking below */
1348 "str %[fb_0], [%[fir_p], #28] \r\n" 1354 "str %[fb_0], [%[fir_p], #28] \r\n"
1349 : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) 1355 : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr)
1350 : [fb_0]"r"(fb_0), [mask]"i"(~FIR_BUF_MASK)); 1356 : [fb_0]"r"(fb_0), [mask]"i"(~FIR_BUF_MASK)
1357 : "memory");
1351 1358
1352 fir_coeff = (int32_t *)this->fir_coeff; 1359 fir_coeff = (int32_t *)this->fir_coeff;
1353 1360
@@ -1377,7 +1384,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
1377 : [acc0]"+r"(fb_0), [acc1]"=&r"(fb_1), [_0]"=&r"(_0), 1384 : [acc0]"+r"(fb_0), [acc1]"=&r"(fb_1), [_0]"=&r"(_0),
1378 [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) 1385 [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff)
1379 : 1386 :
1380 : "r0", "r1", "r2", "r3", "r4", "r5"); 1387 : "r0", "r1", "r2", "r3", "r4", "r5", "memory");
1381 1388
1382 /* Generate output */ 1389 /* Generate output */
1383 int amp_0, amp_1; 1390 int amp_0, amp_1;
@@ -1439,7 +1446,8 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
1439 "str %[fb_0], [%[fir_p], #56] \r\n" 1446 "str %[fb_0], [%[fir_p], #56] \r\n"
1440 "str %[fb_1], [%[fir_p], #60] \r\n" 1447 "str %[fb_1], [%[fir_p], #60] \r\n"
1441 : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) 1448 : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr)
1442 : [fb_0]"r"(fb_0), [fb_1]"r"(fb_1), [mask]"i"(~FIR_BUF_MASK)); 1449 : [fb_0]"r"(fb_0), [fb_1]"r"(fb_1), [mask]"i"(~FIR_BUF_MASK)
1450 : "memory");
1443 1451
1444 fir_coeff = this->fir_coeff; 1452 fir_coeff = this->fir_coeff;
1445 1453
@@ -1471,7 +1479,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf )
1471 : [fb_0]"+r"(fb_0), [fb_1]"+r"(fb_1), 1479 : [fb_0]"+r"(fb_0), [fb_1]"+r"(fb_1),
1472 [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) 1480 [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff)
1473 : 1481 :
1474 : "r0", "r1", "r2", "r3", "r4", "r5"); 1482 : "r0", "r1", "r2", "r3", "r4", "r5", "memory");
1475 1483
1476 /* Generate output */ 1484 /* Generate output */
1477 int amp_0 = (chans_0 * global_vol_0 + fb_0 * this->r.g.echo_volume_0) 1485 int amp_0 = (chans_0 * global_vol_0 + fb_0 * this->r.g.echo_volume_0)