summaryrefslogtreecommitdiff
path: root/apps/codecs/libFLAC/include
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-02-19 22:11:29 +0000
committerDave Chapman <dave@dchapman.com>2005-02-19 22:11:29 +0000
commite9edc8f82df2c182c2453720a79ad37c55e6ef4b (patch)
tree4f3eea003ae0124feb2afb51d3a32bce56108f6f /apps/codecs/libFLAC/include
parenta3ed6e9c7a90cd5dcffed397c894e480672d667c (diff)
downloadrockbox-e9edc8f82df2c182c2453720a79ad37c55e6ef4b.tar.gz
rockbox-e9edc8f82df2c182c2453720a79ad37c55e6ef4b.zip
Thom Johansen's first EMAC optimisation for the Coldfire - about a 3%-4% speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6024 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libFLAC/include')
-rw-r--r--apps/codecs/libFLAC/include/private/coldfire.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/codecs/libFLAC/include/private/coldfire.h b/apps/codecs/libFLAC/include/private/coldfire.h
new file mode 100644
index 0000000000..22f1711f2c
--- /dev/null
+++ b/apps/codecs/libFLAC/include/private/coldfire.h
@@ -0,0 +1,46 @@
1#ifndef SIMULATOR
2#ifndef _FLAC_COLDFIRE_H
3#define _FLAC_COLDFIRE_H
4
5#include <FLAC/ordinals.h>
6
7#define MACL(x, y, acc) \
8 asm volatile ("mac.l %0, %1, %%" #acc \
9 : : "ad" ((x)), "ad" ((y)));
10
11#define MACL_SHIFT(x, y, shift, acc) \
12 asm volatile ("mac.l %0, %1, #" #shift ", %%" #acc \
13 : : "ad" ((x)), "ad" ((y)));
14
15#define MSACL(x, y, acc) \
16 asm volatile ("msac.l %0, %1, %%" #acc \
17 : : "ad" ((x)), "ad" ((y)));
18
19#define MSACL_SHIFT(x, y, shift, acc) \
20 asm volatile ("msac.l %0, %1, #" #shift ", %%" #acc \
21 : : "ad" ((x)), "ad" ((y)));
22
23#define SET_MACSR(x) \
24 asm volatile ("mov.l %0, %%macsr" : : "adi" ((x)));
25
26#define TRANSFER_ACC(acca, accb) \
27 asm volatile ("mov.l %" #acca ", %" #accb);
28
29#define SET_ACC(x, acc) \
30 asm volatile ("mov.l %0, %%" #acc : : "adi" ((x)));
31
32#define GET_ACC(x, acc) \
33 asm volatile ("mov.l %%" #acc ", %0\n\t" : "=ad" ((x)));
34
35#define GET_ACC_CLR(x, acc) \
36 asm volatile ("movclr.l %%" #acc ", %0\n\t" : "=ad" ((x)));
37
38#define EMAC_SATURATE 0x00000080
39#define EMAC_FRACTIONAL 0x00000020
40#define EMAC_ROUND 0x00000010
41
42
43void FLAC__lpc_restore_signal_order8_mac(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
44
45#endif
46#endif