diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-11-05 14:40:14 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-11-05 14:40:14 +0000 |
commit | 32c69452d699ce4dbf35e843b2f69507321e1b71 (patch) | |
tree | e0c977f82ba7e985cd9ac09a00ea3ce4497896e1 /apps/plugins/lib/gray.h | |
parent | 0b9e266b1e436ac34b9e2c2df4f3cea393b65cbd (diff) | |
download | rockbox-32c69452d699ce4dbf35e843b2f69507321e1b71.tar.gz rockbox-32c69452d699ce4dbf35e843b2f69507321e1b71.zip |
Grayscale lib: Using a 32x32->32 bit multiplication is better on ARM, as 16x16->32 bit isn't a single instruction. Renamed the macro for pointing out that it's not necessarily 16 bit anymore, and to avoid collisions with similar macros in plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11436 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/gray.h')
-rw-r--r-- | apps/plugins/lib/gray.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/plugins/lib/gray.h b/apps/plugins/lib/gray.h index 460aa83a82..70808945bb 100644 --- a/apps/plugins/lib/gray.h +++ b/apps/plugins/lib/gray.h | |||
@@ -113,9 +113,13 @@ void gray_ub_scroll_down(int count); | |||
113 | #define _GRAY_RUNNING 0x0001 /* greyscale overlay is running */ | 113 | #define _GRAY_RUNNING 0x0001 /* greyscale overlay is running */ |
114 | #define _GRAY_DEFERRED_UPDATE 0x0002 /* lcd_update() requested */ | 114 | #define _GRAY_DEFERRED_UPDATE 0x0002 /* lcd_update() requested */ |
115 | 115 | ||
116 | /* unsigned 16 bit multiplication (a single instruction on the SH) */ | 116 | /* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit, |
117 | #define MULU16(a, b) ((unsigned long) \ | 117 | * whichever is faster for the architecture) */ |
118 | (((unsigned short) (a)) * ((unsigned short) (b)))) | 118 | #ifdef CPU_ARM |
119 | #define _GRAY_MULUQ(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b)))) | ||
120 | #else | ||
121 | #define _GRAY_MULUQ(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b)))) | ||
122 | #endif | ||
119 | 123 | ||
120 | /* The grayscale buffer management structure */ | 124 | /* The grayscale buffer management structure */ |
121 | struct _gray_info | 125 | struct _gray_info |