diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-06-04 02:20:19 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-06-04 02:20:19 +0000 |
commit | 06a98b15bc0c6eff2c677dff07073ec78f67a41b (patch) | |
tree | 31039ab146e983e839da730a089af15f4dc71bac /apps/codecs/libspc | |
parent | 2e5b1b1a9cab0ff19170815fda13f40268126027 (diff) | |
download | rockbox-06a98b15bc0c6eff2c677dff07073ec78f67a41b.tar.gz rockbox-06a98b15bc0c6eff2c677dff07073ec78f67a41b.zip |
SPC codec: The inline asm 'memory' clobbers should be unneeded since the ASM either does not modify memory (only loads values), or it modifies things only other ASM blocks deal with and the operand constraints mark them as in/out/both.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26538 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspc')
-rw-r--r-- | apps/codecs/libspc/spc_dsp.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/apps/codecs/libspc/spc_dsp.c b/apps/codecs/libspc/spc_dsp.c index a5ad1ff877..0d07e5f04e 100644 --- a/apps/codecs/libspc/spc_dsp.c +++ b/apps/codecs/libspc/spc_dsp.c | |||
@@ -840,8 +840,7 @@ 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"); | ||
845 | /* Apply voice envelope */ | 844 | /* Apply voice envelope */ |
846 | asm volatile ( | 845 | asm volatile ( |
847 | "mov %[_2], %[out], asr #(11-5) \r\n" /* To do >> 16 later */ | 846 | "mov %[_2], %[out], asr #(11-5) \r\n" /* To do >> 16 later */ |
@@ -877,8 +876,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
877 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), | 876 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), |
878 | [_2]"=&r"(_2), [_3]"=&r"(_3) | 877 | [_2]"=&r"(_2), [_3]"=&r"(_3) |
879 | : [fwd]"r"(fwd), [rev]"r"(rev), | 878 | : [fwd]"r"(fwd), [rev]"r"(rev), |
880 | [interp]"r"(interp) | 879 | [interp]"r"(interp)); |
881 | : "memory"); | ||
882 | /* Apply voice envelope */ | 880 | /* Apply voice envelope */ |
883 | asm volatile ( | 881 | asm volatile ( |
884 | "mov %[_2], %[out], asr #11 \r\n" | 882 | "mov %[_2], %[out], asr #11 \r\n" |
@@ -934,8 +932,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
934 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), | 932 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), |
935 | [_2]"=&r"(_2), [_3]"=&r"(_3) | 933 | [_2]"=&r"(_2), [_3]"=&r"(_3) |
936 | : [fwd]"r"(fwd), [rev]"r"(rev), | 934 | : [fwd]"r"(fwd), [rev]"r"(rev), |
937 | [interp]"r"(interp) | 935 | [interp]"r"(interp)); |
938 | : "memory"); | ||
939 | asm volatile ( | 936 | asm volatile ( |
940 | "mov %[out], %[out], asr#12 \r\n" | 937 | "mov %[out], %[out], asr#12 \r\n" |
941 | "add %[_0], %[out], %[_0], asr #12 \r\n" | 938 | "add %[_0], %[out], %[_0], asr #12 \r\n" |
@@ -996,8 +993,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
996 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), | 993 | [_0]"=&r"(amp_0), [_1]"=&r"(amp_1), |
997 | [_2]"=&r"(_2), [_3]"=&r"(_3) | 994 | [_2]"=&r"(_2), [_3]"=&r"(_3) |
998 | : [fwd]"r"(fwd), [rev]"r"(rev), | 995 | : [fwd]"r"(fwd), [rev]"r"(rev), |
999 | [interp]"r"(interp) | 996 | [interp]"r"(interp)); |
1000 | : "memory"); | ||
1001 | 997 | ||
1002 | output = CLAMP16(output); | 998 | output = CLAMP16(output); |
1003 | } | 999 | } |
@@ -1132,9 +1128,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
1132 | "sub %[y1], %[y1], %[y0] \r\n" | 1128 | "sub %[y1], %[y1], %[y0] \r\n" |
1133 | "mul %[f], %[y1], %[f] \r\n" | 1129 | "mul %[f], %[y1], %[f] \r\n" |
1134 | "add %[y0], %[y0], %[f], asr #12 \r\n" | 1130 | "add %[y0], %[y0], %[f], asr #12 \r\n" |
1135 | : [f]"+r"(f), [y0]"+r"(amp_0), [y1]"=&r"(amp_1) | 1131 | : [f]"+r"(f), [y0]"+r"(amp_0), [y1]"=&r"(amp_1)); |
1136 | : | ||
1137 | : "memory"); | ||
1138 | } | 1132 | } |
1139 | 1133 | ||
1140 | voice->position += rate; | 1134 | voice->position += rate; |
@@ -1353,8 +1347,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
1353 | /* duplicate at +8 eliminates wrap checking below */ | 1347 | /* duplicate at +8 eliminates wrap checking below */ |
1354 | "str %[fb_0], [%[fir_p], #28] \r\n" | 1348 | "str %[fb_0], [%[fir_p], #28] \r\n" |
1355 | : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) | 1349 | : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) |
1356 | : [fb_0]"r"(fb_0), [mask]"i"(~FIR_BUF_MASK) | 1350 | : [fb_0]"r"(fb_0), [mask]"i"(~FIR_BUF_MASK)); |
1357 | : "memory"); | ||
1358 | 1351 | ||
1359 | fir_coeff = (int32_t *)this->fir_coeff; | 1352 | fir_coeff = (int32_t *)this->fir_coeff; |
1360 | 1353 | ||
@@ -1384,7 +1377,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
1384 | : [acc0]"+r"(fb_0), [acc1]"=&r"(fb_1), [_0]"=&r"(_0), | 1377 | : [acc0]"+r"(fb_0), [acc1]"=&r"(fb_1), [_0]"=&r"(_0), |
1385 | [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) | 1378 | [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) |
1386 | : | 1379 | : |
1387 | : "r0", "r1", "r2", "r3", "r4", "r5", "memory"); | 1380 | : "r0", "r1", "r2", "r3", "r4", "r5"); |
1388 | 1381 | ||
1389 | /* Generate output */ | 1382 | /* Generate output */ |
1390 | int amp_0, amp_1; | 1383 | int amp_0, amp_1; |
@@ -1446,8 +1439,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
1446 | "str %[fb_0], [%[fir_p], #56] \r\n" | 1439 | "str %[fb_0], [%[fir_p], #56] \r\n" |
1447 | "str %[fb_1], [%[fir_p], #60] \r\n" | 1440 | "str %[fb_1], [%[fir_p], #60] \r\n" |
1448 | : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) | 1441 | : [fir_p]"=&r"(fir_ptr), [t_fir_p]"+r"(this->fir_ptr) |
1449 | : [fb_0]"r"(fb_0), [fb_1]"r"(fb_1), [mask]"i"(~FIR_BUF_MASK) | 1442 | : [fb_0]"r"(fb_0), [fb_1]"r"(fb_1), [mask]"i"(~FIR_BUF_MASK)); |
1450 | : "memory"); | ||
1451 | 1443 | ||
1452 | fir_coeff = this->fir_coeff; | 1444 | fir_coeff = this->fir_coeff; |
1453 | 1445 | ||
@@ -1479,7 +1471,7 @@ void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) | |||
1479 | : [fb_0]"+r"(fb_0), [fb_1]"+r"(fb_1), | 1471 | : [fb_0]"+r"(fb_0), [fb_1]"+r"(fb_1), |
1480 | [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) | 1472 | [fir_p]"+r"(fir_ptr), [fir_c]"+r"(fir_coeff) |
1481 | : | 1473 | : |
1482 | : "r0", "r1", "r2", "r3", "r4", "r5", "memory"); | 1474 | : "r0", "r1", "r2", "r3", "r4", "r5"); |
1483 | 1475 | ||
1484 | /* Generate output */ | 1476 | /* Generate output */ |
1485 | int amp_0 = (chans_0 * global_vol_0 + fb_0 * this->r.g.echo_volume_0) | 1477 | int amp_0 = (chans_0 * global_vol_0 + fb_0 * this->r.g.echo_volume_0) |